@vendure/dashboard 3.4.2-master-202509081248 → 3.4.2-master-202509110229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/package.json +4 -4
  2. package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +4 -4
  3. package/src/app/routes/_authenticated/_assets/assets.tsx +1 -0
  4. package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +1 -1
  5. package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -5
  6. package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +4 -4
  7. package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +4 -4
  8. package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +4 -4
  9. package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +5 -5
  10. package/src/app/routes/_authenticated/_facets/facets.tsx +5 -8
  11. package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +4 -4
  12. package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +4 -4
  13. package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +2 -2
  14. package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +1 -1
  15. package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +5 -1
  16. package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +1 -1
  17. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +4 -4
  18. package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +5 -5
  19. package/src/app/routes/_authenticated/_products/products_.$id.tsx +4 -4
  20. package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +2 -2
  21. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +5 -5
  22. package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +4 -4
  23. package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +4 -4
  24. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +4 -4
  25. package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +4 -4
  26. package/src/app/routes/_authenticated/_system/healthchecks.tsx +1 -0
  27. package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +4 -4
  28. package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +5 -4
  29. package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +4 -4
  30. package/src/lib/components/data-input/affixed-input.tsx +18 -0
  31. package/src/lib/components/data-input/boolean-input.tsx +7 -0
  32. package/src/lib/components/data-input/checkbox-input.tsx +7 -0
  33. package/src/lib/components/data-input/datetime-input.tsx +7 -0
  34. package/src/lib/components/data-input/money-input.tsx +8 -0
  35. package/src/lib/components/data-input/number-input.tsx +7 -0
  36. package/src/lib/components/data-input/password-input.tsx +7 -0
  37. package/src/lib/components/data-input/rich-text-input.tsx +7 -0
  38. package/src/lib/components/data-input/text-input.tsx +7 -0
  39. package/src/lib/components/data-input/textarea-input.tsx +7 -0
  40. package/src/lib/components/data-table/data-table-view-options.tsx +29 -26
  41. package/src/lib/components/data-table/data-table.tsx +20 -0
  42. package/src/lib/components/data-table/types.ts +39 -0
  43. package/src/lib/components/layout/channel-switcher.tsx +1 -3
  44. package/src/lib/components/layout/generated-breadcrumbs.tsx +103 -43
  45. package/src/lib/components/shared/asset/asset-gallery.tsx +58 -0
  46. package/src/lib/components/shared/asset/asset-picker-dialog.tsx +39 -0
  47. package/src/lib/components/shared/detail-page-button.tsx +8 -22
  48. package/src/lib/components/shared/facet-value-chip.tsx +7 -0
  49. package/src/lib/components/shared/facet-value-selector.tsx +55 -0
  50. package/src/lib/components/shared/form-field-wrapper.tsx +51 -0
  51. package/src/lib/components/shared/paginated-list-data-table.tsx +128 -16
  52. package/src/lib/components/shared/permission-guard.tsx +30 -0
  53. package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +1 -1
  54. package/src/lib/components/shared/translatable-form-field.tsx +52 -0
  55. package/src/lib/components/shared/vendure-image.tsx +114 -2
  56. package/src/lib/framework/extension-api/define-dashboard-extension.ts +25 -3
  57. package/src/lib/framework/extension-api/extension-api-types.ts +12 -3
  58. package/src/lib/framework/extension-api/types/alerts.ts +2 -3
  59. package/src/lib/framework/extension-api/types/data-table.ts +2 -2
  60. package/src/lib/framework/extension-api/types/detail-forms.ts +2 -2
  61. package/src/lib/framework/extension-api/types/form-components.ts +2 -2
  62. package/src/lib/framework/extension-api/types/layout.ts +24 -13
  63. package/src/lib/framework/extension-api/types/login.ts +6 -5
  64. package/src/lib/framework/extension-api/types/navigation.ts +3 -3
  65. package/src/lib/framework/extension-api/types/widgets.ts +7 -3
  66. package/src/lib/framework/form-engine/form-engine-types.ts +13 -7
  67. package/src/lib/framework/form-engine/use-generated-form.tsx +44 -0
  68. package/src/lib/framework/layout-engine/page-layout.tsx +94 -31
  69. package/src/lib/framework/page/detail-page.tsx +3 -5
  70. package/src/lib/framework/page/list-page.tsx +87 -5
  71. package/src/lib/framework/page/use-detail-page.ts +4 -5
  72. package/src/lib/graphql/api.ts +2 -2
  73. package/src/lib/graphql/graphql-env.d.ts +7 -16
  74. package/src/lib/hooks/use-auth.tsx +1 -3
  75. package/src/lib/hooks/use-channel.ts +4 -2
  76. package/src/lib/hooks/use-page-block.tsx +9 -0
  77. package/src/lib/hooks/use-permissions.ts +6 -2
  78. package/src/lib/index.ts +2 -0
  79. package/src/lib/providers/auth.tsx +34 -2
  80. package/src/lib/providers/channel-provider.tsx +22 -1
  81. package/src/lib/components/shared/table-cell/table-cell-types.ts +0 -33
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.4.2-master-202509081248",
4
+ "version": "3.4.2-master-202509110229",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -100,8 +100,8 @@
100
100
  "@types/react": "^19.0.10",
