@swiss-ai-hub/web 0.298.3 → 0.300.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,10 @@ export const useCreateAgentInstance = defineMutation(() => {
21
21
  // Invalidate agent instances cache to refresh the list
22
22
  queryCache.invalidateQueries({ key: ['tenant', tenantId, 'agent-instances'] })
23
23
  queryCache.invalidateQueries({ key: ['tenant', tenantId, 'agent-class-instances', agentClass] })
24
+ // Creating an instance auto-grants the creator a per-instance admin role, so the tenant roles list
25
+ // and the creator's own account (roles + accessible services) are now stale
26
+ queryCache.invalidateQueries({ key: ['tenant', tenantId, 'roles'] })
27
+ queryCache.invalidateQueries({ key: ['tenant', tenantId, 'my_user'] })
24
28
  return result
25
29
  },
26
30
  })
@@ -20,6 +20,10 @@ export const useDeleteAgentInstance = defineMutation(() => {
20
20
 
21
21
  queryCache.invalidateQueries({ key: ['tenant', tenantId, 'agent-instances'] })
22
22
  queryCache.invalidateQueries({ key: ['tenant', tenantId, 'agent-class-instances', agentClass] })
23
+ // Deleting an instance removes its per-instance admin role, so the tenant roles list and the
24
+ // creator's own account (roles + accessible services) are now stale
25
+ queryCache.invalidateQueries({ key: ['tenant', tenantId, 'roles'] })
26
+ queryCache.invalidateQueries({ key: ['tenant', tenantId, 'my_user'] })
23
27
  },
24
28
  })
25
29
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "bbv Software Services AG (https://www.bbv.ch)",
5
5
  "type": "module",
6
- "version": "0.298.3",
6
+ "version": "0.300.0",
7
7
  "description": "Swiss AI Hub - Admin & Management UI (Nuxt 3 layer)",
8
8
  "main": "./nuxt.config.ts",
9
9
  "repository": {
@@ -47,7 +47,7 @@
47
47
  :key="group.agentClass"
48
48
  >
49
49
  <div
50
- v-if="showGroupHeader(group)"
50
+ v-if="(group.instances.length > 0 || (group.isAvailable && !hasActiveFilters)) && !showNoResults"
51
51
  class="pb-4"
52
52
  >
53
53
  <div class="flex items-center gap-2 pb-2">
@@ -88,7 +88,7 @@
88
88
  @clone="handleClone"
89
89
  />
90
90
  <AgentEmptyCard
91
- v-if="group.isAvailable && (!searchQuery && !status && !agentClass)"
91
+ v-if="group.isAvailable && !hasActiveFilters"
92
92
  @add="openCreateModal(group.agentClass)"
93
93
  />
94
94
  </div>
@@ -164,12 +164,16 @@ const statusOptions = computed(() => [
164
164
  { label: t('agent.list.filter.disabled'), value: 'disabled' },
165
165
  ])
166
166
 
167
+ const hasActiveFilters = computed(() =>
168
+ !!searchQuery.value || !!agentClass.value || !!status.value,
169
+ )
170
+
167
171
  const hasVisibleInstances = computed(() =>
168
172
  groupedAgents.value.some(group => group.instances.length > 0),
169
173
  )
170
174
 
171
175
  const showNoResults = computed(() =>
172
- !hasVisibleInstances.value && (!!searchQuery.value || !!agentClass.value || !!status.value),
176
+ !hasVisibleInstances.value && hasActiveFilters.value,
173
177
  )
174
178
 
175
179
  const openWorkflowModal = (group: AgentGroup) => {
@@ -177,13 +181,6 @@ const openWorkflowModal = (group: AgentGroup) => {
177
181
  workflowModalOpen.value = true
178
182
  }
179
183
 
180
- const hasActiveFilters = computed(() =>
181
- !!searchQuery.value || !!agentClass.value || !!status.value,
182
- )
183
-
184
- const showGroupHeader = (group: AgentGroup) =>
185
- hasActiveFilters.value ? group.instances.length > 0 : group.isAvailable
186
-
187
184
  const openCreateModal = (agentClass: string) => {
188
185
  selectedClassForCreate.value = agentClass
189
186
  initialDataForCreate.value = null