@swiss-ai-hub/web 0.310.4 → 0.310.6

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.
@@ -24,6 +24,8 @@
24
24
  :sort-order="sortOrder"
25
25
  removable-sort
26
26
  size="small"
27
+ :select-all="allDeletableSelected"
28
+ @select-all-change="onSelectAllChange"
27
29
  @row-click="handleRowClick"
28
30
  @sort="handleSort"
29
31
  >
@@ -38,9 +40,7 @@
38
40
  >
39
41
  <template #body="{ data }">
40
42
  <div class="flex items-center gap-2">
41
- <p
42
- class="font-bold"
43
- >
43
+ <p class="font-bold">
44
44
  {{ data.document_title }}
45
45
  </p>
46
46
  <div
@@ -91,9 +91,7 @@
91
91
  :header="t('document.list.number_of_pages')"
92
92
  >
93
93
  <template #body="{ data }">
94
- <Badge
95
- :value="data.number_of_pages ?? '-'"
96
- />
94
+ <Badge :value="data.number_of_pages ?? '-'" />
97
95
  </template>
98
96
  </Column>
99
97
  <Column
@@ -184,17 +182,16 @@ watch(
184
182
  { immediate: true },
185
183
  )
186
184
 
187
- // Drop any selected document that is no longer deletable — either picked by "select all" while
188
- // processing, or flipped to "deleting" by a single-row delete after it was already selected.
189
- watch(
190
- () => checkedDocuments.value.filter(document => !isDocumentDeletable(document)).length,
191
- (nonDeletableCount) => {
192
- if (nonDeletableCount > 0) {
193
- checkedDocuments.value = checkedDocuments.value.filter(isDocumentDeletable)
194
- }
195
- },
185
+ const deletableDocuments = computed(() => props.documents.filter(isDocumentDeletable))
186
+
187
+ const allDeletableSelected = computed(
188
+ () => deletableDocuments.value.length > 0 && checkedDocuments.value.length === deletableDocuments.value.length,
196
189
  )
197
190
 
191
+ const onSelectAllChange = ({ checked }: { checked: boolean }) => {
192
+ checkedDocuments.value = checked ? [...deletableDocuments.value] : []
193
+ }
194
+
198
195
  const handleRowClick = (event: DataTableRowClickEvent) => {
199
196
  const document = event.data as DocumentDto
200
197
  if (document.is_ingested && !isDocumentDeleting(document)) {
@@ -243,6 +240,7 @@ const handleDelete = async (document: DocumentDto) => {
243
240
  documentId: document.id,
244
241
  })
245
242
  schedule([document.id])
243
+ checkedDocuments.value = checkedDocuments.value.filter(selected => selected.id !== document.id)
246
244
  toast.add({
247
245
  severity: 'success',
248
246
  summary: t('document.delete.success'),
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.310.4",
6
+ "version": "0.310.6",
7
7
  "description": "Swiss AI Hub - Admin & Management UI (Nuxt 3 layer)",
8
8
  "main": "./nuxt.config.ts",
9
9
  "repository": {