@vendure/dashboard 3.4.3-master-202509260228 → 3.5.0-minor-202510012036
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/api/api-extensions.js +11 -14
- package/dist/plugin/api/metrics.resolver.d.ts +2 -2
- package/dist/plugin/api/metrics.resolver.js +2 -2
- package/dist/plugin/config/metrics-strategies.d.ts +9 -9
- package/dist/plugin/config/metrics-strategies.js +6 -6
- package/dist/plugin/constants.d.ts +2 -0
- package/dist/plugin/constants.js +3 -1
- package/dist/plugin/dashboard.plugin.js +13 -0
- package/dist/plugin/service/metrics.service.d.ts +3 -3
- package/dist/plugin/service/metrics.service.js +37 -53
- package/dist/plugin/types.d.ts +9 -12
- package/dist/plugin/types.js +7 -11
- 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 +10 -8
- 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 +10 -6
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +16 -5
- 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 +18 -6
- 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.graphql.ts +10 -0
- 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-group-badge.tsx +19 -0
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +3 -3
- package/src/app/routes/_authenticated/_products/components/product-options-table.tsx +114 -0
- package/src/app/routes/_authenticated/_products/product-option-groups.graphql.ts +103 -0
- package/src/app/routes/_authenticated/_products/products.graphql.ts +44 -32
- package/src/app/routes/_authenticated/_products/products.tsx +34 -5
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +29 -12
- package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +11 -11
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +177 -0
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +208 -0
- 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 +11 -11
- package/src/app/routes/_authenticated/_shipping-methods/components/test-order-builder.tsx +1 -1
- 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/components/zone-countries-sheet.tsx +4 -1
- 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 +46 -25
- 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-display/json.tsx +16 -1
- 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/index.ts +3 -0
- 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 +290 -0
- package/src/lib/components/data-table/add-filter-menu.tsx +17 -10
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +45 -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-context.tsx +91 -0
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +2 -1
- package/src/lib/components/data-table/data-table-filter-badge.tsx +9 -5
- 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 +21 -10
- package/src/lib/components/data-table/data-table.tsx +146 -94
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +4 -4
- package/src/lib/components/data-table/global-views-bar.tsx +97 -0
- package/src/lib/components/data-table/global-views-sheet.tsx +11 -0
- package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
- package/src/lib/components/data-table/manage-global-views-button.tsx +26 -0
- package/src/lib/components/data-table/my-views-button.tsx +47 -0
- package/src/lib/components/data-table/refresh-button.tsx +12 -3
- package/src/lib/components/data-table/save-view-button.tsx +41 -0
- package/src/lib/components/data-table/save-view-dialog.tsx +113 -0
- package/src/lib/components/data-table/use-generated-columns.tsx +13 -8
- package/src/lib/components/data-table/user-views-sheet.tsx +11 -0
- package/src/lib/components/data-table/views-sheet.tsx +305 -0
- package/src/lib/components/date-range-picker.tsx +186 -0
- 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 +64 -34
- 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/components/ui/button.tsx +1 -1
- package/src/lib/framework/dashboard-widget/base-widget.tsx +11 -9
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +35 -6
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +18 -12
- package/src/lib/framework/dashboard-widget/metrics-widget/metrics-widget.graphql.ts +9 -3
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +26 -79
- package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +35 -0
- package/src/lib/framework/defaults.ts +34 -63
- package/src/lib/framework/document-introspection/add-custom-fields.spec.ts +319 -9
- package/src/lib/framework/document-introspection/add-custom-fields.ts +60 -31
- package/src/lib/framework/document-introspection/get-document-structure.spec.ts +1 -159
- package/src/lib/framework/document-introspection/include-only-selected-list-fields.spec.ts +1840 -0
- package/src/lib/framework/document-introspection/include-only-selected-list-fields.ts +940 -0
- package/src/lib/framework/document-introspection/testing-utils.ts +161 -0
- package/src/lib/framework/extension-api/display-component-extensions.tsx +2 -0
- package/src/lib/framework/extension-api/types/data-table.ts +62 -4
- package/src/lib/framework/extension-api/types/navigation.ts +16 -0
- package/src/lib/framework/form-engine/utils.ts +34 -0
- 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/list-page.tsx +289 -4
- package/src/lib/framework/page/use-extended-router.tsx +101 -34
- package/src/lib/graphql/api.ts +6 -2
- package/src/lib/graphql/graphql-env.d.ts +38 -26
- 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 +6 -1
- package/src/lib/hooks/use-local-format.ts +15 -1
- package/src/lib/hooks/use-saved-views.ts +230 -0
- package/src/lib/hooks/use-ui-language-loader.ts +30 -0
- package/src/lib/index.ts +15 -0
- package/src/lib/lib/load-i18n-messages.ts +17 -0
- package/src/lib/lib/trans.tsx +15 -11
- package/src/lib/providers/i18n-provider.tsx +7 -14
- package/src/lib/types/saved-views.ts +39 -0
- package/src/lib/utils/saved-views-utils.ts +40 -0
|
@@ -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 { ZoneCountriesTable } from './components/zone-countries-table.js';
|
|
@@ -30,7 +30,10 @@ export const Route = createFileRoute('/_authenticated/_zones/zones_/$id')({
|
|
|
30
30
|
pageId,
|
|
31
31
|
queryDocument: zoneDetailDocument,
|
|
32
32
|
breadcrumb(isNew, entity) {
|
|
33
|
-
return [
|
|
33
|
+
return [
|
|
34
|
+
{ path: '/zones', label: <Trans>Zones</Trans> },
|
|
35
|
+
isNew ? <Trans>New zone</Trans> : entity?.name,
|
|
36
|
+
];
|
|
34
37
|
},
|
|
35
38
|
}),
|
|
36
39
|
errorComponent: ({ error }) => <ErrorPage message={error.message} />,
|
|
@@ -40,7 +43,7 @@ function ZoneDetailPage() {
|
|
|
40
43
|
const params = Route.useParams();
|
|
41
44
|
const navigate = useNavigate();
|
|
42
45
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
43
|
-
const {
|
|
46
|
+
const { t } = useLingui();
|
|
44
47
|
|
|
45
48
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
46
49
|
pageId,
|
|
@@ -56,14 +59,14 @@ function ZoneDetailPage() {
|
|
|
56
59
|
},
|
|
57
60
|
params: { id: params.id },
|
|
58
61
|
onSuccess: async data => {
|
|
59
|
-
toast.success(
|
|
62
|
+
toast.success(creatingNewEntity ? t`Successfully created zone` : t`Successfully updated zone`);
|
|
60
63
|
resetForm();
|
|
61
64
|
if (creatingNewEntity) {
|
|
62
65
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
63
66
|
}
|
|
64
67
|
},
|
|
65
68
|
onError: err => {
|
|
66
|
-
toast.error(
|
|
69
|
+
toast.error(creatingNewEntity ? t`Failed to create zone` : t`Failed to update zone`, {
|
|
67
70
|
description: err instanceof Error ? err.message : 'Unknown error',
|
|
68
71
|
});
|
|
69
72
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DateRangePicker } from '@/vdb/components/date-range-picker.js';
|
|
1
2
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
3
|
import type { GridLayout as GridLayoutType } from '@/vdb/components/ui/grid-layout.js';
|
|
3
4
|
import { GridLayout } from '@/vdb/components/ui/grid-layout.js';
|
|
@@ -5,6 +6,10 @@ import {
|
|
|
5
6
|
getDashboardWidget,
|
|
6
7
|
getDashboardWidgetRegistry,
|
|
7
8
|
} from '@/vdb/framework/dashboard-widget/widget-extensions.js';
|
|
9
|
+
import {
|
|
10
|
+
DefinedDateRange,
|
|
11
|
+
WidgetFiltersProvider,
|
|
12
|
+
} from '@/vdb/framework/dashboard-widget/widget-filters-context.js';
|
|
8
13
|
import { DashboardWidgetInstance } from '@/vdb/framework/extension-api/types/widgets.js';
|
|
9
14
|
import {
|
|
10
15
|
FullWidthPageBlock,
|
|
@@ -16,7 +21,9 @@ import {
|
|
|
16
21
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
17
22
|
import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
|
|
18
23
|
import { createFileRoute } from '@tanstack/react-router';
|
|
19
|
-
import {
|
|
24
|
+
import { endOfDay, startOfMonth } from 'date-fns';
|
|
25
|
+
import { useEffect, useRef, useState } from 'react';
|
|
26
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
20
27
|
|
|
21
28
|
export const Route = createFileRoute('/_authenticated/')({
|
|
22
29
|
component: DashboardPage,
|
|
@@ -67,12 +74,17 @@ function DashboardPage() {
|
|
|
67
74
|
const [editMode, setEditMode] = useState(false);
|
|
68
75
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
69
76
|
const prevEditModeRef = useRef(editMode);
|
|
77
|
+
const { t } = useLingui();
|
|
78
|
+
const [dateRange, setDateRange] = useState<DefinedDateRange>({
|
|
79
|
+
from: startOfMonth(new Date()),
|
|
80
|
+
to: endOfDay(new Date()),
|
|
81
|
+
});
|
|
70
82
|
|
|
71
83
|
const { settings, setWidgetLayout } = useUserSettings();
|
|
72
84
|
|
|
73
85
|
useEffect(() => {
|
|
74
86
|
const savedLayouts = settings.widgetLayout || {};
|
|
75
|
-
|
|
87
|
+
|
|
76
88
|
const initialWidgets = Array.from(getDashboardWidgetRegistry().entries()).reduce(
|
|
77
89
|
(acc: DashboardWidgetInstance[], [id, widget]) => {
|
|
78
90
|
const defaultSize = {
|
|
@@ -88,7 +100,7 @@ function DashboardPage() {
|
|
|
88
100
|
|
|
89
101
|
// Check if we have a saved layout for this widget
|
|
90
102
|
const savedLayout = savedLayouts[id];
|
|
91
|
-
|
|
103
|
+
|
|
92
104
|
const layout = {
|
|
93
105
|
w: savedLayout?.w ?? defaultSize.w,
|
|
94
106
|
h: savedLayout?.h ?? defaultSize.h,
|
|
@@ -125,7 +137,7 @@ function DashboardPage() {
|
|
|
125
137
|
setWidgets(initialWidgets);
|
|
126
138
|
setIsInitialized(true);
|
|
127
139
|
}, [settings.widgetLayout]);
|
|
128
|
-
|
|
140
|
+
|
|
129
141
|
// Save layout when edit mode is turned off
|
|
130
142
|
useEffect(() => {
|
|
131
143
|
// Only save when transitioning from edit mode ON to OFF
|
|
@@ -141,7 +153,7 @@ function DashboardPage() {
|
|
|
141
153
|
});
|
|
142
154
|
setWidgetLayout(layoutConfig);
|
|
143
155
|
}
|
|
144
|
-
|
|
156
|
+
|
|
145
157
|
// Update the ref for next render
|
|
146
158
|
prevEditModeRef.current = editMode;
|
|
147
159
|
}, [editMode, isInitialized, widgets, setWidgetLayout]);
|
|
@@ -165,14 +177,21 @@ function DashboardPage() {
|
|
|
165
177
|
|
|
166
178
|
return (
|
|
167
179
|
<Page pageId="insights">
|
|
168
|
-
<PageTitle>
|
|
180
|
+
<PageTitle>
|
|
181
|
+
<Trans>Insights</Trans>
|
|
182
|
+
</PageTitle>
|
|
169
183
|
<PageActionBar>
|
|
170
184
|
<PageActionBarRight>
|
|
171
|
-
<
|
|
172
|
-
|
|
185
|
+
<DateRangePicker
|
|
186
|
+
dateRange={dateRange}
|
|
187
|
+
onDateRangeChange={setDateRange}
|
|
188
|
+
className="mr-2"
|
|
189
|
+
/>
|
|
190
|
+
<Button
|
|
191
|
+
variant={editMode ? 'default' : 'outline'}
|
|
173
192
|
onClick={() => setEditMode(prev => !prev)}
|
|
174
193
|
>
|
|
175
|
-
{editMode ?
|
|
194
|
+
{editMode ? t`Save Layout` : t`Edit Layout`}
|
|
176
195
|
</Button>
|
|
177
196
|
</PageActionBarRight>
|
|
178
197
|
</PageActionBar>
|
|
@@ -180,22 +199,24 @@ function DashboardPage() {
|
|
|
180
199
|
<FullWidthPageBlock blockId="widgets">
|
|
181
200
|
<div className="w-full">
|
|
182
201
|
{widgets.length > 0 ? (
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
202
|
+
<WidgetFiltersProvider filters={{ dateRange }}>
|
|
203
|
+
<GridLayout
|
|
204
|
+
layouts={widgets.map(w => ({ ...w.layout, i: w.id }))}
|
|
205
|
+
onLayoutChange={handleLayoutChange}
|
|
206
|
+
cols={12}
|
|
207
|
+
rowHeight={100}
|
|
208
|
+
isDraggable={editMode}
|
|
209
|
+
isResizable={editMode}
|
|
210
|
+
className="min-h-[400px]"
|
|
211
|
+
gutter={10}
|
|
212
|
+
>
|
|
213
|
+
{
|
|
214
|
+
widgets
|
|
215
|
+
.map(widget => renderWidget(widget))
|
|
216
|
+
.filter(Boolean) as React.ReactElement[]
|
|
217
|
+
}
|
|
218
|
+
</GridLayout>
|
|
219
|
+
</WidgetFiltersProvider>
|
|
199
220
|
) : (
|
|
200
221
|
<div
|
|
201
222
|
className="flex items-center justify-center text-muted-foreground"
|
package/src/app/styles.css
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are strings that are not defined as string literals in the code (and therefore won't
|
|
3
|
+
* get extracted), but still need to have translations
|
|
4
|
+
*/
|
|
5
|
+
const commonI18nString = {
|
|
6
|
+
fulfillmentState: [
|
|
7
|
+
/* i18n*/ 'fulfillmentState.Created',
|
|
8
|
+
/* i18n*/ 'fulfillmentState.Pending',
|
|
9
|
+
/* i18n*/ 'fulfillmentState.Cancelled',
|
|
10
|
+
/* i18n*/ 'fulfillmentState.Shipped',
|
|
11
|
+
/* i18n*/ 'fulfillmentState.Delivered',
|
|
12
|
+
/* i18n*/ 'fulfillmentState.Cancelled',
|
|
13
|
+
],
|
|
14
|
+
paymentState: [
|
|
15
|
+
/* i18n*/ 'paymentState.Created',
|
|
16
|
+
/* i18n*/ 'paymentState.Authorized',
|
|
17
|
+
/* i18n*/ 'paymentState.Settled',
|
|
18
|
+
/* i18n*/ 'paymentState.Declined',
|
|
19
|
+
/* i18n*/ 'paymentState.Error',
|
|
20
|
+
/* i18n*/ 'paymentState.Cancelled',
|
|
21
|
+
],
|
|
22
|
+
refundState: [
|
|
23
|
+
/* i18n*/ 'paymentState.Pending',
|
|
24
|
+
/* i18n*/ 'paymentState.Settled',
|
|
25
|
+
/* i18n*/ 'paymentState.Failed',
|
|
26
|
+
],
|
|
27
|
+
orderState: [
|
|
28
|
+
/* i18n*/ 'orderState.Created',
|
|
29
|
+
/* i18n*/ 'orderState.Draft',
|
|
30
|
+
/* i18n*/ 'orderState.AddingItems',
|
|
31
|
+
/* i18n*/ 'orderState.Cancelled',
|
|
32
|
+
/* i18n*/ 'orderState.ArrangingPayment',
|
|
33
|
+
/* i18n*/ 'orderState.PaymentAuthorized',
|
|
34
|
+
/* i18n*/ 'orderState.PaymentSettled',
|
|
35
|
+
/* i18n*/ 'orderState.PartiallyShipped',
|
|
36
|
+
/* i18n*/ 'orderState.Shipped',
|
|
37
|
+
/* i18n*/ 'orderState.PartiallyDelivered',
|
|
38
|
+
/* i18n*/ 'orderState.Delivered',
|
|
39
|
+
/* i18n*/ 'orderState.Modifying',
|
|
40
|
+
/* i18n*/ 'orderState.ArrangingAdditionalPayment',
|
|
41
|
+
],
|
|
42
|
+
fieldName: [
|
|
43
|
+
/* i18n*/ 'fieldName.attempts',
|
|
44
|
+
/* i18n*/ 'fieldName.availableCurrencyCodes',
|
|
45
|
+
/* i18n*/ 'fieldName.availableLanguageCodes',
|
|
46
|
+
/* i18n*/ 'fieldName.breadcrumbs',
|
|
47
|
+
/* i18n*/ 'fieldName.category',
|
|
48
|
+
/* i18n*/ 'fieldName.channels',
|
|
49
|
+
/* i18n*/ 'fieldName.children',
|
|
50
|
+
/* i18n*/ 'fieldName.code',
|
|
51
|
+
/* i18n*/ 'fieldName.couponCode',
|
|
52
|
+
/* i18n*/ 'fieldName.createdAt',
|
|
53
|
+
/* i18n*/ 'fieldName.currencyCode',
|
|
54
|
+
/* i18n*/ 'fieldName.customer',
|
|
55
|
+
/* i18n*/ 'fieldName.customerGroup',
|
|
56
|
+
/* i18n*/ 'fieldName.customers',
|
|
57
|
+
/* i18n*/ 'fieldName.customFields',
|
|
58
|
+
/* i18n*/ 'fieldName.data',
|
|
59
|
+
/* i18n*/ 'fieldName.defaultCurrencyCode',
|
|
60
|
+
/* i18n*/ 'fieldName.defaultLanguageCode',
|
|
61
|
+
/* i18n*/ 'fieldName.defaultShippingZone',
|
|
62
|
+
/* i18n*/ 'fieldName.defaultTaxZone',
|
|
63
|
+
/* i18n*/ 'fieldName.description',
|
|
64
|
+
/* i18n*/ 'fieldName.duration',
|
|
65
|
+
/* i18n*/ 'fieldName.emailAddress',
|
|
66
|
+
/* i18n*/ 'fieldName.enabled',
|
|
67
|
+
/* i18n*/ 'fieldName.endsAt',
|
|
68
|
+
/* i18n*/ 'fieldName.error',
|
|
69
|
+
/* i18n*/ 'fieldName.featuredAsset',
|
|
70
|
+
/* i18n*/ 'fieldName.firstName',
|
|
71
|
+
/* i18n*/ 'fieldName.fulfillmentHandlerCode',
|
|
72
|
+
/* i18n*/ 'fieldName.id',
|
|
73
|
+
/* i18n*/ 'fieldName.isDefault',
|
|
74
|
+
/* i18n*/ 'fieldName.isPrivate',
|
|
75
|
+
/* i18n*/ 'fieldName.isSettled',
|
|
76
|
+
/* i18n*/ 'fieldName.lastName',
|
|
77
|
+
/* i18n*/ 'fieldName.name',
|
|
78
|
+
/* i18n*/ 'fieldName.orderPlacedAt',
|
|
79
|
+
/* i18n*/ 'fieldName.parentId',
|
|
80
|
+
/* i18n*/ 'fieldName.perCustomerUsageLimit',
|
|
81
|
+
/* i18n*/ 'fieldName.permissions',
|
|
82
|
+
/* i18n*/ 'fieldName.position',
|
|
83
|
+
/* i18n*/ 'fieldName.price',
|
|
84
|
+
/* i18n*/ 'fieldName.priceWithTax',
|
|
85
|
+
/* i18n*/ 'fieldName.pricesIncludeTax',
|
|
86
|
+
/* i18n*/ 'fieldName.productVariants',
|
|
87
|
+
/* i18n*/ 'fieldName.progress',
|
|
88
|
+
/* i18n*/ 'fieldName.queueName',
|
|
89
|
+
/* i18n*/ 'fieldName.result',
|
|
90
|
+
/* i18n*/ 'fieldName.retries',
|
|
91
|
+
/* i18n*/ 'fieldName.seller',
|
|
92
|
+
/* i18n*/ 'fieldName.settledAt',
|
|
93
|
+
/* i18n*/ 'fieldName.shippingLines',
|
|
94
|
+
/* i18n*/ 'fieldName.sku',
|
|
95
|
+
/* i18n*/ 'fieldName.slug',
|
|
96
|
+
/* i18n*/ 'fieldName.startedAt',
|
|
97
|
+
/* i18n*/ 'fieldName.startsAt',
|
|
98
|
+
/* i18n*/ 'fieldName.state',
|
|
99
|
+
/* i18n*/ 'fieldName.stockLevels',
|
|
100
|
+
/* i18n*/ 'fieldName.token',
|
|
101
|
+
/* i18n*/ 'fieldName.total',
|
|
102
|
+
/* i18n*/ 'fieldName.totalWithTax',
|
|
103
|
+
/* i18n*/ 'fieldName.type',
|
|
104
|
+
/* i18n*/ 'fieldName.updatedAt',
|
|
105
|
+
/* i18n*/ 'fieldName.usageLimit',
|
|
106
|
+
/* i18n*/ 'fieldName.user',
|
|
107
|
+
/* i18n*/ 'fieldName.value',
|
|
108
|
+
/* i18n*/ 'fieldName.valueList',
|
|
109
|
+
/* i18n*/ 'fieldName.zone',
|
|
110
|
+
],
|
|
111
|
+
};
|