From 6eb5c141766c70240df5d9257646ba5f89651f7e Mon Sep 17 00:00:00 2001 From: upsiflu Date: Wed, 19 Mar 2025 13:18:04 +0100 Subject: [PATCH] feat(front): layout upload modal; use new components --- front/src/components/common/ActionTable.vue | 39 +- front/src/components/library/FileUpload.vue | 421 +++++++++--------- .../components/library/FileUploadWidget.vue | 10 +- .../views/content/libraries/FilesTable.vue | 13 +- 4 files changed, 244 insertions(+), 239 deletions(-) diff --git a/front/src/components/common/ActionTable.vue b/front/src/components/common/ActionTable.vue index b151bf558..2eb8e3450 100644 --- a/front/src/components/common/ActionTable.vue +++ b/front/src/components/common/ActionTable.vue @@ -18,7 +18,7 @@ interface Action { label: string isDangerous?: boolean allowAll?: boolean - confirmColor?: string + confirmColor?: 'success' | 'danger' confirmationMessage?: string filterChackable?: (item: any) => boolean } @@ -61,6 +61,13 @@ const checkable = computed(() => { .map(item => item[props.idField] as string) }) +// objects is `any`. +// Can we narrow down this type? +// TODO: Search `action-table` globally and narrow all +// `objectsData` props + +// Type Custom = A | B | C + const objects = computed(() => props.objectsData.results.map(object => { return props.customObjects.find(custom => custom[props.idField] === object[props.idField]) ?? object @@ -178,27 +185,27 @@ const gridColumns = computed(() => { columns += 1 } - return Array.from({ length: columns }, () => 'auto' as 'auto') + return Array.from({ length: columns }, () => 'auto' as const) })