101
101
  "@types/react-dom": "^19.0.4",
102
102
  "@uidotdev/usehooks": "^2.4.1",
103
- "@vendure/common": "^3.4.2-master-202509081248",
104
- "@vendure/core": "^3.4.2-master-202509081248",
103
+ "@vendure/common": "^3.4.2-master-202509110229",
104
+ "@vendure/core": "^3.4.2-master-202509110229",
105
105
  "@vitejs/plugin-react": "^4.3.4",
106
106
  "acorn": "^8.11.3",
107
107
  "acorn-walk": "^8.3.2",
@@ -152,5 +152,5 @@
152
152
  "lightningcss-linux-arm64-musl": "^1.29.3",
153
153
  "lightningcss-linux-x64-musl": "^1.29.1"
154
154
  },
155
- "gitHead": "677040a4acf1ee12e1cd2f46fb75021d37954271"
155
+ "gitHead": "aa2d4766b02fe4a93df5042da403e763c4af173b"
156
156
  }
@@ -36,7 +36,7 @@ export const Route = createFileRoute('/_authenticated/_administrators/administra
36
36
  breadcrumb: (isNew, entity) => {
37
37
  const name = `${entity?.firstName} ${entity?.lastName}`;
38
38
  return [
39
- { path: '/administrators', label: 'Administrators' },
39
+ { path: '/administrators', label: <Trans>Administrators</Trans> },
40
40
  isNew ? <Trans>New administrator</Trans> : name,
41
41
  ];
42
42
  },
@@ -74,14 +74,14 @@ function AdministratorDetailPage() {
74
74
  },
75
75
  params: { id: params.id },
76
76
  onSuccess: async data => {
77
- toast(i18n.t('Successfully updated administrator'));
77
+ toast(i18n.t(creatingNewEntity ? 'Successfully created administrator' : 'Successfully updated administrator'));
78
78
  resetForm();
79
79
  if (creatingNewEntity) {
80
80
  await navigate({ to: `../$id`, params: { id: data.id } });
81
81
  }
82
82
  },
83
83
  onError: err => {
84
- toast(i18n.t('Failed to update administrator'), {
84
+ toast(i18n.t(creatingNewEntity ? 'Failed to create administrator' : 'Failed to update administrator'), {
85
85
  description: err instanceof Error ? err.message : 'Unknown error',
86
86
  });
87
87
  },
@@ -101,7 +101,7 @@ function AdministratorDetailPage() {
101
101
  type="submit"
102
102
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
103
103
  >
104
- <Trans>Update</Trans>
104
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
105
105
  </Button>
106
106
  </PermissionGuard>
107
107
  </PageActionBarRight>
@@ -6,6 +6,7 @@ import { DeleteAssetsBulkAction } from './components/asset-bulk-actions.js';
6
6
 
7
7
  export const Route = createFileRoute('/_authenticated/_assets/assets')({
8
8
  component: RouteComponent,
9
+ loader: () => ({ breadcrumb: () => <Trans>Assets</Trans> }),
9
10
  });
10
11
 
11
12
  function RouteComponent() {
@@ -35,7 +35,7 @@ export const Route = createFileRoute('/_authenticated/_assets/assets_/$id')({
35
35
  queryDocument: assetDetailDocument,
36
36
  breadcrumb(isNew, entity) {
37
37
  return [
38
- { path: '/assets', label: 'Assets' },
38
+ { path: '/assets', label: <Trans>Assets</Trans> },
39
39
  isNew ? <Trans>New asset</Trans> : (entity?.name ?? ''),
40
40
  ];
41
41
  },
@@ -37,7 +37,7 @@ export const Route = createFileRoute('/_authenticated/_channels/channels_/$id')(
37
37
  queryDocument: channelDetailDocument,
38
38
  breadcrumb(isNew, entity) {
39
39
  return [
40
- { path: '/channels', label: 'Channels' },
40
+ { path: '/channels', label: <Trans>Channels</Trans> },
41
41
  isNew ? <Trans>New channel</Trans> : <ChannelCodeLabel code={entity?.code ?? ''} />,
42
42
  ];
43
43
  },
@@ -82,20 +82,20 @@ function ChannelDetailPage() {
82
82
  params: { id: params.id },
83
83
  onSuccess: async data => {
84
84
  if (data.__typename === 'Channel') {
85
- toast(i18n.t('Successfully updated channel'));
85
+ toast(i18n.t(creatingNewEntity ? 'Successfully created channel' : 'Successfully updated channel'));
86
86
  refreshChannels();
87
87
  resetForm();
88
88
  if (creatingNewEntity) {
89
89
  await navigate({ to: `../$id`, params: { id: data.id } });
90
90
  }
91
91
  } else {
92
- toast(i18n.t('Failed to update channel'), {
92
+ toast(i18n.t(creatingNewEntity ? 'Failed to create channel' : 'Failed to update channel'), {
93
93
  description: data.message,
94
94
  });
95
95
  }
96
96
  },
97
97
  onError: err => {
98
- toast(i18n.t('Failed to update channel'), {
98
+ toast(i18n.t(creatingNewEntity ? 'Failed to create channel' : 'Failed to update channel'), {
99
99
  description: err instanceof Error ? err.message : 'Unknown error',
100
100
  });
101
101
  },
@@ -122,7 +122,7 @@ function ChannelDetailPage() {
122
122
  type="submit"
123
123
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
124
124
  >
125
- <Trans>Update</Trans>
125
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
126
126
  </Button>
127
127
  </PermissionGuard>
128
128
  </PageActionBarRight>
@@ -41,7 +41,7 @@ export const Route = createFileRoute('/_authenticated/_collections/collections_/
41
41
  pageId,
42
42
  queryDocument: collectionDetailDocument,
43
43
  breadcrumb: (isNew, entity) => [
44
- { path: '/collections', label: 'Collections' },
44
+ { path: '/collections', label: <Trans>Collections</Trans> },
45
45
  isNew ? <Trans>New collection</Trans> : entity?.name,
46
46
  ],
47
47
  }),
@@ -89,14 +89,14 @@ function CollectionDetailPage() {
89
89
  },
90
90
  params: { id: params.id },
91
91
  onSuccess: async data => {
92
- toast(i18n.t('Successfully updated collection'));
92
+ toast(i18n.t(creatingNewEntity ? 'Successfully created collection' : 'Successfully updated collection'));
93
93
  resetForm();
94
94
  if (creatingNewEntity) {
95
95
  await navigate({ to: `../$id`, params: { id: data.id } });
96
96
  }
97
97
  },
98
98
  onError: err => {
99
- toast(i18n.t('Failed to update collection'), {
99
+ toast(i18n.t(creatingNewEntity ? 'Failed to create collection' : 'Failed to update collection'), {
100
100
  description: err instanceof Error ? err.message : 'Unknown error',
101
101
  });
102
102
  },
@@ -118,7 +118,7 @@ function CollectionDetailPage() {
118
118
  type="submit"
119
119
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
120
120
  >
121
- <Trans>Update</Trans>
121
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
122
122
  </Button>
123
123
  </PermissionGuard>
124
124
  </PageActionBarRight>
@@ -31,7 +31,7 @@ export const Route = createFileRoute('/_authenticated/_countries/countries_/$id'
31
31
  pageId,
32
32
  queryDocument: countryDetailDocument,
33
33
  breadcrumb: (isNew, entity) => [
34
- { path: '/countries', label: 'Countries' },
34
+ { path: '/countries', label: <Trans>Countries</Trans> },
35
35
  isNew ? <Trans>New country</Trans> : entity?.name,
36
36
  ],
37
37
  }),
@@ -61,14 +61,14 @@ function CountryDetailPage() {
61
61
  },
62
62
  params: { id: params.id },
63
63
  onSuccess: async data => {
64
- toast(i18n.t('Successfully updated country'));
64
+ toast(i18n.t(creatingNewEntity ? 'Successfully created country' : 'Successfully updated country'));
65
65
  form.reset(form.getValues());
66
66
  if (creatingNewEntity) {
67
67
  await navigate({ to: `../$id`, params: { id: data.id } });
68
68
  }
69
69
  },
70
70
  onError: err => {
71
- toast(i18n.t('Failed to update country'), {
71
+ toast(i18n.t(creatingNewEntity ? 'Failed to create country' : 'Failed to update country'), {
72
72
  description: err instanceof Error ? err.message : 'Unknown error',
73
73
  });
74
74
  },
@@ -84,7 +84,7 @@ function CountryDetailPage() {
84
84
  type="submit"
85
85
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
86
86
  >
87
- <Trans>Update</Trans>
87
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
88
88
  </Button>
89
89
  </PermissionGuard>
90
90
  </PageActionBarRight>
@@ -34,7 +34,7 @@ export const Route = createFileRoute('/_authenticated/_customer-groups/customer-
34
34
  pageId,
35
35
  queryDocument: customerGroupDetailDocument,
36
36
  breadcrumb: (isNew, entity) => [
37
- { path: '/customer-groups', label: 'Customer groups' },
37
+ { path: '/customer-groups', label: <Trans>Customer Groups</Trans> },
38
38
  isNew ? <Trans>New customer group</Trans> : entity?.name,
39
39
  ],
40
40
  }),
@@ -61,14 +61,14 @@ function CustomerGroupDetailPage() {
61
61
  },
62
62
  params: { id: params.id },
63
63
  onSuccess: async data => {
64
- toast.success(i18n.t('Successfully updated customer group'));
64
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created customer group' : 'Successfully updated customer group'));
65
65
  resetForm();
66
66
  if (creatingNewEntity && data?.id) {
67
67
  await navigate({ to: `../$id`, params: { id: data.id } });
68
68
  }
69
69
  },
70
70
  onError: err => {
71
- toast.error(i18n.t('Failed to update customer group'), {
71
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create customer group' : 'Failed to update customer group'), {
72
72
  description: err instanceof Error ? err.message : 'Unknown error',
73
73
  });
74
74
  },
@@ -86,7 +86,7 @@ function CustomerGroupDetailPage() {
86
86
  type="submit"
87
87
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
88
88
  >
89
- <Trans>Update</Trans>
89
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
90
90
  </Button>
91
91
  </PermissionGuard>
92
92
  </PageActionBarRight>
@@ -55,7 +55,7 @@ export const Route = createFileRoute('/_authenticated/_customers/customers_/$id'
55
55
  pageId,
56
56
  queryDocument: customerDetailDocument,
57
57
  breadcrumb: (isNew, entity) => [
58
- { path: '/customers', label: 'Customers' },
58
+ { path: '/customers', label: <Trans>Customers</Trans> },
59
59
  isNew ? <Trans>New customer</Trans> : `${entity?.firstName} ${entity?.lastName}`,
60
60
  ],
61
61
  }),
@@ -89,19 +89,19 @@ function CustomerDetailPage() {
89
89
  params: { id: params.id },
90
90
  onSuccess: async data => {
91
91
  if (data.__typename === 'Customer') {
92
- toast.success(i18n.t('Successfully updated customer'));
92
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created customer' : 'Successfully updated customer'));
93
93
  resetForm();
94
94
  if (creatingNewEntity) {
95
95
  await navigate({ to: `../$id`, params: { id: data.id } });
96
96
  }
97
97
  } else {
98
- toast.error(i18n.t('Failed to update customer'), {
98
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create customer' : 'Failed to update customer'), {
99
99
  description: data.message,
100
100
  });
101
101
  }
102
102
  },
103
103
  onError: err => {
104
- toast.error(i18n.t('Failed to update customer'), {
104
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create customer' : 'Failed to update customer'), {
105
105
  description: err instanceof Error ? err.message : 'Unknown error',
106
106
  });
107
107
  },
@@ -150,7 +150,7 @@ function CustomerDetailPage() {
150
150
  type="submit"
151
151
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
152
152
  >
153
- <Trans>Update</Trans>
153
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
154
154
  </Button>
155
155
  </PermissionGuard>
156
156
  </PageActionBarRight>
@@ -17,16 +17,16 @@ import {
17
17
  } from './components/facet-bulk-actions.js';
18
18
  import { FacetValuesSheet } from './components/facet-values-sheet.js';
19
19
  import { deleteFacetDocument, facetListDocument } from './facets.graphql.js';
20
- import { DataTableCellComponent } from '@/vdb/components/shared/table-cell/table-cell-types.js';
20
+ import { DataTableCellComponent } from '@/vdb/components/data-table/types.js';
21
21
 
22
22
  export const Route = createFileRoute('/_authenticated/_facets/facets')({
23
23
  component: FacetListPage,
24
24
  loader: () => ({ breadcrumb: () => <Trans>Facets</Trans> }),
25
25
  });
26
26
 
27
- const FacetValuesCell: DataTableCellComponent<ResultOf<
28
- typeof facetListDocument
29
- >['facets']['items'][0]> = ({ row }) => {
27
+ const FacetValuesCell: DataTableCellComponent<ResultOf<typeof facetListDocument>['facets']['items'][0]> = ({
28
+ row,
29
+ }) => {
30
30
  const value = row.original.valueList;
31
31
  if (!value) {
32
32
  return null;
@@ -44,10 +44,7 @@ const FacetValuesCell: DataTableCellComponent<ResultOf<
44
44
  />
45
45
  );
46
46
  })}
47
- <FacetValuesSheet
48
- facetId={row.original.id}
49
- facetName={row.original.name}
50
- >
47
+ <FacetValuesSheet facetId={row.original.id} facetName={row.original.name}>
51
48
  {list.totalItems > 3 ? (
52
49
  <div>
53
50
  <Trans>+ {list.totalItems - 3} more</Trans>
@@ -36,7 +36,7 @@ export const Route = createFileRoute('/_authenticated/_facets/facets_/$facetId/v
36
36
  queryDocument: facetValueDetailDocument,
37
37
  breadcrumb(isNew, entity) {
38
38
  const facetName = entity?.facet.name ?? 'Facet Value';
39
- const breadcrumb: PageBreadcrumb[] = [{ path: '/facets', label: 'Facets' }];
39
+ const breadcrumb: PageBreadcrumb[] = [{ path: '/facets', label: <Trans>Facets</Trans> }];
40
40
  if (isNew) {
41
41
  breadcrumb.push(<Trans>New facet value</Trans>);
42
42
  } else if (entity) {
@@ -81,7 +81,7 @@ function FacetValueDetailPage() {
81
81
  },
82
82
  params: { id: params.id },
83
83
  onSuccess: async data => {
84
- toast(i18n.t('Successfully updated facet value'));
84
+ toast(i18n.t(creatingNewEntity ? 'Successfully created facet value' : 'Successfully updated facet value'));
85
85
  resetForm();
86
86
  const created = Array.isArray(data) ? data[0] : data;
87
87
  if (creatingNewEntity && created) {
@@ -89,7 +89,7 @@ function FacetValueDetailPage() {
89
89
  }
90
90
  },
91
91
  onError: err => {
92
- toast(i18n.t('Failed to update facet value'), {
92
+ toast(i18n.t(creatingNewEntity ? 'Failed to create facet value' : 'Failed to update facet value'), {
93
93
  description: err instanceof Error ? err.message : 'Unknown error',
94
94
  });
95
95
  },
@@ -107,7 +107,7 @@ function FacetValueDetailPage() {
107
107
  type="submit"
108
108
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
109
109
  >
110
- <Trans>Update</Trans>
110
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
111
111
  </Button>
112
112
  </PermissionGuard>
113
113
  </PageActionBarRight>
@@ -32,7 +32,7 @@ export const Route = createFileRoute('/_authenticated/_facets/facets_/$id')({
32
32
  pageId,
33
33
  queryDocument: facetDetailDocument,
34
34
  breadcrumb(isNew, entity) {
35
- return [{ path: '/facets', label: 'Facets' }, isNew ? <Trans>New facet</Trans> : entity?.name];
35
+ return [{ path: '/facets', label: <Trans>Facets</Trans> }, isNew ? <Trans>New facet</Trans> : entity?.name];
36
36
  },
37
37
  }),
38
38
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -72,14 +72,14 @@ function FacetDetailPage() {
72
72
  },
73
73
  params: { id: params.id },
74
74
  onSuccess: async data => {
75
- toast(i18n.t('Successfully updated facet'));
75
+ toast(i18n.t(creatingNewEntity ? 'Successfully created facet' : 'Successfully updated facet'));
76
76
  resetForm();
77
77
  if (creatingNewEntity) {
78
78
  await navigate({ to: `../$id`, params: { id: data.id } });
79
79
  }
80
80
  },
81
81
  onError: err => {
82
- toast(i18n.t('Failed to update facet'), {
82
+ toast(i18n.t(creatingNewEntity ? 'Failed to create facet' : 'Failed to update facet'), {
83
83
  description: err instanceof Error ? err.message : 'Unknown error',
84
84
  });
85
85
  },
@@ -95,7 +95,7 @@ function FacetDetailPage() {
95
95
  type="submit"
96
96
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
97
97
  >
98
- <Trans>Update</Trans>
98
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
99
99
  </Button>
100
100
  </PermissionGuard>
101
101
  </PageActionBarRight>
@@ -38,7 +38,7 @@ export const Route = createFileRoute('/_authenticated/_global-settings/global-se
38
38
  {},
39
39
  );
40
40
  return {
41
- breadcrumb: [{ path: '/global-settings', label: <Trans>Global settings</Trans> }],
41
+ breadcrumb: [{ path: '/global-settings', label: <Trans>Global Settings</Trans> }],
42
42
  };
43
43
  },
44
44
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -88,7 +88,7 @@ function GlobalSettingsPage() {
88
88
  return (
89
89
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
90
90
  <PageTitle>
91
- <Trans>Global settings</Trans>
91
+ <Trans>Global Settings</Trans>
92
92
  </PageTitle>
93
93
  <PageActionBar>
94
94
  <PageActionBarRight>
@@ -71,7 +71,7 @@ export const Route = createFileRoute('/_authenticated/_orders/orders_/$id')({
71
71
  }
72
72
 
73
73
  return {
74
- breadcrumb: [{ path: '/orders', label: 'Orders' }, result.order.code],
74
+ breadcrumb: [{ path: '/orders', label: <Trans>Orders</Trans> }, result.order.code],
75
75
  };
76
76
  },
77
77
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -62,7 +62,11 @@ export const Route = createFileRoute('/_authenticated/_orders/orders_/$id_/modif
62
62
  }
63
63
 
64
64
  return {
65
- breadcrumb: [{ path: '/orders', label: 'Orders' }, result.order.code, { label: 'Modify' }],
65
+ breadcrumb: [
66
+ { path: '/orders', label: <Trans>Orders</Trans> },
67
+ result.order.code,
68
+ { label: <Trans>Modify</Trans> },
69
+ ],
66
70
  };
67
71
  },
68
72
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -68,7 +68,7 @@ export const Route = createFileRoute('/_authenticated/_orders/orders_/draft/$id'
68
68
  }
69
69
 
70
70
  return {
71
- breadcrumb: [{ path: '/orders', label: 'Orders' }, result.order.code],
71
+ breadcrumb: [{ path: '/orders', label: <Trans>Orders</Trans> }, result.order.code],
72
72
  };
73
73
  },
74
74
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -39,7 +39,7 @@ export const Route = createFileRoute('/_authenticated/_payment-methods/payment-m
39
39
  queryDocument: paymentMethodDetailDocument,
40
40
  breadcrumb(_isNew, entity) {
41
41
  return [
42
- { path: '/payment-methods', label: 'Payment methods' },
42
+ { path: '/payment-methods', label: <Trans>Payment Methods</Trans> },
43
43
  _isNew ? <Trans>New payment method</Trans> : entity?.name,
44
44
  ];
45
45
  },
@@ -95,14 +95,14 @@ function PaymentMethodDetailPage() {
95
95
  },
96
96
  params: { id: params.id },
97
97
  onSuccess: async data => {
98
- toast.success(i18n.t('Successfully updated payment method'));
98
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created payment method' : 'Successfully updated payment method'));
99
99
  resetForm();
100
100
  if (creatingNewEntity) {
101
101
  await navigate({ to: `../$id`, params: { id: data.id } });
102
102
  }
103
103
  },
104
104
  onError: err => {
105
- toast.error(i18n.t('Failed to update payment method'), {
105
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create payment method' : 'Failed to update payment method'), {
106
106
  description: err instanceof Error ? err.message : 'Unknown error',
107
107
  });
108
108
  },
@@ -120,7 +120,7 @@ function PaymentMethodDetailPage() {
120
120
  type="submit"
121
121
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
122
122
  >
123
- <Trans>Update</Trans>
123
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
124
124
  </Button>
125
125
  </PermissionGuard>
126
126
  </PageActionBarRight>
@@ -46,12 +46,12 @@ export const Route = createFileRoute('/_authenticated/_product-variants/product-
46
46
  breadcrumb(_isNew, entity, location) {
47
47
  if ((location.search as any).from === 'product') {
48
48
  return [
49
- { path: '/product', label: 'Products' },
49
+ { path: '/product', label: <Trans>Products</Trans> },
50
50
  { path: `/products/${entity?.product.id}`, label: entity?.product.name ?? '' },
51
51
  entity?.name,
52
52
  ];
53
53
  }
54
- return [{ path: '/product-variants', label: 'Product Variants' }, entity?.name];
54
+ return [{ path: '/product-variants', label: <Trans>Product Variants</Trans> }, entity?.name];
55
55
  },
56
56
  }),
57
57
  errorComponent: ({ error }) => <ErrorPage message={error.message} />,
@@ -97,14 +97,14 @@ function ProductVariantDetailPage() {
97
97
  },
98
98
  params: { id: params.id },
99
99
  onSuccess: data => {
100
- toast.success(i18n.t('Successfully updated product'));
100
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created product variant' : 'Successfully updated product variant'));
101
101
  resetForm();
102
102
  if (creatingNewEntity) {
103
103
  navigate({ to: `../${(data as any)?.[0]?.id}`, from: Route.id });
104
104
  }
105
105
  },
106
106
  onError: err => {
107
- toast.error(i18n.t('Failed to update product'), {
107
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create product variant' : 'Failed to update product variant'), {
108
108
  description: err instanceof Error ? err.message : 'Unknown error',
109
109
  });
110
110
  },
@@ -124,7 +124,7 @@ function ProductVariantDetailPage() {
124
124
  type="submit"
125
125
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
126
126
  >
127
- <Trans>Update</Trans>
127
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
128
128
  </Button>
129
129
  </PermissionGuard>
130
130
  </PageActionBarRight>
@@ -40,7 +40,7 @@ export const Route = createFileRoute('/_authenticated/_products/products_/$id')(
40
40
  queryDocument: productDetailDocument,
41
41
  breadcrumb(isNew, entity) {
42
42
  return [
43
- { path: '/products', label: 'Products' },
43
+ { path: '/products', label: <Trans>Products</Trans> },
44
44
  isNew ? <Trans>New product</Trans> : entity?.name,
45
45
  ];
46
46
  },
@@ -81,14 +81,14 @@ function ProductDetailPage() {
81
81
  },
82
82
  params: { id: params.id },
83
83
  onSuccess: async data => {
84
- toast.success(i18n.t('Successfully updated product'));
84
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created product' : 'Successfully updated product'));
85
85
  resetForm();
86
86
  if (creatingNewEntity) {
87
87
  await navigate({ to: `../$id`, params: { id: data.id } });
88
88
  }
89
89
  },
90
90
  onError: err => {
91
- toast.error(i18n.t('Failed to update product'), {
91
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create product' : 'Failed to update product'), {
92
92
  description: err instanceof Error ? err.message : 'Unknown error',
93
93
  });
94
94
  },
@@ -104,7 +104,7 @@ function ProductDetailPage() {
104
104
  type="submit"
105
105
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
106
106
  >
107
- <Trans>Update</Trans>
107
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
108
108
  </Button>
109
109
  </PermissionGuard>
110
110
  </PageActionBarRight>
@@ -51,9 +51,9 @@ export const Route = createFileRoute('/_authenticated/_products/products_/$id_/v
51
51
  });
52
52
  return {
53
53
  breadcrumb: [
54
- { path: '/products', label: 'Products' },
54
+ { path: '/products', label: <Trans>Products</Trans> },
55
55
  { path: `/products/${params.id}`, label: result.product?.name },
56
- <Trans>Manage variants</Trans>,
56
+ <Trans>Manage Variants</Trans>,
57
57
  ],
58
58
  };
59
59
  },
@@ -40,7 +40,7 @@ export const Route = createFileRoute('/_authenticated/_promotions/promotions_/$i
40
40
  queryDocument: promotionDetailDocument,
41
41
  breadcrumb(isNew, entity) {
42
42
  return [
43
- { path: '/promotions', label: 'Promotions' },
43
+ { path: '/promotions', label: <Trans>Promotions</Trans> },
44
44
  isNew ? <Trans>New promotion</Trans> : entity?.name,
45
45
  ];
46
46
  },
@@ -99,19 +99,19 @@ function PromotionDetailPage() {
99
99
  params: { id: params.id },
100
100
  onSuccess: async data => {
101
101
  if (data.__typename === 'Promotion') {
102
- toast.success(i18n.t('Successfully updated promotion'));
102
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created promotion' : 'Successfully updated promotion'));
103
103
  resetForm();
104
104
  if (creatingNewEntity) {
105
105
  await navigate({ to: `../$id`, params: { id: data.id } });
106
106
  }
107
107
  } else {
108
- toast.error(i18n.t('Failed to update promotion'), {
108
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create promotion' : 'Failed to update promotion'), {
109
109
  description: data.message,
110
110
  });
111
111
  }
112
112
  },
113
113
  onError: err => {
114
- toast.error(i18n.t('Failed to update promotion'), {
114
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create promotion' : 'Failed to update promotion'), {
115
115
  description: err instanceof Error ? err.message : 'Unknown error',
116
116
  });
117
117
  },
@@ -127,7 +127,7 @@ function PromotionDetailPage() {
127
127
  type="submit"
128
128
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
129
129
  >
130
- <Trans>Update</Trans>
130
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
131
131
  </Button>
132
132
  </PermissionGuard>
133
133
  </PageActionBarRight>
@@ -31,7 +31,7 @@ export const Route = createFileRoute('/_authenticated/_roles/roles_/$id')({
31
31
  queryDocument: roleDetailDocument,
32
32
  breadcrumb(isNew, entity) {
33
33
  return [
34
- { path: '/roles', label: 'Roles' },
34
+ { path: '/roles', label: <Trans>Roles</Trans> },
35
35
  isNew ? <Trans>New role</Trans> : entity?.description,
36
36
  ];
37
37
  },
@@ -61,14 +61,14 @@ function RoleDetailPage() {
61
61
  },
62
62
  params: { id: params.id },
63
63
  onSuccess: async data => {
64
- toast.success(i18n.t('Successfully updated role'));
64
+ toast.success(i18n.t(creatingNewEntity ? 'Successfully created role' : 'Successfully updated role'));
65
65
  resetForm();
66
66
  if (creatingNewEntity) {
67
67
  await navigate({ to: `../$id`, params: { id: data.id } });
68
68
  }
69
69
  },
70
70
  onError: err => {
71
- toast.error(i18n.t('Failed to update role'), {
71
+ toast.error(i18n.t(creatingNewEntity ? 'Failed to create role' : 'Failed to update role'), {
72
72
  description: err instanceof Error ? err.message : 'Unknown error',
73
73
  });
74
74
  },
@@ -84,7 +84,7 @@ function RoleDetailPage() {
84
84
  type="submit"
85
85
  disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
86
86
  >
87
- <Trans>Update</Trans>
87
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
88
88
  </Button>
89
89
  </PermissionGuard>
90
90
  </PageActionBarRight>