@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.
- package/dist/plugin/dashboard.plugin.js +1 -1
- package/dist/plugin/default-page.html +1 -1
- package/dist/vite/utils/ast-utils.spec.js +3 -3
- package/dist/vite/utils/tsconfig-utils.js +2 -1
- package/dist/vite/vite-plugin-hmr.d.ts +8 -0
- package/dist/vite/vite-plugin-hmr.js +34 -0
- package/dist/vite/vite-plugin-theme.js +6 -6
- package/dist/vite/vite-plugin-transform-index.js +6 -1
- package/dist/vite/vite-plugin-vendure-dashboard.d.ts +31 -4
- package/dist/vite/vite-plugin-vendure-dashboard.js +89 -34
- package/package.json +18 -5
- package/src/app/app-providers.tsx +4 -1
- package/src/app/common/map-faceted-filter-fields.ts +21 -0
- package/src/app/main.tsx +3 -1
- package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +13 -3
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +6 -13
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/assets.tsx +17 -1
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +1 -0
- package/src/app/routes/_authenticated/_collections/collections.tsx +5 -0
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +0 -1
- package/src/app/routes/_authenticated/_customers/customers.tsx +9 -5
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +0 -6
- package/src/app/routes/_authenticated/_facets/components/facet-value-bulk-actions.tsx +16 -0
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +43 -12
- package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +14 -5
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +4 -8
- package/src/app/routes/_authenticated/_global-settings/utils/global-languages.ts +268 -0
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +117 -92
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +15 -15
- package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +5 -5
- package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +2 -1
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +26 -27
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +5 -3
- package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +6 -9
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +17 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +48 -281
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +59 -40
- package/src/app/routes/_authenticated/_orders/utils/order-utils.ts +73 -0
- package/src/app/routes/_authenticated/_orders/utils/use-modify-order.ts +312 -0
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +4 -0
- package/src/app/routes/_authenticated/_product-variants/components/add-currency-dropdown.tsx +49 -0
- package/src/app/routes/_authenticated/_product-variants/components/add-stock-location-dropdown.tsx +56 -0
- package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +12 -0
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +178 -50
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +0 -6
- package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +0 -11
- package/src/app/routes/_authenticated/_products/products.tsx +6 -2
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +4 -8
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +0 -10
- package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +12 -0
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +3 -10
- package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +4 -0
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +4 -10
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +9 -0
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +1 -0
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +2 -2
- package/src/app/routes/login.tsx +2 -2
- package/src/i18n/locales/ar.po +420 -289
- package/src/i18n/locales/cs.po +420 -289
- package/src/i18n/locales/de.po +420 -289
- package/src/i18n/locales/en.po +420 -289
- package/src/i18n/locales/es.po +420 -289
- package/src/i18n/locales/fa.po +420 -289
- package/src/i18n/locales/fr.po +468 -337
- package/src/i18n/locales/he.po +420 -289
- package/src/i18n/locales/hr.po +420 -289
- package/src/i18n/locales/it.po +420 -289
- package/src/i18n/locales/ja.po +420 -289
- package/src/i18n/locales/nb.po +420 -289
- package/src/i18n/locales/ne.po +420 -289
- package/src/i18n/locales/pl.po +420 -289
- package/src/i18n/locales/pt_BR.po +420 -289
- package/src/i18n/locales/pt_PT.po +420 -289
- package/src/i18n/locales/ru.po +420 -289
- package/src/i18n/locales/sv.po +420 -289
- package/src/i18n/locales/tr.po +420 -289
- package/src/i18n/locales/uk.po +420 -289
- package/src/i18n/locales/zh_Hans.po +420 -289
- package/src/i18n/locales/zh_Hant.po +420 -289
- package/src/lib/components/data-input/affixed-input.stories.tsx +93 -0
- package/src/lib/components/data-input/affixed-input.tsx +5 -2
- package/src/lib/components/data-input/boolean-input.stories.tsx +102 -0
- package/src/lib/components/data-input/checkbox-input.stories.tsx +61 -0
- package/src/lib/components/data-input/customer-group-input.tsx +0 -1
- package/src/lib/components/data-input/datetime-input.stories.tsx +62 -0
- package/src/lib/components/data-input/datetime-input.tsx +27 -13
- package/src/lib/components/data-input/default-relation-input.tsx +18 -12
- package/src/lib/components/data-input/money-input.stories.tsx +88 -0
- package/src/lib/components/data-input/money-input.tsx +7 -11
- package/src/lib/components/data-input/number-input.stories.tsx +103 -0
- package/src/lib/components/data-input/number-input.tsx +16 -5
- package/src/lib/components/data-input/password-input.stories.tsx +65 -0
- package/src/lib/components/data-input/rich-text-input.stories.tsx +92 -0
- package/src/lib/components/data-input/slug-input.stories.tsx +232 -0
- package/src/lib/components/data-input/slug-input.tsx +9 -10
- package/src/lib/components/data-input/text-input.stories.tsx +52 -0
- package/src/lib/components/data-input/textarea-input.stories.tsx +55 -0
- package/src/lib/components/data-table/add-filter-menu.tsx +6 -1
- package/src/lib/components/data-table/column-header-wrapper.tsx +106 -0
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +11 -9
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +4 -4
- package/src/lib/components/data-table/data-table-column-header.tsx +17 -14
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +33 -11
- package/src/lib/components/data-table/data-table-filter-badge-editable.tsx +35 -0
- package/src/lib/components/data-table/data-table-filter-badge.tsx +28 -14
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +28 -8
- package/src/lib/components/data-table/data-table-pagination.tsx +23 -7
- package/src/lib/components/data-table/data-table.stories.tsx +249 -0
- package/src/lib/components/data-table/data-table.tsx +39 -11
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +79 -34
- package/src/lib/components/data-table/use-generated-columns.tsx +55 -27
- package/src/lib/components/layout/generated-breadcrumbs.tsx +4 -12
- package/src/lib/components/layout/nav-user.tsx +19 -13
- package/src/lib/components/login/login-form.tsx +39 -123
- package/src/lib/components/shared/alerts.tsx +29 -17
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +3 -3
- package/src/lib/components/shared/asset/asset-gallery.stories.tsx +76 -0
- package/src/lib/components/shared/asset/asset-gallery.tsx +147 -113
- package/src/lib/components/shared/asset/asset-picker-dialog.stories.tsx +58 -0
- package/src/lib/components/shared/configurable-operation-input.tsx +1 -1
- package/src/lib/components/shared/customer-group-selector.tsx +5 -2
- package/src/lib/components/shared/detail-page-button.stories.tsx +52 -0
- package/src/lib/components/shared/facet-value-selector.stories.tsx +48 -0
- package/src/lib/components/shared/facet-value-selector.tsx +130 -34
- package/src/lib/components/shared/paginated-list-data-table.stories.tsx +212 -0
- package/src/lib/components/shared/paginated-list-data-table.tsx +12 -12
- package/src/lib/components/shared/permission-guard.stories.tsx +46 -0
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +2 -0
- package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +8 -4
- package/src/lib/components/shared/rich-text-editor/rich-text-editor.tsx +1 -0
- package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +40 -0
- package/src/lib/components/shared/vendure-image.stories.tsx +167 -0
- package/src/lib/components/shared/vendure-image.tsx +6 -7
- package/src/lib/components/ui/accordion.stories.tsx +33 -0
- package/src/lib/components/ui/alert-dialog.stories.tsx +48 -0
- package/src/lib/components/ui/alert.stories.tsx +35 -0
- package/src/lib/components/ui/aspect-ratio.stories.tsx +28 -0
- package/src/lib/components/ui/badge.stories.tsx +28 -0
- package/src/lib/components/ui/breadcrumb.stories.tsx +41 -0
- package/src/lib/components/ui/button.stories.tsx +38 -0
- package/src/lib/components/ui/calendar.stories.tsx +22 -0
- package/src/lib/components/ui/card.stories.tsx +28 -0
- package/src/lib/components/ui/carousel.stories.tsx +34 -0
- package/src/lib/components/ui/checkbox.stories.tsx +31 -0
- package/src/lib/components/ui/collapsible.stories.tsx +39 -0
- package/src/lib/components/ui/command.stories.tsx +44 -0
- package/src/lib/components/ui/context-menu.stories.tsx +38 -0
- package/src/lib/components/ui/dialog.stories.tsx +52 -0
- package/src/lib/components/ui/drawer.stories.tsx +50 -0
- package/src/lib/components/ui/dropdown-menu.stories.tsx +41 -0
- package/src/lib/components/ui/hover-card.stories.tsx +38 -0
- package/src/lib/components/ui/input-group.tsx +148 -0
- package/src/lib/components/ui/input-otp.stories.tsx +30 -0
- package/src/lib/components/ui/input.stories.tsx +38 -0
- package/src/lib/components/ui/label.stories.tsx +24 -0
- package/src/lib/components/ui/menubar.stories.tsx +53 -0
- package/src/lib/components/ui/navigation-menu.stories.tsx +54 -0
- package/src/lib/components/ui/pagination.stories.tsx +51 -0
- package/src/lib/components/ui/password-input.stories.tsx +32 -0
- package/src/lib/components/ui/password-input.tsx +33 -0
- package/src/lib/components/ui/popover.stories.tsx +33 -0
- package/src/lib/components/ui/progress.stories.tsx +27 -0
- package/src/lib/components/ui/radio-group.stories.tsx +34 -0
- package/src/lib/components/ui/resizable.stories.tsx +32 -0
- package/src/lib/components/ui/scroll-area.stories.tsx +31 -0
- package/src/lib/components/ui/select.stories.tsx +36 -0
- package/src/lib/components/ui/separator.stories.tsx +35 -0
- package/src/lib/components/ui/sheet.stories.tsx +50 -0
- package/src/lib/components/ui/sidebar-context.ts +16 -0
- package/src/lib/components/ui/sidebar.tsx +2 -13
- package/src/lib/components/ui/skeleton.stories.tsx +26 -0
- package/src/lib/components/ui/slider.stories.tsx +37 -0
- package/src/lib/components/ui/switch.stories.tsx +31 -0
- package/src/lib/components/ui/table.stories.tsx +52 -0
- package/src/lib/components/ui/tabs.stories.tsx +29 -0
- package/src/lib/components/ui/textarea.stories.tsx +32 -0
- package/src/lib/components/ui/toggle-group.stories.tsx +31 -0
- package/src/lib/components/ui/toggle.stories.tsx +39 -0
- package/src/lib/components/ui/tooltip.stories.tsx +30 -0
- package/src/lib/components/ui/tooltip.tsx +2 -2
- package/src/lib/framework/alert/alert-extensions.tsx +0 -11
- package/src/lib/framework/alert/alert-item.tsx +14 -19
- package/src/lib/framework/alert/alerts-indicator.tsx +14 -15
- package/src/lib/framework/alert/search-index-buffer-alert/search-index-buffer-alert.ts +41 -0
- package/src/lib/framework/component-registry/component-registry.tsx +3 -14
- package/src/lib/framework/dashboard-widget/base-widget.tsx +18 -9
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +0 -2
- package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +12 -11
- package/src/lib/framework/defaults.ts +9 -13
- package/src/lib/framework/extension-api/input-component-extensions.tsx +6 -1
- package/src/lib/framework/extension-api/logic/alerts.ts +3 -2
- package/src/lib/framework/extension-api/types/alerts.ts +12 -6
- package/src/lib/framework/extension-api/types/data-table.ts +5 -2
- package/src/lib/framework/extension-api/types/layout.ts +41 -1
- package/src/lib/framework/extension-api/types/login.ts +0 -21
- package/src/lib/framework/form-engine/value-transformers.ts +8 -1
- package/src/lib/framework/layout-engine/custom-form-page.stories.tsx +344 -0
- package/src/lib/framework/layout-engine/page-layout.tsx +69 -57
- package/src/lib/framework/layout-engine/page.stories.tsx +275 -0
- package/src/lib/framework/nav-menu/nav-menu-extensions.ts +32 -19
- package/src/lib/framework/page/detail-page.stories.tsx +151 -0
- package/src/lib/framework/page/detail-page.tsx +12 -15
- package/src/lib/framework/page/list-page.stories.tsx +217 -0
- package/src/lib/framework/page/list-page.tsx +8 -1
- package/src/lib/graphql/api.ts +18 -1
- package/src/lib/graphql/graphql-env.d.ts +1 -1
- package/src/lib/hooks/use-alerts.ts +84 -0
- package/src/lib/hooks/use-floating-bulk-actions.ts +2 -3
- package/src/lib/index.ts +12 -5
- package/src/lib/providers/alerts-provider.tsx +60 -0
- package/src/lib/providers/channel-provider.tsx +1 -0
- 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
|
|
55
|
-
<
|
|
56
|
-
{g
|
|
57
|
-
|
|
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 {
|
|
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 {
|
|
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
|
|
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={
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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={(
|
|
72
|
+
onSortChange={(table, sorting) => {
|
|
55
73
|
setSorting(sorting);
|
|
56
74
|
}}
|
|
57
|
-
onFilterChange={(
|
|
58
|
-
|
|
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
|
-
|
|
119
|
-
|
|
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
|
-
|
|
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 }) =>
|
|
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
|
+
];
|