Skip to content

Commit a5fbbfc

Browse files
committed
fix: implement noTitle prop for field groups in ShowTable component
1 parent 5bcc605 commit a5fbbfc

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

adminforth/modules/restApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ActionCheckSource, AdminForthConfigMenuItem, AdminForthDataTypes, Admin
2020
AnnouncementBadgeResponse,
2121
GetBaseConfigResponse,
2222
ShowInResolved} from "../types/Common.js";
23+
import { fa } from "@faker-js/faker";
2324

2425
export async function interpretResource(
2526
adminUser: AdminUser,
@@ -542,6 +543,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
542543
...resource.options,
543544
fieldGroups: resource.options.fieldGroups?.map((group, i) => ({
544545
...group,
546+
noTitle: group.noTitle ?? false,
545547
groupName: translated[`fieldGroup${i}`] || group.groupName,
546548
})),
547549
bulkActions: allowedBulkActions.map(

adminforth/spa/src/components/ShowTable.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="overflow-x-auto rounded-default shadow-resourseFormShadow dark:shadow-darkResourseFormShadow">
3-
<div v-if="groupName" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-gray-600 text-gray-700 bg-lightFormHeading dark:bg-gray-700 dark:text-gray-400 rounded-t-lg">
3+
<div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-gray-600 text-gray-700 bg-lightFormHeading dark:bg-gray-700 dark:text-gray-400 rounded-t-lg">
44
{{ groupName }}
55
</div>
66
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 table-fixed">
@@ -75,6 +75,7 @@
7575
};
7676
}>;
7777
groupName?: string | null;
78+
noTitle?: boolean;
7879
resource: Record<string, any>;
7980
record: Record<string, any>;
8081
}>();

adminforth/spa/src/views/ShowView.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@
8383
:record="coreStore.record"
8484
/>
8585
</div>
86-
<template v-else>
86+
<template v-else>
8787
<template v-for="group in groups" :key="group.groupName">
8888
<ShowTable
8989
:columns="group.columns"
9090
:groupName="group.groupName"
91+
:noTitle="group.noTitle"
9192
:resource="coreStore.resource"
9293
:record="coreStore.record"
9394
/>

0 commit comments

Comments
 (0)