Browse Source

fix(dashboard): Update additional columns usage

Michael Bromley 10 months ago
parent
commit
85e457ca93

+ 4 - 6
packages/dashboard/src/routes/_authenticated/_administrators/administrators.tsx

@@ -27,9 +27,8 @@ function AdministratorListPage() {
                     emailAddress: { contains: searchTerm },
                     emailAddress: { contains: searchTerm },
                 };
                 };
             }}
             }}
-            additionalColumns={[
-                {
-                    id: 'name',
+            additionalColumns={{
+                name: {
                     header: 'Name',
                     header: 'Name',
                     cell: ({ row }) => (
                     cell: ({ row }) => (
                         <DetailPageButton
                         <DetailPageButton
@@ -38,8 +37,7 @@ function AdministratorListPage() {
                         />
                         />
                     ),
                     ),
                 },
                 },
-                {
-                    id: 'roles',
+                roles: {
                     header: 'Roles',
                     header: 'Roles',
                     cell: ({ row }) => {
                     cell: ({ row }) => {
                         return (
                         return (
@@ -55,7 +53,7 @@ function AdministratorListPage() {
                         );
                         );
                     },
                     },
                 },
                 },
-            ]}
+            }}
             defaultVisibility={{
             defaultVisibility={{
                 emailAddress: true,
                 emailAddress: true,
             }}
             }}

+ 1 - 1
packages/dashboard/src/routes/_authenticated/_customers/customers.tsx

@@ -40,7 +40,7 @@ export function CustomerListPage() {
                     header: 'Status',
                     header: 'Status',
                     cell: ({ cell }) => {
                     cell: ({ cell }) => {
                         const value = cell.getValue();
                         const value = cell.getValue();
-                        return <CustomerStatusBadge user={value?.user} />;
+                        return <CustomerStatusBadge user={value} />;
                     },
                     },
                 },
                 },
             }}
             }}

+ 3 - 4
packages/dashboard/src/routes/_authenticated/_facets/components/facet-values-table.tsx

@@ -73,9 +73,8 @@ export function FacetValuesTable({ facetId }: FacetValuesTableProps) {
                     },
                     },
                 };
                 };
             }}
             }}
-            additionalColumns={[
-                {
-                    id: 'actions',
+            additionalColumns={{
+                actions: {
                     header: 'Actions',
                     header: 'Actions',
                     cell: ({ row }) => {
                     cell: ({ row }) => {
                         const [open, setOpen] = useState(false);
                         const [open, setOpen] = useState(false);
@@ -92,7 +91,7 @@ export function FacetValuesTable({ facetId }: FacetValuesTableProps) {
                         );
                         );
                     },
                     },
                 },
                 },
-            ]}
+            }}
         />
         />
     );
     );
 }
 }

+ 4 - 5
packages/dashboard/src/routes/_authenticated/_facets/facets.tsx

@@ -1,17 +1,16 @@
+import { FacetValueChip } from '@/components/shared/facet-value-chip.js';
 import { PermissionGuard } from '@/components/shared/permission-guard.js';
 import { PermissionGuard } from '@/components/shared/permission-guard.js';
-import { PageActionBar } from '@/framework/layout-engine/page-layout.js';
-import { addCustomFields } from '@/framework/document-introspection/add-custom-fields.js';
 import { Button } from '@/components/ui/button.js';
 import { Button } from '@/components/ui/button.js';
+import { addCustomFields } from '@/framework/document-introspection/add-custom-fields.js';
+import { PageActionBar } from '@/framework/layout-engine/page-layout.js';
 import { ListPage } from '@/framework/page/list-page.js';
 import { ListPage } from '@/framework/page/list-page.js';
+import { Trans } from '@lingui/react/macro';
 import { createFileRoute, Link } from '@tanstack/react-router';
 import { createFileRoute, Link } from '@tanstack/react-router';
 import { PlusIcon } from 'lucide-react';
 import { PlusIcon } from 'lucide-react';
-import { Trans } from '@lingui/react/macro';
 import { facetListDocument } from './facets.graphql.js';
 import { facetListDocument } from './facets.graphql.js';
-import { FacetValueChip } from '@/components/shared/facet-value-chip.js';
 
 
 import { ResultOf } from 'gql.tada';
 import { ResultOf } from 'gql.tada';
 import { FacetValuesSheet } from './components/facet-values-sheet.js';
 import { FacetValuesSheet } from './components/facet-values-sheet.js';
-import { Badge } from '@/components/ui/badge.js';
 
 
 export const Route = createFileRoute('/_authenticated/_facets/facets')({
 export const Route = createFileRoute('/_authenticated/_facets/facets')({
     component: FacetListPage,
     component: FacetListPage,

+ 3 - 4
packages/dashboard/src/routes/_authenticated/_zones/zones.tsx

@@ -26,9 +26,8 @@ function ZoneListPage() {
                     cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
                     cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
                 },
                 },
             }}
             }}
-            additionalColumns={[
-                {
-                    id: 'regions',
+            additionalColumns={{
+                regions: {
                     header: 'Regions',
                     header: 'Regions',
                     cell: ({ row }) => (
                     cell: ({ row }) => (
                         <ZoneCountriesSheet zoneId={row.original.id} zoneName={row.original.name}>
                         <ZoneCountriesSheet zoneId={row.original.id} zoneName={row.original.name}>
@@ -36,7 +35,7 @@ function ZoneListPage() {
                         </ZoneCountriesSheet>
                         </ZoneCountriesSheet>
                     ),
                     ),
                 },
                 },
-            ]}
+            }}
         />
         />
     );
     );
 }
 }