@vendure/dashboard 3.5.0-minor-202510031341 → 3.5.0-minor-202510161257

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 (220) hide show
  1. package/dist/plugin/dashboard.plugin.js +1 -1
  2. package/dist/plugin/default-page.html +1 -1
  3. package/dist/vite/utils/ast-utils.spec.js +3 -3
  4. package/dist/vite/utils/tsconfig-utils.js +2 -1
  5. package/dist/vite/vite-plugin-hmr.d.ts +8 -0
  6. package/dist/vite/vite-plugin-hmr.js +34 -0
  7. package/dist/vite/vite-plugin-theme.js +6 -6
  8. package/dist/vite/vite-plugin-transform-index.js +6 -1
  9. package/dist/vite/vite-plugin-vendure-dashboard.d.ts +31 -4
  10. package/dist/vite/vite-plugin-vendure-dashboard.js +89 -34
  11. package/package.json +18 -5
  12. package/src/app/app-providers.tsx +4 -1
  13. package/src/app/common/map-faceted-filter-fields.ts +21 -0
  14. package/src/app/main.tsx +3 -1
  15. package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +2 -2
  16. package/src/app/routes/_authenticated/_administrators/administrators.tsx +13 -3
  17. package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +6 -13
  18. package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +1 -1
  19. package/src/app/routes/_authenticated/_assets/assets.tsx +17 -1
  20. package/src/app/routes/_authenticated/_collections/collections.graphql.ts +1 -0
  21. package/src/app/routes/_authenticated/_collections/collections.tsx +5 -0
  22. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +0 -1
  23. package/src/app/routes/_authenticated/_customers/customers.tsx +9 -5
  24. package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +0 -6
  25. package/src/app/routes/_authenticated/_facets/components/facet-value-bulk-actions.tsx +16 -0
  26. package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +43 -12
  27. package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +14 -5
  28. package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +4 -8
  29. package/src/app/routes/_authenticated/_global-settings/utils/global-languages.ts +268 -0
  30. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +117 -92
  31. package/src/app/routes/_authenticated/_orders/components/order-address.tsx +15 -15
  32. package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +5 -5
  33. package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +2 -1
  34. package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +26 -27
  35. package/src/app/routes/_authenticated/_orders/components/order-table.tsx +5 -3
  36. package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +6 -9
  37. package/src/app/routes/_authenticated/_orders/orders.graphql.ts +17 -1
  38. package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +48 -281
  39. package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +59 -40
  40. package/src/app/routes/_authenticated/_orders/utils/order-utils.ts +73 -0
  41. package/src/app/routes/_authenticated/_orders/utils/use-modify-order.ts +312 -0
  42. package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +2 -2
  43. package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +4 -0
  44. package/src/app/routes/_authenticated/_product-variants/components/add-currency-dropdown.tsx +49 -0
  45. package/src/app/routes/_authenticated/_product-variants/components/add-stock-location-dropdown.tsx +56 -0
  46. package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +12 -0
  47. package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +178 -50
  48. package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +0 -6
  49. package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +0 -11
  50. package/src/app/routes/_authenticated/_products/products.tsx +6 -2
  51. package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +4 -8
  52. package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +0 -10
  53. package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +2 -2
  54. package/src/app/routes/_authenticated/_promotions/promotions.tsx +12 -0
  55. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +3 -10
  56. package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +2 -2
  57. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +2 -2
  58. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +4 -0
  59. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +4 -10
  60. package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +2 -2
  61. package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +2 -2
  62. package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +9 -0
  63. package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +1 -0
  64. package/src/app/routes/_authenticated/_zones/zones.graphql.ts +2 -2
  65. package/src/app/routes/login.tsx +2 -2
  66. package/src/i18n/locales/ar.po +420 -289
  67. package/src/i18n/locales/cs.po +420 -289
  68. package/src/i18n/locales/de.po +420 -289
  69. package/src/i18n/locales/en.po +420 -289
  70. package/src/i18n/locales/es.po +420 -289
  71. package/src/i18n/locales/fa.po +420 -289
  72. package/src/i18n/locales/fr.po +468 -337
  73. package/src/i18n/locales/he.po +420 -289
  74. package/src/i18n/locales/hr.po +420 -289
  75. package/src/i18n/locales/it.po +420 -289
  76. package/src/i18n/locales/ja.po +420 -289
  77. package/src/i18n/locales/nb.po +420 -289
  78. package/src/i18n/locales/ne.po +420 -289
  79. package/src/i18n/locales/pl.po +420 -289
  80. package/src/i18n/locales/pt_BR.po +420 -289
  81. package/src/i18n/locales/pt_PT.po +420 -289
  82. package/src/i18n/locales/ru.po +420 -289
  83. package/src/i18n/locales/sv.po +420 -289
  84. package/src/i18n/locales/tr.po +420 -289
  85. package/src/i18n/locales/uk.po +420 -289
  86. package/src/i18n/locales/zh_Hans.po +420 -289
  87. package/src/i18n/locales/zh_Hant.po +420 -289
  88. package/src/lib/components/data-input/affixed-input.stories.tsx +93 -0
  89. package/src/lib/components/data-input/affixed-input.tsx +5 -2
  90. package/src/lib/components/data-input/boolean-input.stories.tsx +102 -0
  91. package/src/lib/components/data-input/checkbox-input.stories.tsx +61 -0
  92. package/src/lib/components/data-input/customer-group-input.tsx +0 -1
  93. package/src/lib/components/data-input/datetime-input.stories.tsx +62 -0
  94. package/src/lib/components/data-input/datetime-input.tsx +27 -13
  95. package/src/lib/components/data-input/default-relation-input.tsx +18 -12
  96. package/src/lib/components/data-input/money-input.stories.tsx +88 -0
  97. package/src/lib/components/data-input/money-input.tsx +7 -11
  98. package/src/lib/components/data-input/number-input.stories.tsx +103 -0
  99. package/src/lib/components/data-input/number-input.tsx +16 -5
  100. package/src/lib/components/data-input/password-input.stories.tsx +65 -0
  101. package/src/lib/components/data-input/rich-text-input.stories.tsx +92 -0
  102. package/src/lib/components/data-input/slug-input.stories.tsx +232 -0
  103. package/src/lib/components/data-input/slug-input.tsx +9 -10
  104. package/src/lib/components/data-input/text-input.stories.tsx +52 -0
  105. package/src/lib/components/data-input/textarea-input.stories.tsx +55 -0
  106. package/src/lib/components/data-table/add-filter-menu.tsx +6 -1
  107. package/src/lib/components/data-table/column-header-wrapper.tsx +106 -0
  108. package/src/lib/components/data-table/data-table-bulk-action-item.tsx +11 -9
  109. package/src/lib/components/data-table/data-table-bulk-actions.tsx +4 -4
  110. package/src/lib/components/data-table/data-table-column-header.tsx +17 -14
  111. package/src/lib/components/data-table/data-table-faceted-filter.tsx +33 -11
  112. package/src/lib/components/data-table/data-table-filter-badge-editable.tsx +35 -0
  113. package/src/lib/components/data-table/data-table-filter-badge.tsx +28 -14
  114. package/src/lib/components/data-table/data-table-filter-dialog.tsx +28 -8
  115. package/src/lib/components/data-table/data-table-pagination.tsx +23 -7
  116. package/src/lib/components/data-table/data-table.stories.tsx +249 -0
  117. package/src/lib/components/data-table/data-table.tsx +39 -11
  118. package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +79 -34
  119. package/src/lib/components/data-table/use-generated-columns.tsx +55 -27
  120. package/src/lib/components/layout/generated-breadcrumbs.tsx +4 -12
  121. package/src/lib/components/layout/nav-user.tsx +19 -13
  122. package/src/lib/components/login/login-form.tsx +39 -123
  123. package/src/lib/components/shared/alerts.tsx +29 -17
  124. package/src/lib/components/shared/asset/asset-bulk-actions.tsx +3 -3
  125. package/src/lib/components/shared/asset/asset-gallery.stories.tsx +76 -0
  126. package/src/lib/components/shared/asset/asset-gallery.tsx +147 -113
  127. package/src/lib/components/shared/asset/asset-picker-dialog.stories.tsx +58 -0
  128. package/src/lib/components/shared/configurable-operation-input.tsx +1 -1
  129. package/src/lib/components/shared/customer-group-selector.tsx +5 -2
  130. package/src/lib/components/shared/detail-page-button.stories.tsx +52 -0
  131. package/src/lib/components/shared/facet-value-selector.stories.tsx +48 -0
  132. package/src/lib/components/shared/facet-value-selector.tsx +130 -34
  133. package/src/lib/components/shared/paginated-list-data-table.stories.tsx +212 -0
  134. package/src/lib/components/shared/paginated-list-data-table.tsx +12 -12
  135. package/src/lib/components/shared/permission-guard.stories.tsx +46 -0
  136. package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +2 -0
  137. package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +8 -4
  138. package/src/lib/components/shared/rich-text-editor/rich-text-editor.tsx +1 -0
  139. package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +40 -0
  140. package/src/lib/components/shared/vendure-image.stories.tsx +167 -0
  141. package/src/lib/components/shared/vendure-image.tsx +6 -7
  142. package/src/lib/components/ui/accordion.stories.tsx +33 -0
  143. package/src/lib/components/ui/alert-dialog.stories.tsx +48 -0
  144. package/src/lib/components/ui/alert.stories.tsx +35 -0
  145. package/src/lib/components/ui/aspect-ratio.stories.tsx +28 -0
  146. package/src/lib/components/ui/badge.stories.tsx +28 -0
  147. package/src/lib/components/ui/breadcrumb.stories.tsx +41 -0
  148. package/src/lib/components/ui/button.stories.tsx +38 -0
  149. package/src/lib/components/ui/calendar.stories.tsx +22 -0
  150. package/src/lib/components/ui/card.stories.tsx +28 -0
  151. package/src/lib/components/ui/carousel.stories.tsx +34 -0
  152. package/src/lib/components/ui/checkbox.stories.tsx +31 -0
  153. package/src/lib/components/ui/collapsible.stories.tsx +39 -0
  154. package/src/lib/components/ui/command.stories.tsx +44 -0
  155. package/src/lib/components/ui/context-menu.stories.tsx +38 -0
  156. package/src/lib/components/ui/dialog.stories.tsx +52 -0
  157. package/src/lib/components/ui/drawer.stories.tsx +50 -0
  158. package/src/lib/components/ui/dropdown-menu.stories.tsx +41 -0
  159. package/src/lib/components/ui/hover-card.stories.tsx +38 -0
  160. package/src/lib/components/ui/input-group.tsx +148 -0
  161. package/src/lib/components/ui/input-otp.stories.tsx +30 -0
  162. package/src/lib/components/ui/input.stories.tsx +38 -0
  163. package/src/lib/components/ui/label.stories.tsx +24 -0
  164. package/src/lib/components/ui/menubar.stories.tsx +53 -0
  165. package/src/lib/components/ui/navigation-menu.stories.tsx +54 -0
  166. package/src/lib/components/ui/pagination.stories.tsx +51 -0
  167. package/src/lib/components/ui/password-input.stories.tsx +32 -0
  168. package/src/lib/components/ui/password-input.tsx +33 -0
  169. package/src/lib/components/ui/popover.stories.tsx +33 -0
  170. package/src/lib/components/ui/progress.stories.tsx +27 -0
  171. package/src/lib/components/ui/radio-group.stories.tsx +34 -0
  172. package/src/lib/components/ui/resizable.stories.tsx +32 -0
  173. package/src/lib/components/ui/scroll-area.stories.tsx +31 -0
  174. package/src/lib/components/ui/select.stories.tsx +36 -0
  175. package/src/lib/components/ui/separator.stories.tsx +35 -0
  176. package/src/lib/components/ui/sheet.stories.tsx +50 -0
  177. package/src/lib/components/ui/sidebar-context.ts +16 -0
  178. package/src/lib/components/ui/sidebar.tsx +2 -13
  179. package/src/lib/components/ui/skeleton.stories.tsx +26 -0
  180. package/src/lib/components/ui/slider.stories.tsx +37 -0
  181. package/src/lib/components/ui/switch.stories.tsx +31 -0
  182. package/src/lib/components/ui/table.stories.tsx +52 -0
  183. package/src/lib/components/ui/tabs.stories.tsx +29 -0
  184. package/src/lib/components/ui/textarea.stories.tsx +32 -0
  185. package/src/lib/components/ui/toggle-group.stories.tsx +31 -0
  186. package/src/lib/components/ui/toggle.stories.tsx +39 -0
  187. package/src/lib/components/ui/tooltip.stories.tsx +30 -0
  188. package/src/lib/components/ui/tooltip.tsx +2 -2
  189. package/src/lib/framework/alert/alert-extensions.tsx +0 -11
  190. package/src/lib/framework/alert/alert-item.tsx +14 -19
  191. package/src/lib/framework/alert/alerts-indicator.tsx +14 -15
  192. package/src/lib/framework/alert/search-index-buffer-alert/search-index-buffer-alert.ts +41 -0
  193. package/src/lib/framework/component-registry/component-registry.tsx +3 -14
  194. package/src/lib/framework/dashboard-widget/base-widget.tsx +18 -9
  195. package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +0 -2
  196. package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +12 -11
  197. package/src/lib/framework/defaults.ts +9 -13
  198. package/src/lib/framework/extension-api/input-component-extensions.tsx +6 -1
  199. package/src/lib/framework/extension-api/logic/alerts.ts +3 -2
  200. package/src/lib/framework/extension-api/types/alerts.ts +12 -6
  201. package/src/lib/framework/extension-api/types/data-table.ts +5 -2
  202. package/src/lib/framework/extension-api/types/layout.ts +41 -1
  203. package/src/lib/framework/extension-api/types/login.ts +0 -21
  204. package/src/lib/framework/form-engine/value-transformers.ts +8 -1
  205. package/src/lib/framework/layout-engine/custom-form-page.stories.tsx +344 -0
  206. package/src/lib/framework/layout-engine/page-layout.tsx +69 -57
  207. package/src/lib/framework/layout-engine/page.stories.tsx +275 -0
  208. package/src/lib/framework/nav-menu/nav-menu-extensions.ts +32 -19
  209. package/src/lib/framework/page/detail-page.stories.tsx +151 -0
  210. package/src/lib/framework/page/detail-page.tsx +12 -15
  211. package/src/lib/framework/page/list-page.stories.tsx +217 -0
  212. package/src/lib/framework/page/list-page.tsx +8 -1
  213. package/src/lib/graphql/api.ts +18 -1
  214. package/src/lib/graphql/graphql-env.d.ts +1 -1
  215. package/src/lib/hooks/use-alerts.ts +84 -0
  216. package/src/lib/hooks/use-floating-bulk-actions.ts +2 -3
  217. package/src/lib/index.ts +12 -5
  218. package/src/lib/providers/alerts-provider.tsx +60 -0
  219. package/src/lib/providers/channel-provider.tsx +1 -0
  220. package/src/lib/providers/theme-provider.tsx +6 -3
