Skip to content

Commit 95c600b

Browse files
committed
chore: update types for actionId in ResourceListTable and ResourceListTableVirtual, enhance v-for key in ThreeDotsMenu, and tidy up Common.ts
1 parent d40519e commit 95c600b

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

adminforth/spa/src/components/ResourceListTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ async function deleteRecord(row: any) {
533533
534534
const actionLoadingStates = ref<Record<string | number, boolean>>({});
535535
536-
async function startCustomAction(actionId: any, row: any) {
536+
async function startCustomAction(actionId: string, row: any) {
537537
actionLoadingStates.value[actionId] = true;
538538
539539
const data = await callAdminForthApi({

adminforth/spa/src/components/ResourceListTableVirtual.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ async function deleteRecord(row: any) {
553553
554554
const actionLoadingStates = ref<Record<string | number, boolean>>({});
555555
556-
async function startCustomAction(actionId: any, row: any) {
556+
async function startCustomAction(actionId: string, row: any) {
557557
actionLoadingStates.value[actionId] = true;
558558
559559
const data = await callAdminForthApi({

adminforth/spa/src/components/ThreeDotsMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template >
2-
<template v-if="threeDotsDropdownItems?.length || customActions?.length || (bulkActions?.some((action: any) => action.showInThreeDotsDropdown))">
2+
<template v-if="threeDotsDropdownItems?.length || customActions?.length || (bulkActions?.some((action: AdminForthBulkActionCommon) => action.showInThreeDotsDropdown))">
33
<button
44
data-dropdown-toggle="listThreeDotsDropdown"
55
class="flex items-center py-2 px-2 text-sm font-medium text-lightThreeDotsMenuIconDots focus:outline-none bg-lightThreeDotsMenuIconBackground rounded border border-lightThreeDotsMenuIconBackgroundBorder hover:bg-lightThreeDotsMenuIconBackgroundHover hover:text-lightThreeDotsMenuIconDotsHover focus:z-10 focus:ring-4 focus:ring-lightThreeDotsMenuIconFocus dark:focus:ring-darkThreeDotsMenuIconFocus dark:bg-darkThreeDotsMenuIconBackground dark:text-darkThreeDotsMenuIconDots dark:border-darkThreeDotsMenuIconBackgroundBorder dark:hover:text-darkThreeDotsMenuIconDotsHover dark:hover:bg-darkThreeDotsMenuIconBackgroundHover rounded-default"
@@ -14,7 +14,7 @@
1414
id="listThreeDotsDropdown"
1515
class="z-20 hidden bg-lightThreeDotsMenuBodyBackground divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-darkThreeDotsMenuBodyBackground dark:divide-gray-600">
1616
<ul class="py-2 text-sm text-lightThreeDotsMenuBodyText dark:text-darkThreeDotsMenuBodyText" aria-labelledby="dropdownMenuIconButton">
17-
<li v-for="item in threeDotsDropdownItems">
17+
<li v-for="item in threeDotsDropdownItems" :key="`dropdown-item-${item.file}`">
1818
<a href="#"
1919
class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
2020
:class="{

adminforth/spa/src/views/ShowView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const loading = ref(true);
147147
const { t } = useI18n();
148148
const coreStore = useCoreStore();
149149
150-
const actionLoadingStates = ref<Record<string, boolean>>({})
150+
const actionLoadingStates = ref<Record<string, boolean>>({});
151151
152152
const customActions = computed(() => {
153153
return coreStore.resource?.options?.actions?.filter(a => a.showIn?.showThreeDotsMenu) || [];

adminforth/types/Common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ export interface AdminForthResourceInputCommon {
358358
/*
359359
* Custom actions list. Actions available in show, edit and create views.
360360
*/
361-
actions?: AdminForthActionInput[], // TODO check if type correct
362-
361+
actions?: AdminForthActionInput[],
362+
363363
/**
364364
* Custom bulk actions list. Bulk actions available in list view when user selects multiple records by
365365
* using checkboxes.

0 commit comments

Comments
 (0)