fix: show published models and support multi-model key selection
This commit is contained in:
1 parent
1a57de5bf9
commit
0a44a0802b
14 files changed
+360
-60
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import type { CatalogModel, LogicalModel } from './catalog'
|
||||
|
||||
// Browse published definitions even when none of their routes are enabled yet.
|
||||
// Route IDs remain the exact authorization and invocation identifiers.
|
||||
export function buildModelCatalog(definitions: LogicalModel[], routes: CatalogModel[]) {
|
||||
return definitions.filter(model => model.status === 'active').map(definition => ({
|
||||
definition,
|
||||
groups: routes.filter(route => route.logicalModelId === definition.id && route.status === 'active'),
|
||||
}))
|
||||
}
|
||||
|
||||
export function setGroupSelection(selected: string[], groupIds: string[], checked: boolean): string[] {
|
||||
return checked ? [...new Set([...selected, ...groupIds])] : selected.filter(id => !groupIds.includes(id))
|
||||
}
|
||||
Reference in new issue
Block a user