Parcourir la source

fix(dashboard): Fix default channel list columns

Michael Bromley il y a 7 mois
Parent
commit
c552aa595f

+ 18 - 0
packages/dashboard/src/app/routes/_authenticated/_channels/channels.tsx

@@ -8,6 +8,7 @@ import { Trans } from '@/lib/trans.js';
 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 { channelListQuery, deleteChannelDocument } from './channels.graphql.js';
 import { channelListQuery, deleteChannelDocument } from './channels.graphql.js';
+import { useLocalFormat } from '@/hooks/use-local-format.js';
 
 
 export const Route = createFileRoute('/_authenticated/_channels/channels')({
 export const Route = createFileRoute('/_authenticated/_channels/channels')({
     component: ChannelListPage,
     component: ChannelListPage,
@@ -15,6 +16,7 @@ export const Route = createFileRoute('/_authenticated/_channels/channels')({
 });
 });
 
 
 function ChannelListPage() {
 function ChannelListPage() {
+    const { formatLanguageName } = useLocalFormat();
     return (
     return (
         <ListPage
         <ListPage
             pageId="channel-list"
             pageId="channel-list"
@@ -25,6 +27,10 @@ function ChannelListPage() {
             defaultVisibility={{
             defaultVisibility={{
                 code: true,
                 code: true,
                 token: true,
                 token: true,
+                availableCurrencyCodes: false,
+                availableLanguageCodes: false,
+                defaultTaxZone: false,
+                defaultShippingZone: false,
             }}
             }}
             onSearchTermChange={searchTerm => {
             onSearchTermChange={searchTerm => {
                 return {
                 return {
@@ -43,6 +49,18 @@ function ChannelListPage() {
                         );
                         );
                     },
                     },
                 },
                 },
+                seller: {
+                    header: 'Seller',
+                    cell: ({ row }) => {
+                        return row.original.seller?.name;
+                    }
+                },
+                defaultLanguageCode: {
+                    header: 'Default Language',
+                    cell: ({ row }) => {
+                        return formatLanguageName(row.original.defaultLanguageCode);
+                    }
+                },
             }}
             }}
         >
         >
             <PageActionBarRight>
             <PageActionBarRight>