@@ -51,11 +51,15 @@ function CustomerListPage() {
51
51
  },
52
52
  groups: {
53
53
  cell: ({ row }) => {
54
- return row.original.groups?.map(g => (
55
- <Badge variant="secondary" key={g.id}>
56
- {g.name}
57
- </Badge>
58
- ));
54
+ return (
55
+ <div className="flex flex-wrap gap-1">
56
+ {row.original.groups?.map(g => (
57
+ <Badge variant="secondary" key={g.id}>
58
+ {g.name}
59
+ </Badge>
60
+ ))}
61
+ </div>
62
+ );
59
63
  },
60
64
  },
61
65
  }}
@@ -90,12 +90,6 @@ export const DuplicateFacetsBulkAction: BulkActionComponent<any> = ({ selection,
90
90
  <DuplicateBulkAction
91
91
  entityType="Facet"
92
92
  duplicatorCode="facet-duplicator"
93
- duplicatorArguments={[
94
- {
95
- name: 'includeValues',
96
- value: 'true',
97
- },
98
- ]}
99
93
  requiredPermissions={['UpdateCatalog', 'UpdateFacet']}
100
94
  entityName="Facet"
101
95
  selection={selection}
@@ -0,0 +1,16 @@
1
+ import { BulkActionComponent } from '@/vdb/framework/extension-api/types/data-table.js';
2
+ import { DeleteBulkAction } from '../../../../common/delete-bulk-action.js';
3
+
4
+ import { deleteFacetValuesDocument } from '../facets.graphql.js';
5
+
6
+ export const DeleteFacetValuesBulkAction: BulkActionComponent<any> = ({ selection, table }) => {
7
+ return (
8
+ <DeleteBulkAction
9
+ mutationDocument={deleteFacetValuesDocument}
10
+ entityName="facets"
11
+ requiredPermissions={['DeleteCatalog', 'DeleteFacet']}
12
+ selection={selection}
13
+ table={table}
14
+ />
15
+ );
16
+ };
@@ -1,14 +1,17 @@
1
1
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
2
2
  import { PaginatedListDataTable } from '@/vdb/components/shared/paginated-list-data-table.js';
3
+ import { Button } from '@/vdb/components/ui/button.js';
3
4
  import { addCustomFields } from '@/vdb/framework/document-introspection/add-custom-fields.js';
4
5
  import { graphql } from '@/vdb/graphql/graphql.js';
6
+ import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
5
7
  import { Trans } from '@lingui/react/macro';
6
8
  import { Link } from '@tanstack/react-router';
7
- import { Button } from '@/vdb/components/ui/button.js';
8
- import { ColumnFiltersState, SortingState } from '@tanstack/react-table';
9
+ import { SortingState } from '@tanstack/react-table';
9
10
  import { PlusIcon } from 'lucide-react';
10
11
  import { useRef, useState } from 'react';
11
- import { deleteFacetValuesDocument } from '../facets.graphql.js';
12
+ import { DeleteFacetValuesBulkAction } from './facet-value-bulk-actions.js';
13
+
14
+ const pageId = 'facet-values-table';
12
15
 
13
16
  export const facetValueListDocument = graphql(`
14
17
  query FacetValueList($options: FacetValueListOptions) {
@@ -35,27 +38,49 @@ export function FacetValuesTable({ facetId, registerRefresher }: Readonly<FacetV
35
38
  const [sorting, setSorting] = useState<SortingState>([]);
36
39
  const [page, setPage] = useState(1);
37
40
  const [pageSize, setPageSize] = useState(10);
38
- const [filters, setFilters] = useState<ColumnFiltersState>([]);
41
+ const { setTableSettings, settings } = useUserSettings();
39
42
  const refreshRef = useRef<() => void>(() => {});
40
43
 
44
+ const tableSettings = pageId ? settings.tableSettings?.[pageId] : undefined;
45
+ const defaultVisibility = {
46
+ name: true,
47
+ code: true,
48
+ };
49
+
50
+ const columnVisibility = pageId
51
+ ? (tableSettings?.columnVisibility ?? defaultVisibility)
52
+ : defaultVisibility;
53
+ const columnOrder = pageId ? (tableSettings?.columnOrder ?? []) : ['name', 'code'];
54
+ const columnFilters = pageId ? tableSettings?.columnFilters : [];
55
+
41
56
  return (
42
57
  <>
43
58
  <PaginatedListDataTable
44
59
  listQuery={addCustomFields(facetValueListDocument)}
45
- deleteMutation={deleteFacetValuesDocument}
46
60
  page={page}
47
61
  itemsPerPage={pageSize}
48
62
  sorting={sorting}
49
- columnFilters={filters}
50
- onPageChange={(_, page, perPage) => {
51
- setPage(page);
52
- setPageSize(perPage);
63
+ columnFilters={columnFilters}
64
+ defaultColumnOrder={columnOrder}
65
+ defaultVisibility={columnVisibility}
66
+ onPageChange={(table, page, perPage) => {
67
+ if (pageId) {
68
+ setPageSize(perPage);
69
+ setPage(page);
70
+ }
53
71
  }}
54
- onSortChange={(_, sorting) => {
72
+ onSortChange={(table, sorting) => {
55
73
  setSorting(sorting);
56
74
  }}
57
- onFilterChange={(_, filters) => {
58
- setFilters(filters);
75
+ onFilterChange={(table, filters) => {
76
+ if (pageId) {
77
+ setTableSettings(pageId, 'columnFilters', filters);
78
+ }
79
+ }}
80
+ onColumnVisibilityChange={(table, columnVisibility) => {
81
+ if (pageId) {
82
+ setTableSettings(pageId, 'columnVisibility', columnVisibility);
83
+ }
59
84
  }}
60
85
  registerRefresher={refresher => {
61
86
  refreshRef.current = refresher;
@@ -94,6 +119,12 @@ export function FacetValuesTable({ facetId, registerRefresher }: Readonly<FacetV
94
119
  ),
95
120
  },
96
121
  }}
122
+ bulkActions={[
123
+ {
124
+ order: 400,
125
+ component: DeleteFacetValuesBulkAction,
126
+ },
127
+ ]}
97
128
  />
98
129
  <div className="mt-4">
99
130
  <Button asChild variant="outline">
@@ -1,3 +1,4 @@
1
+ import { SlugInput } from '@/vdb/components/data-input/index.js';
1
2
  import { PageBreadcrumb } from '@/vdb/components/layout/generated-breadcrumbs.js';
2
3
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
3
4
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
@@ -115,8 +116,8 @@ function FacetValueDetailPage() {
115
116
  </PageActionBarRight>
116
117
  </PageActionBar>
117
118
  <PageLayout>
118
- <PageBlock column="side" blockId="facet-info">
119
- {entity?.facet && (
119
+ {entity?.facet && (
120
+ <PageBlock column="side" blockId="facet-info">
120
121
  <div className="space-y-2">
121
122
  <div className="text-sm font-medium">
122
123
  <Trans>Facet</Trans>
@@ -124,8 +125,8 @@ function FacetValueDetailPage() {
124
125
  <div className="text-sm text-muted-foreground">{entity?.facet.name}</div>
125
126
  <div className="text-xs text-muted-foreground">{entity?.facet.code}</div>
126
127
  </div>
127
- )}
128
- </PageBlock>
128
+ </PageBlock>
129
+ )}
129
130
  <PageBlock column="main" blockId="main-form">
130
131
  <DetailFormGrid>
131
132
  <TranslatableFormFieldWrapper
@@ -138,7 +139,15 @@ function FacetValueDetailPage() {
138
139
  control={form.control}
139
140
  name="code"
140
141
  label={<Trans>Code</Trans>}
141
- render={({ field }) => <Input {...field} />}
142
+ render={({ field }) => (
143
+ <SlugInput
144
+ fieldName="code"
145
+ watchFieldName="name"
146
+ entityName="FacetValue"
147
+ entityId={entity?.id}
148
+ {...field}
149
+ />
150
+ )}
142
151
  />
143
152
  </DetailFormGrid>
144
153
  </PageBlock>
@@ -1,9 +1,9 @@
1
+ import { NumberInput } from '@/vdb/components/data-input/number-input.js';
1
2
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
2
3
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
3
4
  import { LanguageSelector } from '@/vdb/components/shared/language-selector.js';
4
5
  import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
5
6
  import { Button } from '@/vdb/components/ui/button.js';
6
- import { Input } from '@/vdb/components/ui/input.js';
7
7
  import { Switch } from '@/vdb/components/ui/switch.js';
8
8
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
9
9
  import { extendDetailFormQuery } from '@/vdb/framework/document-extension/extend-detail-form-query.js';
@@ -23,6 +23,7 @@ import { Trans, useLingui } from '@lingui/react/macro';
23
23
  import { createFileRoute, useNavigate } from '@tanstack/react-router';
24
24
  import { toast } from 'sonner';
25
25
  import { globalSettingsDocument, updateGlobalSettingsDocument } from './global-settings.graphql.js';
26
+ import { globalLanguageCodes } from './utils/global-languages.js';
26
27
 
27
28
  const pageId = 'global-settings';
28
29
 
@@ -119,6 +120,7 @@ function GlobalSettingsPage() {
119
120
  <LanguageSelector
120
121
  value={field.value ?? []}
121
122
  onChange={field.onChange}
123
+ availableLanguageCodes={globalLanguageCodes}
122
124
  multiple={true}
123
125
  />
124
126
  )}
@@ -134,13 +136,7 @@ function GlobalSettingsPage() {
134
136
  by product variants.
135
137
  </Trans>
136
138
  }
137
- render={({ field }) => (
138
- <Input
139
- value={field.value ?? []}
140
- onChange={e => field.onChange(Number(e.target.valueAsNumber))}
141
- type="number"
142
- />
143
- )}
139
+ render={({ field }) => <NumberInput {...field} />}
144
140
  />
145
141
  <FormFieldWrapper
146
142
  control={form.control}
@@ -0,0 +1,268 @@
1
+ export const globalLanguageCodes = [
2
+ /** Afrikaans */
3
+ 'af',
4
+ /** Akan */
5
+ 'ak',
6
+ /** Amharic */
7
+ 'am',
8
+ /** Arabic */
9
+ 'ar',
10
+ /** Assamese */
11
+ 'as',
12
+ /** Azerbaijani */
13
+ 'az',
14
+ /** Belarusian */
15
+ 'be',
16
+ /** Bulgarian */
17
+ 'bg',
18
+ /** Bambara */
19
+ 'bm',
20
+ /** Bangla */
21
+ 'bn',
22
+ /** Breton */
23
+ 'br',
24
+ /** Bosnian */
25
+ 'bs',
26
+ /** Catalan */
27
+ 'ca',
28
+ /** Chechen */
29
+ 'co',
30
+ /** Czech */
31
+ 'cs',
32
+ /** Welsh */
33
+ 'cy',
34
+ /** Danish */
35
+ 'da',
36
+ /** German */
37
+ 'de',
38
+ /** Ewe */
39
+ 'ee',
40
+ /** Greek */
41
+ 'el',
42
+ /** English */
43
+ 'en',
44
+ /** Esperanto */
45
+ 'eo',
46
+ /** Spanish */
47
+ 'es',
48
+ /** European Spanish */
49
+ 'es_ES',
50
+ /** Mexican Spanish */
51
+ 'es_MX',
52
+ /** Estonian */
53
+ 'et',
54
+ /** Basque */
55
+ 'eu',
56
+ /** Persian */
57
+ 'fa',
58
+ /** Dari */
59
+ 'fa_AF',
60
+ /** Finnish */
61
+ 'fi',
62
+ /** Faroese */
63
+ 'fo',
64
+ /** French */
65
+ 'fr',
66
+ /** Canadian French */
67
+ 'fr_CA',
68
+ /** Swiss French */
69
+ 'fr_CH',
70
+ /** Western Frisian */
71
+ 'fy',
72
+ /** Irish */
73
+ 'ga',
74
+ /** Scottish Gaelic */
75
+ 'gd',
76
+ /** Galician */
77
+ 'gl',
78
+ /** Gujarati */
79
+ 'gu',
80
+ /** Hausa */
81
+ 'ha',
82
+ /** Hebrew */
83
+ 'he',
84
+ /** Hindi */
85
+ 'hi',
86
+ /** Croatian */
87
+ 'hr',
88
+ /** Haitian Creole */
89
+ 'ht',
90
+ /** Hungarian */
91
+ 'hu',
92
+ /** Armenian */
93
+ 'hy',
94
+ /** Interlingua */
95
+ 'ia',
96
+ /** Indonesian */
97
+ 'id',
98
+ /** Igbo */
99
+ 'ig',
100
+ /** Icelandic */
101
+ 'is',
102
+ /** Italian */
103
+ 'it',
104
+ /** Japanese */
105
+ 'ja',
106
+ /** Javanese */
107
+ 'jv',
108
+ /** Georgian */
109
+ 'ka',
110
+ /** Kazakh */
111
+ 'kk',
112
+ /** Khmer */
113
+ 'km',
114
+ /** Kannada */
115
+ 'kn',
116
+ /** Korean */
117
+ 'ko',
118
+ /** Kurdish */
119
+ 'ku',
120
+ /** Kyrgyz */
121
+ 'ky',
122
+ /** Latin */
123
+ 'la',
124
+ /** Luxembourgish */
125
+ 'lb',
126
+ /** Ganda */
127
+ 'lg',
128
+ /** Lingala */
129
+ 'ln',
130
+ /** Lao */
131
+ 'lo',
132
+ /** Lithuanian */
133
+ 'lt',
134
+ /** Latvian */
135
+ 'lv',
136
+ /** Malagasy */
137
+ 'mg',
138
+ /** Maori */
139
+ 'mi',
140
+ /** Macedonian */
141
+ 'mk',
142
+ /** Malayalam */
143
+ 'ml',
144
+ /** Mongolian */
145
+ 'mn',
146
+ /** Marathi */
147
+ 'mr',
148
+ /** Malay */
149
+ 'ms',
150
+ /** Maltese */
151
+ 'mt',
152
+ /** Burmese */
153
+ 'my',
154
+ /** Norwegian Bokmål */
155
+ 'nb',
156
+ /** Nepali */
157
+ 'ne',
158
+ /** Dutch */
159
+ 'nl',
160
+ /** Flemish */
161
+ 'nl_BE',
162
+ /** Norwegian Nynorsk */
163
+ 'nn',
164
+ /** Nyanja */
165
+ 'ny',
166
+ /** Oromo */
167
+ 'om',
168
+ /** Odia */
169
+ 'or',
170
+ /** Punjabi */
171
+ 'pa',
172
+ /** Polish */
173
+ 'pl',
174
+ /** Pashto */
175
+ 'ps',
176
+ /** Portuguese */
177
+ 'pt',
178
+ /** Brazilian Portuguese */
179
+ 'pt_BR',
180
+ /** European Portuguese */
181
+ 'pt_PT',
182
+ /** Quechua */
183
+ 'qu',
184
+ /** Romansh */
185
+ 'rm',
186
+ /** Romanian */
187
+ 'ro',
188
+ /** Moldavian */
189
+ 'ro_MD',
190
+ /** Russian */
191
+ 'ru',
192
+ /** Kinyarwanda */
193
+ 'rw',
194
+ /** Sanskrit */
195
+ 'sa',
196
+ /** Sindhi */
197
+ 'sd',
198
+ /** Sinhala */
199
+ 'si',
200
+ /** Slovak */
201
+ 'sk',
202
+ /** Slovenian */
203
+ 'sl',
204
+ /** Samoan */
205
+ 'sm',
206
+ /** Shona */
207
+ 'sn',
208
+ /** Somali */
209
+ 'so',
210
+ /** Albanian */
211
+ 'sq',
212
+ /** Serbian */
213
+ 'sr',
214
+ /** Southern Sotho */
215
+ 'st',
216
+ /** Sundanese */
217
+ 'su',
218
+ /** Swedish */
219
+ 'sv',
220
+ /** Swahili */
221
+ 'sw',
222
+ /** Congo Swahili */
223
+ 'sw_CD',
224
+ /** Tamil */
225
+ 'ta',
226
+ /** Telugu */
227
+ 'te',
228
+ /** Tajik */
229
+ 'tg',
230
+ /** Thai */
231
+ 'th',
232
+ /** Tigrinya */
233
+ 'ti',
234
+ /** Turkmen */
235
+ 'tk',
236
+ /** Tongan */
237
+ 'to',
238
+ /** Turkish */
239
+ 'tr',
240
+ /** Tatar */
241
+ 'tt',
242
+ /** Uyghur */
243
+ 'ug',
244
+ /** Ukrainian */
245
+ 'uk',
246
+ /** Urdu */
247
+ 'ur',
248
+ /** Uzbek */
249
+ 'uz',
250
+ /** Vietnamese */
251
+ 'vi',
252
+ /** Wolof */
253
+ 'wo',
254
+ /** Xhosa */
255
+ 'xh',
256
+ /** Yiddish */
257
+ 'yi',
258
+ /** Yoruba */
259
+ 'yo',
260
+ /** Chinese */
261
+ 'zh',
262
+ /** Simplified Chinese */
263
+ 'zh_Hans',
264
+ /** Traditional Chinese */
265
+ 'zh_Hant',
266
+ /** Zulu */
267
+ 'zu',
268
+ ];