@vendure/dashboard 3.5.0-minor-202509261210 → 3.5.0-minor-202510031341
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/README.md +4 -0
- package/dist/plugin/dashboard.plugin.d.ts +25 -6
- package/dist/plugin/dashboard.plugin.js +184 -27
- package/dist/plugin/default-page.html +188 -0
- package/dist/vite/vite-plugin-config.js +13 -9
- package/dist/vite/vite-plugin-translations.d.ts +22 -0
- package/dist/vite/vite-plugin-translations.js +66 -0
- package/dist/vite/vite-plugin-vendure-dashboard.js +8 -6
- package/lingui.config.js +25 -2
- package/package.json +159 -156
- package/src/app/app-providers.tsx +0 -4
- package/src/app/common/delete-bulk-action.tsx +6 -5
- package/src/app/common/duplicate-bulk-action.tsx +4 -5
- package/src/app/common/duplicate-entity-dialog.tsx +1 -1
- package/src/app/common/set-document-direction.ts +7 -0
- package/src/app/main.tsx +50 -17
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -6
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +17 -6
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +2 -2
- package/src/app/routes/_authenticated/_assets/assets.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +8 -6
- package/src/app/routes/_authenticated/_assets/components/asset-tag-filter.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/components/asset-tags-editor.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/components/manage-tags-dialog.tsx +3 -8
- package/src/app/routes/_authenticated/_channels/channels.tsx +3 -6
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -5
- package/src/app/routes/_authenticated/_collections/collections.tsx +3 -4
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +4 -6
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +2 -0
- package/src/app/routes/_authenticated/_countries/countries.tsx +2 -3
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +4 -4
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +2 -4
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -8
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +3 -3
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-utils.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/default-customer-history-components.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +4 -0
- package/src/app/routes/_authenticated/_customers/customers.tsx +23 -11
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +10 -8
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +6 -5
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/facets.tsx +5 -5
- package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +7 -5
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +5 -5
- package/src/app/routes/_authenticated/_orders/components/add-manual-payment-dialog.tsx +19 -21
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +22 -22
- package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_orders/components/fulfillment-details.tsx +15 -9
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +11 -9
- package/src/app/routes/_authenticated/_orders/components/order-history/default-order-history-components.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-utils.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-modification-preview-dialog.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +27 -27
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +2 -2
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +26 -20
- package/src/app/routes/_authenticated/_orders/components/seller-orders-card.tsx +3 -1
- package/src/app/routes/_authenticated/_orders/components/settle-refund-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +3 -2
- package/src/app/routes/_authenticated/_orders/orders.tsx +5 -9
- package/src/app/routes/_authenticated/_orders/orders_.$aggregateOrderId_.seller-orders.$sellerOrderId.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +17 -17
- package/src/app/routes/_authenticated/_orders/utils/order-detail-loaders.tsx +1 -1
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +5 -6
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +1 -1
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +9 -2
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_products/components/add-option-group-dialog.tsx +5 -5
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +5 -5
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +5 -4
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +9 -12
- package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +4 -4
- package/src/app/routes/_authenticated/_products/components/option-groups-editor.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +3 -3
- package/src/app/routes/_authenticated/_products/components/product-options-table.tsx +9 -6
- package/src/app/routes/_authenticated/_products/products.graphql.ts +31 -31
- package/src/app/routes/_authenticated/_products/products.tsx +11 -6
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +11 -11
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +8 -12
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +2 -2
- package/src/app/routes/_authenticated/_profile/profile.tsx +4 -4
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +2 -4
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +16 -9
- package/src/app/routes/_authenticated/_roles/components/permissions-table-grid.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/roles.tsx +3 -6
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +4 -6
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +3 -4
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_shipping-methods/components/price-display.tsx +5 -5
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-test-result-wrapper.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/test-address-form.tsx +4 -3
- package/src/app/routes/_authenticated/_shipping-methods/components/test-order-builder.tsx +4 -3
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-result.tsx +8 -8
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-method-result.tsx +8 -8
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-shipping-method-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +2 -3
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +2 -2
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +3 -4
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +10 -4
- package/src/app/routes/_authenticated/_system/job-queue.tsx +10 -13
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +18 -16
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +2 -4
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -12
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +6 -4
- package/src/app/routes/_authenticated/_zones/zones.tsx +4 -4
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +8 -5
- package/src/app/routes/_authenticated/index.tsx +6 -2
- package/src/app/styles.css +4 -0
- package/src/i18n/common-strings.ts +111 -0
- package/src/i18n/locales/ar.po +4777 -0
- package/src/i18n/locales/cs.po +4777 -0
- package/src/i18n/locales/de.po +4299 -1101
- package/src/i18n/locales/en.po +3857 -659
- package/src/i18n/locales/es.po +4777 -0
- package/src/i18n/locales/fa.po +4777 -0
- package/src/i18n/locales/fr.po +4777 -0
- package/src/i18n/locales/he.po +4777 -0
- package/src/i18n/locales/hr.po +4777 -0
- package/src/i18n/locales/it.po +4777 -0
- package/src/i18n/locales/ja.po +4777 -0
- package/src/i18n/locales/ko.po +4628 -0
- package/src/i18n/locales/nb.po +4777 -0
- package/src/i18n/locales/ne.po +4777 -0
- package/src/i18n/locales/nl.po +4628 -0
- package/src/i18n/locales/pl.po +4777 -0
- package/src/i18n/locales/pt_BR.po +4777 -0
- package/src/i18n/locales/pt_PT.po +4777 -0
- package/src/i18n/locales/ru.po +4777 -0
- package/src/i18n/locales/sv.po +4777 -0
- package/src/i18n/locales/tr.po +4777 -0
- package/src/i18n/locales/uk.po +4777 -0
- package/src/i18n/locales/zh_Hans.po +4777 -0
- package/src/i18n/locales/zh_Hant.po +4777 -0
- package/src/lib/components/data-input/combination-mode-input.tsx +1 -1
- package/src/lib/components/data-input/custom-field-list-input.tsx +11 -7
- package/src/lib/components/data-input/customer-group-input.tsx +27 -33
- package/src/lib/components/data-input/datetime-input.tsx +40 -1
- package/src/lib/components/data-input/default-relation-input.tsx +5 -4
- package/src/lib/components/data-input/product-multi-selector-input.tsx +14 -14
- package/src/lib/components/data-input/relation-selector.tsx +1 -1
- package/src/lib/components/data-input/select-with-options.tsx +1 -1
- package/src/lib/components/data-input/slug-input.tsx +9 -15
- package/src/lib/components/data-table/add-filter-menu.tsx +4 -4
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +8 -8
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +4 -4
- package/src/lib/components/data-table/data-table-column-header.tsx +13 -8
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +2 -1
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +1 -1
- package/src/lib/components/data-table/data-table-utils.ts +21 -4
- package/src/lib/components/data-table/data-table-view-options.tsx +4 -2
- package/src/lib/components/data-table/data-table.tsx +3 -3
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +4 -4
- package/src/lib/components/data-table/global-views-bar.tsx +1 -1
- package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
- package/src/lib/components/data-table/manage-global-views-button.tsx +1 -1
- package/src/lib/components/data-table/my-views-button.tsx +13 -13
- package/src/lib/components/data-table/refresh-button.tsx +1 -1
- package/src/lib/components/data-table/save-view-button.tsx +11 -11
- package/src/lib/components/data-table/use-generated-columns.tsx +10 -7
- package/src/lib/components/data-table/views-sheet.tsx +79 -71
- package/src/lib/components/date-range-picker.tsx +36 -34
- package/src/lib/components/layout/app-sidebar.tsx +3 -1
- package/src/lib/components/layout/channel-switcher.tsx +8 -10
- package/src/lib/components/layout/dev-mode-indicator.tsx +1 -1
- package/src/lib/components/layout/generated-breadcrumbs.tsx +10 -8
- package/src/lib/components/layout/language-dialog.tsx +34 -13
- package/src/lib/components/layout/manage-languages-dialog.tsx +1 -1
- package/src/lib/components/layout/nav-main.tsx +23 -13
- package/src/lib/components/layout/nav-user.tsx +19 -23
- package/src/lib/components/login/login-form.tsx +1 -1
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +4 -4
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +1 -1
- package/src/lib/components/shared/asset/asset-gallery.tsx +15 -14
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +11 -11
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +6 -5
- package/src/lib/components/shared/channel-code-label.tsx +1 -1
- package/src/lib/components/shared/channel-selector.tsx +4 -4
- package/src/lib/components/shared/configurable-operation-multi-selector.tsx +16 -14
- package/src/lib/components/shared/configurable-operation-selector.tsx +1 -1
- package/src/lib/components/shared/confirmation-dialog.tsx +8 -8
- package/src/lib/components/shared/country-selector.tsx +1 -1
- package/src/lib/components/shared/currency-selector.tsx +4 -4
- package/src/lib/components/shared/custom-fields-form.tsx +8 -24
- package/src/lib/components/shared/customer-address-form.tsx +3 -3
- package/src/lib/components/shared/customer-group-selector.tsx +1 -1
- package/src/lib/components/shared/customer-selector.tsx +1 -1
- package/src/lib/components/shared/error-page.tsx +1 -1
- package/src/lib/components/shared/facet-value-selector.tsx +10 -10
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-note-entry.tsx +1 -1
- package/src/lib/components/shared/language-selector.tsx +4 -4
- package/src/lib/components/shared/navigation-confirmation.tsx +1 -1
- package/src/lib/components/shared/paginated-list-data-table.tsx +21 -18
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +6 -5
- package/src/lib/components/shared/rich-text-editor/image-dialog.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/link-dialog.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/table-edit-icons.tsx +1 -1
- package/src/lib/components/shared/role-code-label.tsx +1 -1
- package/src/lib/components/shared/role-selector.tsx +4 -4
- package/src/lib/components/shared/seller-selector.tsx +1 -1
- package/src/lib/components/shared/stock-level-label.tsx +3 -5
- package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +3 -1
- package/src/lib/components/shared/tax-category-selector.tsx +1 -1
- package/src/lib/components/shared/translatable-form-field.tsx +15 -15
- package/src/lib/components/shared/zone-selector.tsx +1 -1
- package/src/lib/constants.ts +10 -0
- package/src/lib/framework/dashboard-widget/base-widget.tsx +11 -9
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +6 -4
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +8 -5
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +7 -4
- package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +3 -1
- package/src/lib/framework/defaults.ts +34 -63
- package/src/lib/framework/layout-engine/page-layout.tsx +36 -36
- package/src/lib/framework/page/detail-page.tsx +10 -10
- package/src/lib/framework/page/use-extended-router.tsx +48 -23
- package/src/lib/graphql/api.ts +22 -7
- package/src/lib/graphql/graphql-env.d.ts +13 -25
- package/src/lib/hooks/use-display-locale.ts +40 -0
- package/src/lib/hooks/use-dynamic-translations.ts +46 -0
- package/src/lib/hooks/use-extended-detail-query.ts +1 -1
- package/src/lib/hooks/use-extended-list-query.ts +1 -1
- package/src/lib/hooks/use-local-format.ts +15 -1
- package/src/lib/hooks/use-saved-views.ts +7 -0
- package/src/lib/hooks/use-ui-language-loader.ts +30 -0
- package/src/lib/lib/load-i18n-messages.ts +17 -0
- package/src/lib/lib/trans.tsx +15 -11
- package/src/lib/providers/auth.tsx +2 -2
- package/src/lib/providers/channel-provider.tsx +3 -2
- package/src/lib/providers/i18n-provider.tsx +7 -14
- package/src/lib/providers/user-settings.tsx +46 -5
|
@@ -4,7 +4,7 @@ import { Button } from '@/vdb/components/ui/button.js';
|
|
|
4
4
|
import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
5
5
|
import { ListPage } from '@/vdb/framework/page/list-page.js';
|
|
6
6
|
import { api } from '@/vdb/graphql/api.js';
|
|
7
|
-
import { Trans, useLingui } from '
|
|
7
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
8
8
|
import { useMutation } from '@tanstack/react-query';
|
|
9
9
|
import { createFileRoute, Link } from '@tanstack/react-router';
|
|
10
10
|
import { PlusIcon, RefreshCwIcon } from 'lucide-react';
|
|
@@ -24,14 +24,14 @@ export const Route = createFileRoute('/_authenticated/_products/products')({
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
function ProductListPage() {
|
|
27
|
-
const {
|
|
27
|
+
const { t } = useLingui();
|
|
28
28
|
const reindexMutation = useMutation({
|
|
29
29
|
mutationFn: () => api.mutate(reindexDocument, {}),
|
|
30
30
|
onSuccess: () => {
|
|
31
|
-
toast.success(
|
|
31
|
+
toast.success(t`Search index rebuild started`);
|
|
32
32
|
},
|
|
33
33
|
onError: () => {
|
|
34
|
-
toast.error(
|
|
34
|
+
toast.error(t`Search index rebuild could not be started`);
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
|
|
@@ -43,10 +43,9 @@ function ProductListPage() {
|
|
|
43
43
|
<ListPage
|
|
44
44
|
pageId="product-list"
|
|
45
45
|
listQuery={productListDocument}
|
|
46
|
-
title=
|
|
46
|
+
title={<Trans>Products</Trans>}
|
|
47
47
|
customizeColumns={{
|
|
48
48
|
name: {
|
|
49
|
-
header: 'Product Name',
|
|
50
49
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
51
50
|
},
|
|
52
51
|
}}
|
|
@@ -55,6 +54,12 @@ function ProductListPage() {
|
|
|
55
54
|
name: { contains: searchTerm },
|
|
56
55
|
};
|
|
57
56
|
}}
|
|
57
|
+
defaultVisibility={{
|
|
58
|
+
name: true,
|
|
59
|
+
featuredAsset: true,
|
|
60
|
+
slug: true,
|
|
61
|
+
enabled: true,
|
|
62
|
+
}}
|
|
58
63
|
route={Route}
|
|
59
64
|
bulkActions={[
|
|
60
65
|
{
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
24
24
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
25
25
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
26
|
-
import { Trans, useLingui } from '
|
|
26
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
27
27
|
import { createFileRoute, Link, useNavigate } from '@tanstack/react-router';
|
|
28
28
|
import { PlusIcon } from 'lucide-react';
|
|
29
29
|
import { useRef } from 'react';
|
|
@@ -54,7 +54,7 @@ function ProductDetailPage() {
|
|
|
54
54
|
const params = Route.useParams();
|
|
55
55
|
const navigate = useNavigate();
|
|
56
56
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
57
|
-
const {
|
|
57
|
+
const { t } = useLingui();
|
|
58
58
|
const refreshRef = useRef<() => void>(() => {});
|
|
59
59
|
|
|
60
60
|
const { form, submitHandler, entity, isPending, refreshEntity, resetForm } = useDetailPage({
|
|
@@ -84,7 +84,7 @@ function ProductDetailPage() {
|
|
|
84
84
|
params: { id: params.id },
|
|
85
85
|
onSuccess: async data => {
|
|
86
86
|
toast.success(
|
|
87
|
-
|
|
87
|
+
creatingNewEntity ? t`Successfully created product` : t`Successfully updated product`,
|
|
88
88
|
);
|
|
89
89
|
resetForm();
|
|
90
90
|
if (creatingNewEntity) {
|
|
@@ -92,7 +92,7 @@ function ProductDetailPage() {
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
onError: err => {
|
|
95
|
-
toast.error(
|
|
95
|
+
toast.error(creatingNewEntity ? t`Failed to create product` : t`Failed to update product`, {
|
|
96
96
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
97
97
|
});
|
|
98
98
|
},
|
|
@@ -17,8 +17,8 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
|
|
|
17
17
|
import { Page, PageBlock, PageLayout, PageTitle } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
18
18
|
import { api } from '@/vdb/graphql/api.js';
|
|
19
19
|
import { ResultOf } from '@/vdb/graphql/graphql.js';
|
|
20
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
21
20
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
21
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
22
22
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
23
23
|
import { createFileRoute } from '@tanstack/react-router';
|
|
24
24
|
import { Plus, Save, Trash2 } from 'lucide-react';
|
|
@@ -82,7 +82,7 @@ function AddOptionValueDialog({
|
|
|
82
82
|
onSuccess?: () => void;
|
|
83
83
|
}>) {
|
|
84
84
|
const [open, setOpen] = useState(false);
|
|
85
|
-
const {
|
|
85
|
+
const { t } = useLingui();
|
|
86
86
|
|
|
87
87
|
const form = useForm<AddOptionValueFormValues>({
|
|
88
88
|
resolver: zodResolver(addOptionValueSchema),
|
|
@@ -94,14 +94,14 @@ function AddOptionValueDialog({
|
|
|
94
94
|
const createOptionMutation = useMutation({
|
|
95
95
|
mutationFn: api.mutate(createProductOptionDocument),
|
|
96
96
|
onSuccess: () => {
|
|
97
|
-
toast.success(
|
|
97
|
+
toast.success(t`Successfully added option value`);
|
|
98
98
|
setOpen(false);
|
|
99
99
|
form.reset();
|
|
100
100
|
onSuccess?.();
|
|
101
101
|
},
|
|
102
102
|
onError: error => {
|
|
103
|
-
toast.error(
|
|
104
|
-
description: error instanceof Error ? error.message :
|
|
103
|
+
toast.error(t`Failed to add option value`, {
|
|
104
|
+
description: error instanceof Error ? error.message : t`Unknown error`,
|
|
105
105
|
});
|
|
106
106
|
},
|
|
107
107
|
});
|
|
@@ -141,7 +141,7 @@ function AddOptionValueDialog({
|
|
|
141
141
|
name="name"
|
|
142
142
|
label={<Trans>Option value name</Trans>}
|
|
143
143
|
render={({ field }) => (
|
|
144
|
-
<Input {...field} placeholder={
|
|
144
|
+
<Input {...field} placeholder={t`e.g., Red, Large, Cotton`} />
|
|
145
145
|
)}
|
|
146
146
|
/>
|
|
147
147
|
<DialogFooter>
|
|
@@ -158,7 +158,7 @@ function AddOptionValueDialog({
|
|
|
158
158
|
|
|
159
159
|
function ManageProductVariants() {
|
|
160
160
|
const { id } = Route.useParams();
|
|
161
|
-
const {
|
|
161
|
+
const { t } = useLingui();
|
|
162
162
|
const [optionsToAddToVariant, setOptionsToAddToVariant] = useState<
|
|
163
163
|
Record<string, Record<string, string>>
|
|
164
164
|
>({});
|
|
@@ -171,7 +171,7 @@ function ManageProductVariants() {
|
|
|
171
171
|
const updateVariantMutation = useMutation({
|
|
172
172
|
mutationFn: api.mutate(updateProductVariantDocument),
|
|
173
173
|
onSuccess: () => {
|
|
174
|
-
toast.success(
|
|
174
|
+
toast.success(t`Variant updated successfully`);
|
|
175
175
|
refetch();
|
|
176
176
|
},
|
|
177
177
|
});
|
|
@@ -179,7 +179,7 @@ function ManageProductVariants() {
|
|
|
179
179
|
const deleteVariantMutation = useMutation({
|
|
180
180
|
mutationFn: api.mutate(deleteProductVariantDocument),
|
|
181
181
|
onSuccess: () => {
|
|
182
|
-
toast.success(
|
|
182
|
+
toast.success(t`Variant deleted successfully`);
|
|
183
183
|
refetch();
|
|
184
184
|
},
|
|
185
185
|
});
|
|
@@ -187,7 +187,7 @@ function ManageProductVariants() {
|
|
|
187
187
|
const removeOptionGroupMutation = useMutation({
|
|
188
188
|
mutationFn: api.mutate(removeOptionGroupFromProductDocument),
|
|
189
189
|
onSuccess: () => {
|
|
190
|
-
toast.success(
|
|
190
|
+
toast.success(t`Option group removed`);
|
|
191
191
|
refetch();
|
|
192
192
|
},
|
|
193
193
|
});
|
|
@@ -233,7 +233,7 @@ function ManageProductVariants() {
|
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
const deleteVariant = async (variant: Variant) => {
|
|
236
|
-
if (confirm(
|
|
236
|
+
if (confirm(t`Are you sure you want to delete this variant?`)) {
|
|
237
237
|
await deleteVariantMutation.mutateAsync({ id: variant.id });
|
|
238
238
|
}
|
|
239
239
|
};
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
21
21
|
import { getDetailQueryOptions, useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
22
22
|
import { api } from '@/vdb/graphql/api.js';
|
|
23
|
-
import { Trans, useLingui } from '
|
|
23
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
24
24
|
import { createFileRoute, ParsedLocation, useNavigate } from '@tanstack/react-router';
|
|
25
25
|
import { toast } from 'sonner';
|
|
26
26
|
import { ProductOptionsTable } from './components/product-options-table.js';
|
|
@@ -72,7 +72,7 @@ function ProductOptionGroupDetailPage() {
|
|
|
72
72
|
const params = Route.useParams();
|
|
73
73
|
const navigate = useNavigate();
|
|
74
74
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
75
|
-
const {
|
|
75
|
+
const { t } = useLingui();
|
|
76
76
|
|
|
77
77
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
78
78
|
pageId,
|
|
@@ -102,11 +102,9 @@ function ProductOptionGroupDetailPage() {
|
|
|
102
102
|
params: { id: params.id },
|
|
103
103
|
onSuccess: async data => {
|
|
104
104
|
toast(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
: 'Successfully updated product option group',
|
|
109
|
-
),
|
|
105
|
+
creatingNewEntity
|
|
106
|
+
? t`Successfully created product option group`
|
|
107
|
+
: t`Successfully updated product option group`,
|
|
110
108
|
);
|
|
111
109
|
resetForm();
|
|
112
110
|
if (creatingNewEntity) {
|
|
@@ -115,11 +113,9 @@ function ProductOptionGroupDetailPage() {
|
|
|
115
113
|
},
|
|
116
114
|
onError: err => {
|
|
117
115
|
toast(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
: 'Failed to update product option group',
|
|
122
|
-
),
|
|
116
|
+
creatingNewEntity
|
|
117
|
+
? t`Failed to create product option group`
|
|
118
|
+
: t`Failed to update product option group`,
|
|
123
119
|
{
|
|
124
120
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
125
121
|
},
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
21
21
|
import { getDetailQueryOptions, useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
22
22
|
import { api } from '@/vdb/graphql/api.js';
|
|
23
|
-
import { Trans, useLingui } from '
|
|
23
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
24
24
|
import { createFileRoute, ParsedLocation, useNavigate } from '@tanstack/react-router';
|
|
25
25
|
import { toast } from 'sonner';
|
|
26
26
|
import {
|
|
@@ -94,7 +94,7 @@ function ProductOptionDetailPage() {
|
|
|
94
94
|
const params = Route.useParams();
|
|
95
95
|
const navigate = useNavigate();
|
|
96
96
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
97
|
-
const {
|
|
97
|
+
const { t } = useLingui();
|
|
98
98
|
|
|
99
99
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
100
100
|
pageId,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
15
15
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
16
16
|
import { api } from '@/vdb/graphql/api.js';
|
|
17
|
-
import { Trans, useLingui } from '
|
|
17
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
18
18
|
import { createFileRoute } from '@tanstack/react-router';
|
|
19
19
|
import { toast } from 'sonner';
|
|
20
20
|
import { activeAdministratorDocument, updateAdministratorDocument } from './profile.graphql.js';
|
|
@@ -34,7 +34,7 @@ export const Route = createFileRoute('/_authenticated/_profile/profile')({
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
function ProfilePage() {
|
|
37
|
-
const {
|
|
37
|
+
const { t } = useLingui();
|
|
38
38
|
|
|
39
39
|
const { form, submitHandler, isPending } = useDetailPage({
|
|
40
40
|
queryDocument: activeAdministratorDocument,
|
|
@@ -58,11 +58,11 @@ function ProfilePage() {
|
|
|
58
58
|
},
|
|
59
59
|
params: { id: 'undefined' },
|
|
60
60
|
onSuccess: async data => {
|
|
61
|
-
toast(
|
|
61
|
+
toast(t`Successfully updated profile`);
|
|
62
62
|
form.reset(form.getValues());
|
|
63
63
|
},
|
|
64
64
|
onError: err => {
|
|
65
|
-
toast(
|
|
65
|
+
toast(t`Failed to update profile`, {
|
|
66
66
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
67
67
|
});
|
|
68
68
|
},
|
|
@@ -4,7 +4,7 @@ import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
|
|
|
4
4
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
5
5
|
import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
6
6
|
import { ListPage } from '@/vdb/framework/page/list-page.js';
|
|
7
|
-
import { Trans } from '
|
|
7
|
+
import { Trans } from '@lingui/react/macro';
|
|
8
8
|
import { createFileRoute, Link } from '@tanstack/react-router';
|
|
9
9
|
import { PlusIcon } from 'lucide-react';
|
|
10
10
|
import {
|
|
@@ -26,7 +26,7 @@ function PromotionListPage() {
|
|
|
26
26
|
pageId="promotion-list"
|
|
27
27
|
listQuery={promotionListDocument}
|
|
28
28
|
route={Route}
|
|
29
|
-
title=
|
|
29
|
+
title={<Trans>Promotions</Trans>}
|
|
30
30
|
defaultVisibility={{
|
|
31
31
|
name: true,
|
|
32
32
|
couponCode: true,
|
|
@@ -42,11 +42,9 @@ function PromotionListPage() {
|
|
|
42
42
|
}}
|
|
43
43
|
customizeColumns={{
|
|
44
44
|
name: {
|
|
45
|
-
header: 'Name',
|
|
46
45
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
47
46
|
},
|
|
48
47
|
enabled: {
|
|
49
|
-
header: 'Enabled',
|
|
50
48
|
cell: ({ row }) => <BooleanDisplayBadge value={row.original.enabled} />,
|
|
51
49
|
},
|
|
52
50
|
}}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
21
21
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
22
22
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
23
|
-
import { Trans, useLingui } from '
|
|
23
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
24
24
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
25
25
|
import { toast } from 'sonner';
|
|
26
26
|
import { PromotionActionsSelector } from './components/promotion-actions-selector.js';
|
|
@@ -52,7 +52,7 @@ function PromotionDetailPage() {
|
|
|
52
52
|
const params = Route.useParams();
|
|
53
53
|
const navigate = useNavigate();
|
|
54
54
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
55
|
-
const {
|
|
55
|
+
const { t } = useLingui();
|
|
56
56
|
|
|
57
57
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
58
58
|
pageId,
|
|
@@ -99,19 +99,24 @@ function PromotionDetailPage() {
|
|
|
99
99
|
params: { id: params.id },
|
|
100
100
|
onSuccess: async data => {
|
|
101
101
|
if (data.__typename === 'Promotion') {
|
|
102
|
-
toast.success(
|
|
102
|
+
toast.success(
|
|
103
|
+
creatingNewEntity ? t`Successfully created promotion` : t`Successfully updated promotion`,
|
|
104
|
+
);
|
|
103
105
|
resetForm();
|
|
104
106
|
if (creatingNewEntity) {
|
|
105
107
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
106
108
|
}
|
|
107
109
|
} else {
|
|
108
|
-
toast.error(
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
toast.error(
|
|
111
|
+
creatingNewEntity ? t`Failed to create promotion` : t`Failed to update promotion`,
|
|
112
|
+
{
|
|
113
|
+
description: data.message,
|
|
114
|
+
},
|
|
115
|
+
);
|
|
111
116
|
}
|
|
112
117
|
},
|
|
113
118
|
onError: err => {
|
|
114
|
-
toast.error(
|
|
119
|
+
toast.error(creatingNewEntity ? t`Failed to create promotion` : t`Failed to update promotion`, {
|
|
115
120
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
116
121
|
});
|
|
117
122
|
},
|
|
@@ -169,8 +174,9 @@ function PromotionDetailPage() {
|
|
|
169
174
|
label={<Trans>Starts at</Trans>}
|
|
170
175
|
render={({ field }) => (
|
|
171
176
|
<DateTimeInput
|
|
177
|
+
{...field}
|
|
172
178
|
value={field.value}
|
|
173
|
-
onChange={value => field.onChange(value
|
|
179
|
+
onChange={value => field.onChange(value)}
|
|
174
180
|
/>
|
|
175
181
|
)}
|
|
176
182
|
/>
|
|
@@ -180,8 +186,9 @@ function PromotionDetailPage() {
|
|
|
180
186
|
label={<Trans>Ends at</Trans>}
|
|
181
187
|
render={({ field }) => (
|
|
182
188
|
<DateTimeInput
|
|
189
|
+
{...field}
|
|
183
190
|
value={field.value}
|
|
184
|
-
onChange={value => field.onChange(value
|
|
191
|
+
onChange={value => field.onChange(value)}
|
|
185
192
|
/>
|
|
186
193
|
)}
|
|
187
194
|
/>
|
|
@@ -3,8 +3,8 @@ import { Switch } from '@/vdb/components/ui/switch.js';
|
|
|
3
3
|
import { Table, TableBody, TableCell, TableRow } from '@/vdb/components/ui/table.js';
|
|
4
4
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/vdb/components/ui/tooltip.js';
|
|
5
5
|
import { useGroupedPermissions } from '@/vdb/hooks/use-grouped-permissions.js';
|
|
6
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
7
6
|
import { ServerConfig } from '@/vdb/providers/server-config.js';
|
|
7
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
8
8
|
import { InfoIcon } from 'lucide-react';
|
|
9
9
|
|
|
10
10
|
interface PermissionsTableGridProps {
|
|
@@ -7,7 +7,7 @@ import { Button } from '@/vdb/components/ui/button.js';
|
|
|
7
7
|
import { CUSTOMER_ROLE_CODE, SUPER_ADMIN_ROLE_CODE } from '@/vdb/constants.js';
|
|
8
8
|
import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
9
9
|
import { ListPage } from '@/vdb/framework/page/list-page.js';
|
|
10
|
-
import { Trans } from '
|
|
10
|
+
import { Trans } from '@lingui/react/macro';
|
|
11
11
|
import { createFileRoute, Link } from '@tanstack/react-router';
|
|
12
12
|
import { LayersIcon, PlusIcon } from 'lucide-react';
|
|
13
13
|
import { ExpandablePermissions } from './components/expandable-permissions.js';
|
|
@@ -25,7 +25,7 @@ function RoleListPage() {
|
|
|
25
25
|
return (
|
|
26
26
|
<ListPage
|
|
27
27
|
pageId="role-list"
|
|
28
|
-
title=
|
|
28
|
+
title={<Trans>Roles</Trans>}
|
|
29
29
|
listQuery={roleListQuery}
|
|
30
30
|
route={Route}
|
|
31
31
|
defaultVisibility={{
|
|
@@ -36,7 +36,6 @@ function RoleListPage() {
|
|
|
36
36
|
}}
|
|
37
37
|
customizeColumns={{
|
|
38
38
|
code: {
|
|
39
|
-
header: 'Code',
|
|
40
39
|
cell: ({ row }) => {
|
|
41
40
|
return (
|
|
42
41
|
<DetailPageButton
|
|
@@ -48,7 +47,6 @@ function RoleListPage() {
|
|
|
48
47
|
},
|
|
49
48
|
},
|
|
50
49
|
permissions: {
|
|
51
|
-
header: 'Permissions',
|
|
52
50
|
cell: ({ row }) => {
|
|
53
51
|
if (SYSTEM_ROLES.includes(row.original.code)) {
|
|
54
52
|
return (
|
|
@@ -62,7 +60,6 @@ function RoleListPage() {
|
|
|
62
60
|
},
|
|
63
61
|
},
|
|
64
62
|
channels: {
|
|
65
|
-
header: 'Channels',
|
|
66
63
|
cell: ({ row }) => {
|
|
67
64
|
if (SYSTEM_ROLES.includes(row.original.code)) {
|
|
68
65
|
return null;
|
|
@@ -92,7 +89,7 @@ function RoleListPage() {
|
|
|
92
89
|
<Button asChild>
|
|
93
90
|
<Link to="./new">
|
|
94
91
|
<PlusIcon className="mr-2 h-4 w-4" />
|
|
95
|
-
New Role
|
|
92
|
+
<Trans>New Role</Trans>
|
|
96
93
|
</Link>
|
|
97
94
|
</Button>
|
|
98
95
|
</PermissionGuard>
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
17
17
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
18
18
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
19
|
-
import { Trans, useLingui } from '
|
|
19
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
20
20
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
21
21
|
import { toast } from 'sonner';
|
|
22
22
|
import { PermissionsTableGrid } from './components/permissions-table-grid.js';
|
|
@@ -43,7 +43,7 @@ function RoleDetailPage() {
|
|
|
43
43
|
const params = Route.useParams();
|
|
44
44
|
const navigate = useNavigate();
|
|
45
45
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
46
|
-
const {
|
|
46
|
+
const { t } = useLingui();
|
|
47
47
|
|
|
48
48
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
49
49
|
pageId,
|
|
@@ -61,16 +61,14 @@ function RoleDetailPage() {
|
|
|
61
61
|
},
|
|
62
62
|
params: { id: params.id },
|
|
63
63
|
onSuccess: async data => {
|
|
64
|
-
toast.success(
|
|
65
|
-
i18n.t(creatingNewEntity ? 'Successfully created role' : 'Successfully updated role'),
|
|
66
|
-
);
|
|
64
|
+
toast.success(creatingNewEntity ? t`Successfully created role` : t`Successfully updated role`);
|
|
67
65
|
resetForm();
|
|
68
66
|
if (creatingNewEntity) {
|
|
69
67
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
70
68
|
}
|
|
71
69
|
},
|
|
72
70
|
onError: err => {
|
|
73
|
-
toast.error(
|
|
71
|
+
toast.error(creatingNewEntity ? t`Failed to create role` : t`Failed to update role`, {
|
|
74
72
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
75
73
|
});
|
|
76
74
|
},
|
|
@@ -3,7 +3,7 @@ import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
|
|
|
3
3
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
4
4
|
import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
5
5
|
import { ListPage } from '@/vdb/framework/page/list-page.js';
|
|
6
|
-
import { Trans } from '
|
|
6
|
+
import { Trans } from '@lingui/react/macro';
|
|
7
7
|
import { createFileRoute, Link } from '@tanstack/react-router';
|
|
8
8
|
import { PlusIcon } from 'lucide-react';
|
|
9
9
|
import { DeleteSellersBulkAction } from './components/seller-bulk-actions.js';
|
|
@@ -20,7 +20,7 @@ function SellerListPage() {
|
|
|
20
20
|
pageId="seller-list"
|
|
21
21
|
listQuery={sellerListQuery}
|
|
22
22
|
route={Route}
|
|
23
|
-
title=
|
|
23
|
+
title={<Trans>Sellers</Trans>}
|
|
24
24
|
defaultVisibility={{
|
|
25
25
|
name: true,
|
|
26
26
|
}}
|
|
@@ -31,7 +31,6 @@ function SellerListPage() {
|
|
|
31
31
|
}}
|
|
32
32
|
customizeColumns={{
|
|
33
33
|
name: {
|
|
34
|
-
header: 'Name',
|
|
35
34
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
36
35
|
},
|
|
37
36
|
}}
|
|
@@ -47,7 +46,7 @@ function SellerListPage() {
|
|
|
47
46
|
<Button asChild>
|
|
48
47
|
<Link to="./new">
|
|
49
48
|
<PlusIcon className="mr-2 h-4 w-4" />
|
|
50
|
-
New Seller
|
|
49
|
+
<Trans>New Seller</Trans>
|
|
51
50
|
</Link>
|
|
52
51
|
</Button>
|
|
53
52
|
</PermissionGuard>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
16
16
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
17
17
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
18
|
-
import { Trans, useLingui } from '
|
|
18
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
19
19
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
20
20
|
import { toast } from 'sonner';
|
|
21
21
|
import { createSellerDocument, sellerDetailDocument, updateSellerDocument } from './sellers.graphql.js';
|
|
@@ -39,7 +39,7 @@ function SellerDetailPage() {
|
|
|
39
39
|
const params = Route.useParams();
|
|
40
40
|
const navigate = useNavigate();
|
|
41
41
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
42
|
-
const {
|
|
42
|
+
const { t } = useLingui();
|
|
43
43
|
|
|
44
44
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
45
45
|
pageId,
|
|
@@ -55,14 +55,14 @@ function SellerDetailPage() {
|
|
|
55
55
|
},
|
|
56
56
|
params: { id: params.id },
|
|
57
57
|
onSuccess: async data => {
|
|
58
|
-
toast(
|
|
58
|
+
toast(creatingNewEntity ? t`Successfully created seller` : t`Successfully updated seller`);
|
|
59
59
|
form.reset(form.getValues());
|
|
60
60
|
if (creatingNewEntity) {
|
|
61
61
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
onError: err => {
|
|
65
|
-
toast(
|
|
65
|
+
toast(creatingNewEntity ? t`Failed to create seller` : t`Failed to update seller`, {
|
|
66
66
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
67
67
|
});
|
|
68
68
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Money } from '@/vdb/components/data-display/money.js';
|
|
2
|
-
import { Trans } from '
|
|
2
|
+
import { Trans } from '@lingui/react/macro';
|
|
3
3
|
|
|
4
4
|
export function PriceDisplay({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}: Readonly<{
|
|
5
|
+
price,
|
|
6
|
+
priceWithTax,
|
|
7
|
+
currencyCode,
|
|
8
|
+
}: Readonly<{
|
|
9
9
|
price: number;
|
|
10
10
|
priceWithTax: number;
|
|
11
11
|
currencyCode: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Alert, AlertDescription } from '@/vdb/components/ui/alert.js';
|
|
2
2
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
3
|
import { Card, CardContent, CardHeader, CardTitle } from '@/vdb/components/ui/card.js';
|
|
4
|
-
import { Trans } from '
|
|
4
|
+
import { Trans } from '@lingui/react/macro';
|
|
5
5
|
import { PlayIcon } from 'lucide-react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
@@ -3,9 +3,10 @@ import { AccordionContent, AccordionItem, AccordionTrigger } from '@/vdb/compone
|
|
|
3
3
|
import { Form } from '@/vdb/components/ui/form.js';
|
|
4
4
|
import { Input } from '@/vdb/components/ui/input.js';
|
|
5
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/vdb/components/ui/select.js';
|
|
6
|
+
import { LS_KEY_SHIPPING_TEST_ADDRESS } from '@/vdb/constants.js';
|
|
6
7
|
import { api } from '@/vdb/graphql/api.js';
|
|
7
8
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
8
|
-
import { Trans } from '
|
|
9
|
+
import { Trans } from '@lingui/react/macro';
|
|
9
10
|
import { useQuery } from '@tanstack/react-query';
|
|
10
11
|
import { useEffect, useRef } from 'react';
|
|
11
12
|
import { useForm } from 'react-hook-form';
|
|
@@ -43,7 +44,7 @@ export function TestAddressForm({ onAddressChange }: Readonly<TestAddressFormPro
|
|
|
43
44
|
const form = useForm<TestAddress>({
|
|
44
45
|
defaultValues: (() => {
|
|
45
46
|
try {
|
|
46
|
-
const stored = localStorage.getItem(
|
|
47
|
+
const stored = localStorage.getItem(LS_KEY_SHIPPING_TEST_ADDRESS);
|
|
47
48
|
return stored
|
|
48
49
|
? JSON.parse(stored)
|
|
49
50
|
: {
|
|
@@ -92,7 +93,7 @@ export function TestAddressForm({ onAddressChange }: Readonly<TestAddressFormPro
|
|
|
92
93
|
previousValuesRef.current = currentValueString;
|
|
93
94
|
|
|
94
95
|
try {
|
|
95
|
-
localStorage.setItem(
|
|
96
|
+
localStorage.setItem(LS_KEY_SHIPPING_TEST_ADDRESS, currentValueString);
|
|
96
97
|
} catch {
|
|
97
98
|
// Ignore localStorage errors
|
|
98
99
|
}
|
|
@@ -7,9 +7,10 @@ import { AccordionContent, AccordionItem, AccordionTrigger } from '@/vdb/compone
|
|
|
7
7
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
8
8
|
import { Input } from '@/vdb/components/ui/input.js';
|
|
9
9
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/vdb/components/ui/table.js';
|
|
10
|
+
import { LS_KEY_SHIPPING_TEST_ORDER } from '@/vdb/constants.js';
|
|
10
11
|
import { useChannel } from '@/vdb/hooks/use-channel.js';
|
|
11
12
|
import { useLocalFormat } from '@/vdb/hooks/use-local-format.js';
|
|
12
|
-
import { Trans } from '
|
|
13
|
+
import { Trans } from '@lingui/react/macro';
|
|
13
14
|
import {
|
|
14
15
|
ColumnDef,
|
|
15
16
|
flexRender,
|
|
@@ -38,7 +39,7 @@ export function TestOrderBuilder({ onOrderLinesChange }: Readonly<TestOrderBuild
|
|
|
38
39
|
const { activeChannel } = useChannel();
|
|
39
40
|
const [lines, setLines] = useState<TestOrderLine[]>(() => {
|
|
40
41
|
try {
|
|
41
|
-
const stored = localStorage.getItem(
|
|
42
|
+
const stored = localStorage.getItem(LS_KEY_SHIPPING_TEST_ORDER);
|
|
42
43
|
return stored ? JSON.parse(stored) : [];
|
|
43
44
|
} catch {
|
|
44
45
|
return [];
|
|
@@ -51,7 +52,7 @@ export function TestOrderBuilder({ onOrderLinesChange }: Readonly<TestOrderBuild
|
|
|
51
52
|
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
try {
|
|
54
|
-
localStorage.setItem(
|
|
55
|
+
localStorage.setItem(LS_KEY_SHIPPING_TEST_ORDER, JSON.stringify(lines));
|
|
55
56
|
} catch {
|
|
56
57
|
// Ignore localStorage errors
|
|
57
58
|
}
|