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) })