@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
package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-result.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Badge } from '@/vdb/components/ui/badge.js';
|
|
2
2
|
import { useChannel } from '@/vdb/hooks/use-channel.js';
|
|
3
|
-
import { Trans } from '
|
|
3
|
+
import { Trans } from '@lingui/react/macro';
|
|
4
4
|
import { Check } from 'lucide-react';
|
|
5
5
|
import { MetadataBadges } from './metadata-badges.js';
|
|
6
6
|
import { PriceDisplay } from './price-display.js';
|
|
@@ -26,13 +26,13 @@ interface ShippingEligibilityTestResultProps {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function TestShippingMethodsResult({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}: Readonly<ShippingEligibilityTestResultProps>) {
|
|
29
|
+
testResult,
|
|
30
|
+
okToRun,
|
|
31
|
+
testDataUpdated,
|
|
32
|
+
hasTestedOnce,
|
|
33
|
+
onRunTest,
|
|
34
|
+
loading = false,
|
|
35
|
+
}: Readonly<ShippingEligibilityTestResultProps>) {
|
|
36
36
|
const { activeChannel } = useChannel();
|
|
37
37
|
const currencyCode = activeChannel?.defaultCurrencyCode ?? 'USD';
|
|
38
38
|
const hasResults = testResult && testResult.length > 0;
|
package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-sheet.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SheetTitle,
|
|
8
8
|
SheetTrigger,
|
|
9
9
|
} from '@/vdb/components/ui/sheet.js';
|
|
10
|
-
import { Trans } from '
|
|
10
|
+
import { Trans } from '@lingui/react/macro';
|
|
11
11
|
import { FlaskConical } from 'lucide-react';
|
|
12
12
|
import { useState } from 'react';
|
|
13
13
|
import { TestShippingMethods } from './test-shipping-methods.js';
|
package/src/app/routes/_authenticated/_shipping-methods/components/test-single-method-result.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useChannel } from '@/vdb/hooks/use-channel.js';
|
|
2
|
-
import { Trans } from '
|
|
2
|
+
import { Trans } from '@lingui/react/macro';
|
|
3
3
|
import { ResultOf } from 'gql.tada';
|
|
4
4
|
import { Check } from 'lucide-react';
|
|
5
5
|
import { testShippingMethodDocument } from '../shipping-methods.graphql.js';
|
|
@@ -19,13 +19,13 @@ interface TestSingleMethodResultProps {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function TestSingleMethodResult({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}: Readonly<TestSingleMethodResultProps>) {
|
|
22
|
+
testResult,
|
|
23
|
+
okToRun,
|
|
24
|
+
testDataUpdated,
|
|
25
|
+
hasTestedOnce,
|
|
26
|
+
onRunTest,
|
|
27
|
+
loading = false,
|
|
28
|
+
}: Readonly<TestSingleMethodResultProps>) {
|
|
29
29
|
const { activeChannel } = useChannel();
|
|
30
30
|
const currencyCode = activeChannel?.defaultCurrencyCode ?? 'USD';
|
|
31
31
|
const showEmptyState = testResult === undefined && hasTestedOnce && !testDataUpdated && !loading;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SheetTitle,
|
|
8
8
|
SheetTrigger,
|
|
9
9
|
} from '@/vdb/components/ui/sheet.js';
|
|
10
|
-
import { Trans } from '
|
|
10
|
+
import { Trans } from '@lingui/react/macro';
|
|
11
11
|
import { VariablesOf } from 'gql.tada';
|
|
12
12
|
import { FlaskConical } from 'lucide-react';
|
|
13
13
|
import { useState } from 'react';
|
|
@@ -20,9 +20,9 @@ interface TestSingleShippingMethodDialogProps {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function TestSingleShippingMethodSheet({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}: Readonly<TestSingleShippingMethodDialogProps>) {
|
|
23
|
+
checker,
|
|
24
|
+
calculator,
|
|
25
|
+
}: Readonly<TestSingleShippingMethodDialogProps>) {
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
27
|
|
|
28
28
|
return (
|
|
@@ -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 {
|
|
@@ -25,7 +25,7 @@ function ShippingMethodListPage() {
|
|
|
25
25
|
pageId="shipping-method-list"
|
|
26
26
|
listQuery={shippingMethodListQuery}
|
|
27
27
|
route={Route}
|
|
28
|
-
title=
|
|
28
|
+
title={<Trans>Shipping Methods</Trans>}
|
|
29
29
|
defaultVisibility={{
|
|
30
30
|
name: true,
|
|
31
31
|
code: true,
|
|
@@ -33,7 +33,6 @@ function ShippingMethodListPage() {
|
|
|
33
33
|
}}
|
|
34
34
|
customizeColumns={{
|
|
35
35
|
name: {
|
|
36
|
-
header: 'Name',
|
|
37
36
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
38
37
|
},
|
|
39
38
|
}}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
19
19
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
20
20
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
21
|
-
import { Trans, useLingui } from '
|
|
21
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
22
22
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
23
23
|
import { toast } from 'sonner';
|
|
24
24
|
import { FulfillmentHandlerSelector } from './components/fulfillment-handler-selector.js';
|
|
@@ -52,7 +52,7 @@ function ShippingMethodDetailPage() {
|
|
|
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,
|
|
@@ -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 {
|
|
@@ -22,12 +22,11 @@ function StockLocationListPage() {
|
|
|
22
22
|
return (
|
|
23
23
|
<ListPage
|
|
24
24
|
pageId="stock-location-list"
|
|
25
|
-
title=
|
|
25
|
+
title={<Trans>Stock Locations</Trans>}
|
|
26
26
|
listQuery={stockLocationListQuery}
|
|
27
27
|
route={Route}
|
|
28
28
|
customizeColumns={{
|
|
29
29
|
name: {
|
|
30
|
-
header: 'Name',
|
|
31
30
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
32
31
|
},
|
|
33
32
|
}}
|
|
@@ -56,7 +55,7 @@ function StockLocationListPage() {
|
|
|
56
55
|
<Button asChild>
|
|
57
56
|
<Link to="./new">
|
|
58
57
|
<PlusIcon className="mr-2 h-4 w-4" />
|
|
59
|
-
New Stock Location
|
|
58
|
+
<Trans>New Stock Location</Trans>
|
|
60
59
|
</Link>
|
|
61
60
|
</Button>
|
|
62
61
|
</PermissionGuard>
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
18
18
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
19
19
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
20
|
-
import { Trans, useLingui } from '
|
|
20
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
21
21
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
22
22
|
import { toast } from 'sonner';
|
|
23
23
|
import {
|
|
@@ -47,7 +47,7 @@ function StockLocationDetailPage() {
|
|
|
47
47
|
const params = Route.useParams();
|
|
48
48
|
const navigate = useNavigate();
|
|
49
49
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
50
|
-
const {
|
|
50
|
+
const { t } = useLingui();
|
|
51
51
|
|
|
52
52
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
53
53
|
pageId,
|
|
@@ -64,16 +64,23 @@ function StockLocationDetailPage() {
|
|
|
64
64
|
},
|
|
65
65
|
params: { id: params.id },
|
|
66
66
|
onSuccess: async data => {
|
|
67
|
-
toast.success(
|
|
67
|
+
toast.success(
|
|
68
|
+
creatingNewEntity
|
|
69
|
+
? t`Successfully created stock location`
|
|
70
|
+
: t`Successfully updated stock location`,
|
|
71
|
+
);
|
|
68
72
|
resetForm();
|
|
69
73
|
if (creatingNewEntity) {
|
|
70
74
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
71
75
|
}
|
|
72
76
|
},
|
|
73
77
|
onError: err => {
|
|
74
|
-
toast.error(
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
toast.error(
|
|
79
|
+
creatingNewEntity ? t`Failed to create stock location` : t`Failed to update stock location`,
|
|
80
|
+
{
|
|
81
|
+
description: err instanceof Error ? err.message : 'Unknown error',
|
|
82
|
+
},
|
|
83
|
+
);
|
|
77
84
|
},
|
|
78
85
|
});
|
|
79
86
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
2
|
import { Card, CardContent, CardHeader, CardTitle } from '@/vdb/components/ui/card.js';
|
|
3
3
|
import { Page, PageActionBar, PageTitle } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
4
|
-
import { Trans } from '
|
|
4
|
+
import { Trans } from '@lingui/react/macro';
|
|
5
5
|
import { useQuery } from '@tanstack/react-query';
|
|
6
6
|
import { createFileRoute } from '@tanstack/react-router';
|
|
7
7
|
import { formatRelative } from 'date-fns';
|
|
@@ -39,15 +39,21 @@ function HealthchecksPage() {
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<Page>
|
|
42
|
-
<PageTitle>
|
|
42
|
+
<PageTitle>
|
|
43
|
+
<Trans>Health checks</Trans>
|
|
44
|
+
</PageTitle>
|
|
43
45
|
<PageActionBar>
|
|
44
|
-
<Button onClick={() => refetch()}>
|
|
46
|
+
<Button onClick={() => refetch()}>
|
|
47
|
+
<Trans>Refresh</Trans>
|
|
48
|
+
</Button>
|
|
45
49
|
</PageActionBar>
|
|
46
50
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8 mt-6">
|
|
47
51
|
<Card>
|
|
48
52
|
<CardHeader>
|
|
49
53
|
<CardTitle className="flex items-center gap-2">
|
|
50
|
-
<span>
|
|
54
|
+
<span>
|
|
55
|
+
<Trans>Current status</Trans>
|
|
56
|
+
</span>
|
|
51
57
|
<span className="text-sm font-normal text-muted-foreground">
|
|
52
58
|
<Trans>Last updated {formatRelative(dataUpdatedAt, new Date())}</Trans>
|
|
53
59
|
</span>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
10
10
|
import { ListPage } from '@/vdb/framework/page/list-page.js';
|
|
11
11
|
import { api } from '@/vdb/graphql/api.js';
|
|
12
|
-
import { Trans } from '
|
|
12
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
13
13
|
import { useMutation } from '@tanstack/react-query';
|
|
14
14
|
import { createFileRoute } from '@tanstack/react-router';
|
|
15
15
|
import { formatRelative } from 'date-fns';
|
|
@@ -76,6 +76,7 @@ const REFRESH_INTERVALS = [
|
|
|
76
76
|
|
|
77
77
|
function JobQueuePage() {
|
|
78
78
|
const refreshRef = useRef<() => void>(() => {});
|
|
79
|
+
const { t } = useLingui();
|
|
79
80
|
const [refreshInterval, setRefreshInterval] = useState(10000);
|
|
80
81
|
|
|
81
82
|
useEffect(() => {
|
|
@@ -93,13 +94,12 @@ function JobQueuePage() {
|
|
|
93
94
|
return (
|
|
94
95
|
<ListPage
|
|
95
96
|
pageId="job-queue-list"
|
|
96
|
-
title=
|
|
97
|
+
title={<Trans>Job Queue</Trans>}
|
|
97
98
|
defaultSort={[{ id: 'createdAt', desc: true }]}
|
|
98
99
|
listQuery={jobListDocument}
|
|
99
100
|
route={Route}
|
|
100
101
|
customizeColumns={{
|
|
101
102
|
createdAt: {
|
|
102
|
-
header: 'Created At',
|
|
103
103
|
cell: ({ row }) => (
|
|
104
104
|
<div title={row.original.createdAt}>
|
|
105
105
|
{formatRelative(new Date(row.original.createdAt), new Date())}
|
|
@@ -107,7 +107,6 @@ function JobQueuePage() {
|
|
|
107
107
|
),
|
|
108
108
|
},
|
|
109
109
|
data: {
|
|
110
|
-
header: 'Data',
|
|
111
110
|
cell: ({ row }) => (
|
|
112
111
|
<PayloadDialog
|
|
113
112
|
payload={row.original.data}
|
|
@@ -115,18 +114,16 @@ function JobQueuePage() {
|
|
|
115
114
|
description={<Trans>The data that has been passed to the job</Trans>}
|
|
116
115
|
trigger={
|
|
117
116
|
<Button size="sm" variant="secondary">
|
|
118
|
-
View data
|
|
117
|
+
<Trans>View data</Trans>
|
|
119
118
|
</Button>
|
|
120
119
|
}
|
|
121
120
|
/>
|
|
122
121
|
),
|
|
123
122
|
},
|
|
124
123
|
queueName: {
|
|
125
|
-
header: 'Queue',
|
|
126
124
|
cell: ({ row }) => <span className="font-mono">{row.original.queueName}</span>,
|
|
127
125
|
},
|
|
128
126
|
result: {
|
|
129
|
-
header: 'Result',
|
|
130
127
|
cell: ({ row }) => {
|
|
131
128
|
return row.original.result ? (
|
|
132
129
|
<PayloadDialog
|
|
@@ -135,7 +132,7 @@ function JobQueuePage() {
|
|
|
135
132
|
description={<Trans>The result of the job</Trans>}
|
|
136
133
|
trigger={
|
|
137
134
|
<Button size="sm" variant="secondary">
|
|
138
|
-
View result
|
|
135
|
+
<Trans>View result</Trans>
|
|
139
136
|
</Button>
|
|
140
137
|
}
|
|
141
138
|
/>
|
|
@@ -147,7 +144,6 @@ function JobQueuePage() {
|
|
|
147
144
|
},
|
|
148
145
|
},
|
|
149
146
|
state: {
|
|
150
|
-
header: 'State',
|
|
151
147
|
cell: ({ row, table }) => {
|
|
152
148
|
const cancelJobMutation = useMutation({
|
|
153
149
|
mutationFn: (jobId: string) => api.mutate(cancelJobDocument, { jobId }),
|
|
@@ -196,7 +192,6 @@ function JobQueuePage() {
|
|
|
196
192
|
},
|
|
197
193
|
},
|
|
198
194
|
duration: {
|
|
199
|
-
header: 'Duration',
|
|
200
195
|
cell: ({ row }) => {
|
|
201
196
|
return row.original.duration ? `${row.original.duration}ms` : null;
|
|
202
197
|
},
|
|
@@ -213,7 +208,7 @@ function JobQueuePage() {
|
|
|
213
208
|
}}
|
|
214
209
|
facetedFilters={{
|
|
215
210
|
queueName: {
|
|
216
|
-
title:
|
|
211
|
+
title: t`Queue`,
|
|
217
212
|
optionsFn: async () => {
|
|
218
213
|
return api.query(jobQueueListDocument).then(r => {
|
|
219
214
|
return r.jobQueues.map(queue => ({
|
|
@@ -224,7 +219,7 @@ function JobQueuePage() {
|
|
|
224
219
|
},
|
|
225
220
|
},
|
|
226
221
|
state: {
|
|
227
|
-
title:
|
|
222
|
+
title: t`State`,
|
|
228
223
|
options: STATES,
|
|
229
224
|
},
|
|
230
225
|
}}
|
|
@@ -237,7 +232,9 @@ function JobQueuePage() {
|
|
|
237
232
|
<DropdownMenuTrigger asChild>
|
|
238
233
|
<Button variant="outline" size="sm" className="gap-2">
|
|
239
234
|
<RefreshCw className="h-4 w-4" />
|
|
240
|
-
<span>
|
|
235
|
+
<span>
|
|
236
|
+
<Trans>Auto refresh: {currentInterval?.label}</Trans>
|
|
237
|
+
</span>
|
|
241
238
|
<ChevronDown className="h-4 w-4" />
|
|
242
239
|
</Button>
|
|
243
240
|
</DropdownMenuTrigger>
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { api } from '@/vdb/graphql/api.js';
|
|
17
17
|
import { graphql, ResultOf } from '@/vdb/graphql/graphql.js';
|
|
18
18
|
import { useLocalFormat } from '@/vdb/hooks/use-local-format.js';
|
|
19
|
-
import { Trans, useLingui } from '
|
|
19
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
20
20
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
21
21
|
import { createFileRoute } from '@tanstack/react-router';
|
|
22
22
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
@@ -65,7 +65,7 @@ const runScheduledTaskDocument = graphql(`
|
|
|
65
65
|
type ScheduledTask = ResultOf<typeof getScheduledTasksDocument>['scheduledTasks'][number];
|
|
66
66
|
|
|
67
67
|
function ScheduledTasksPage() {
|
|
68
|
-
const {
|
|
68
|
+
const { t } = useLingui();
|
|
69
69
|
const { data } = useQuery({
|
|
70
70
|
queryKey: ['scheduledTasks'],
|
|
71
71
|
queryFn: () => api.query(getScheduledTasksDocument),
|
|
@@ -84,10 +84,10 @@ function ScheduledTasksPage() {
|
|
|
84
84
|
mutationFn: api.mutate(runScheduledTaskDocument),
|
|
85
85
|
onSuccess: result => {
|
|
86
86
|
if ((result as ResultOf<typeof runScheduledTaskDocument>).runScheduledTask.success) {
|
|
87
|
-
toast.success(
|
|
87
|
+
toast.success(t`Scheduled task will be executed`);
|
|
88
88
|
queryClient.invalidateQueries({ queryKey: ['scheduledTasks'] });
|
|
89
89
|
} else {
|
|
90
|
-
toast.error(
|
|
90
|
+
toast.error(t`Scheduled task could not be executed`);
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
});
|
|
@@ -104,13 +104,13 @@ function ScheduledTasksPage() {
|
|
|
104
104
|
const columnHelper = createColumnHelper<ScheduledTask>();
|
|
105
105
|
const columns = [
|
|
106
106
|
columnHelper.accessor('id', {
|
|
107
|
-
header:
|
|
107
|
+
header: t`ID`,
|
|
108
108
|
}),
|
|
109
109
|
columnHelper.accessor('description', {
|
|
110
|
-
header:
|
|
110
|
+
header: t`Description`,
|
|
111
111
|
}),
|
|
112
112
|
columnHelper.accessor('enabled', {
|
|
113
|
-
header:
|
|
113
|
+
header: t`Enabled`,
|
|
114
114
|
cell: ({ row }) => {
|
|
115
115
|
return row.original.enabled ? (
|
|
116
116
|
<Badge variant="success">
|
|
@@ -124,13 +124,13 @@ function ScheduledTasksPage() {
|
|
|
124
124
|
},
|
|
125
125
|
}),
|
|
126
126
|
columnHelper.accessor('schedule', {
|
|
127
|
-
header:
|
|
127
|
+
header: t`Schedule Pattern`,
|
|
128
128
|
}),
|
|
129
129
|
columnHelper.accessor('scheduleDescription', {
|
|
130
|
-
header:
|
|
130
|
+
header: t`Schedule`,
|
|
131
131
|
}),
|
|
132
132
|
columnHelper.accessor('lastExecutedAt', {
|
|
133
|
-
header:
|
|
133
|
+
header: t`Last Executed`,
|
|
134
134
|
cell: ({ row }) => {
|
|
135
135
|
return row.original.lastExecutedAt ? (
|
|
136
136
|
<div title={row.original.lastExecutedAt}>
|
|
@@ -142,7 +142,7 @@ function ScheduledTasksPage() {
|
|
|
142
142
|
},
|
|
143
143
|
}),
|
|
144
144
|
columnHelper.accessor('nextExecutionAt', {
|
|
145
|
-
header:
|
|
145
|
+
header: t`Next Execution`,
|
|
146
146
|
cell: ({ row }) => {
|
|
147
147
|
return row.original.nextExecutionAt ? (
|
|
148
148
|
formatDate(row.original.nextExecutionAt, intlDateOptions)
|
|
@@ -152,7 +152,7 @@ function ScheduledTasksPage() {
|
|
|
152
152
|
},
|
|
153
153
|
}),
|
|
154
154
|
columnHelper.accessor('isRunning', {
|
|
155
|
-
header:
|
|
155
|
+
header: t`Running`,
|
|
156
156
|
cell: ({ row }) => {
|
|
157
157
|
return row.original.isRunning ? (
|
|
158
158
|
<Badge variant="success">
|
|
@@ -166,7 +166,7 @@ function ScheduledTasksPage() {
|
|
|
166
166
|
},
|
|
167
167
|
}),
|
|
168
168
|
columnHelper.accessor('lastResult', {
|
|
169
|
-
header:
|
|
169
|
+
header: t`Last Result`,
|
|
170
170
|
cell: ({ row }) => {
|
|
171
171
|
return row.original.lastResult ? (
|
|
172
172
|
<PayloadDialog
|
|
@@ -175,7 +175,7 @@ function ScheduledTasksPage() {
|
|
|
175
175
|
description={<Trans>The result of the job</Trans>}
|
|
176
176
|
trigger={
|
|
177
177
|
<Button size="sm" variant="secondary">
|
|
178
|
-
View result
|
|
178
|
+
<Trans>View result</Trans>
|
|
179
179
|
</Button>
|
|
180
180
|
}
|
|
181
181
|
/>
|
|
@@ -188,7 +188,7 @@ function ScheduledTasksPage() {
|
|
|
188
188
|
}),
|
|
189
189
|
columnHelper.display({
|
|
190
190
|
id: 'actions',
|
|
191
|
-
header:
|
|
191
|
+
header: t`Actions`,
|
|
192
192
|
cell: ({ row }) => {
|
|
193
193
|
return (
|
|
194
194
|
<DropdownMenu>
|
|
@@ -228,7 +228,9 @@ function ScheduledTasksPage() {
|
|
|
228
228
|
|
|
229
229
|
return (
|
|
230
230
|
<Page pageId="scheduled-tasks-list">
|
|
231
|
-
<PageTitle>
|
|
231
|
+
<PageTitle>
|
|
232
|
+
<Trans>Scheduled Tasks</Trans>
|
|
233
|
+
</PageTitle>
|
|
232
234
|
<PageLayout>
|
|
233
235
|
<FullWidthPageBlock blockId="list-table">
|
|
234
236
|
<DataTable
|
|
@@ -4,7 +4,7 @@ import { Badge } from '@/vdb/components/ui/badge.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 { DeleteTaxCategoriesBulkAction } from './components/tax-category-bulk-actions.js';
|
|
@@ -21,7 +21,7 @@ function TaxCategoryListPage() {
|
|
|
21
21
|
pageId="tax-category-list"
|
|
22
22
|
listQuery={taxCategoryListQuery}
|
|
23
23
|
route={Route}
|
|
24
|
-
title=
|
|
24
|
+
title={<Trans>Tax Categories</Trans>}
|
|
25
25
|
defaultVisibility={{
|
|
26
26
|
name: true,
|
|
27
27
|
isDefault: true,
|
|
@@ -37,11 +37,9 @@ function TaxCategoryListPage() {
|
|
|
37
37
|
}}
|
|
38
38
|
customizeColumns={{
|
|
39
39
|
name: {
|
|
40
|
-
header: 'Name',
|
|
41
40
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
42
41
|
},
|
|
43
42
|
isDefault: {
|
|
44
|
-
header: 'Default',
|
|
45
43
|
cell: ({ row }) => (
|
|
46
44
|
<Badge variant={row.original.isDefault ? 'success' : 'destructive'}>
|
|
47
45
|
<Trans>{row.original.isDefault ? 'Yes' : 'No'}</Trans>
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@/vdb/framework/layout-engine/page-layout.js';
|
|
18
18
|
import { detailPageRouteLoader } from '@/vdb/framework/page/detail-page-route-loader.js';
|
|
19
19
|
import { useDetailPage } from '@/vdb/framework/page/use-detail-page.js';
|
|
20
|
-
import { Trans, useLingui } from '
|
|
20
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
21
21
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
22
22
|
import { toast } from 'sonner';
|
|
23
23
|
import {
|
|
@@ -47,7 +47,7 @@ function TaxCategoryDetailPage() {
|
|
|
47
47
|
const params = Route.useParams();
|
|
48
48
|
const navigate = useNavigate();
|
|
49
49
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
50
|
-
const {
|
|
50
|
+
const { t } = useLingui();
|
|
51
51
|
|
|
52
52
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
53
53
|
pageId,
|
|
@@ -63,16 +63,23 @@ function TaxCategoryDetailPage() {
|
|
|
63
63
|
},
|
|
64
64
|
params: { id: params.id },
|
|
65
65
|
onSuccess: async data => {
|
|
66
|
-
toast.success(
|
|
66
|
+
toast.success(
|
|
67
|
+
creatingNewEntity
|
|
68
|
+
? t`Successfully created tax category`
|
|
69
|
+
: t`Successfully updated tax category`,
|
|
70
|
+
);
|
|
67
71
|
form.reset(form.getValues());
|
|
68
72
|
if (creatingNewEntity) {
|
|
69
73
|
await navigate({ to: `../$id`, params: { id: data.id } });
|
|
70
74
|
}
|
|
71
75
|
},
|
|
72
76
|
onError: err => {
|
|
73
|
-
toast.error(
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
toast.error(
|
|
78
|
+
creatingNewEntity ? t`Failed to create tax category` : t`Failed to update tax category`,
|
|
79
|
+
{
|
|
80
|
+
description: err instanceof Error ? err.message : 'Unknown error',
|
|
81
|
+
},
|
|
82
|
+
);
|
|
76
83
|
},
|
|
77
84
|
});
|
|
78
85
|
|
|
@@ -5,7 +5,7 @@ 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
7
|
import { api } from '@/vdb/graphql/api.js';
|
|
8
|
-
import { Trans } from '
|
|
8
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
9
9
|
import { createFileRoute, Link } from '@tanstack/react-router';
|
|
10
10
|
import { PlusIcon } from 'lucide-react';
|
|
11
11
|
import { taxCategoryListQuery } from '../_tax-categories/tax-categories.graphql.js';
|
|
@@ -19,12 +19,13 @@ export const Route = createFileRoute('/_authenticated/_tax-rates/tax-rates')({
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
function TaxRateListPage() {
|
|
22
|
+
const { t } = useLingui();
|
|
22
23
|
return (
|
|
23
24
|
<ListPage
|
|
24
25
|
pageId="tax-rate-list"
|
|
25
26
|
listQuery={taxRateListQuery}
|
|
26
27
|
route={Route}
|
|
27
|
-
title=
|
|
28
|
+
title={<Trans>Tax Rates</Trans>}
|
|
28
29
|
defaultVisibility={{
|
|
29
30
|
name: true,
|
|
30
31
|
enabled: true,
|
|
@@ -43,14 +44,14 @@ function TaxRateListPage() {
|
|
|
43
44
|
}}
|
|
44
45
|
facetedFilters={{
|
|
45
46
|
enabled: {
|
|
46
|
-
title:
|
|
47
|
+
title: t`Enabled`,
|
|
47
48
|
options: [
|
|
48
|
-
{ label:
|
|
49
|
-
{ label:
|
|
49
|
+
{ label: t`Enabled`, value: true },
|
|
50
|
+
{ label: t`Disabled`, value: false },
|
|
50
51
|
],
|
|
51
52
|
},
|
|
52
53
|
category: {
|
|
53
|
-
title:
|
|
54
|
+
title: t`Category`,
|
|
54
55
|
optionsFn: async () => {
|
|
55
56
|
const { taxCategories } = await api.query(taxCategoryListQuery);
|
|
56
57
|
return taxCategories.items.map(category => ({
|
|
@@ -60,7 +61,7 @@ function TaxRateListPage() {
|
|
|
60
61
|
},
|
|
61
62
|
},
|
|
62
63
|
zone: {
|
|
63
|
-
title:
|
|
64
|
+
title: t`Zone`,
|
|
64
65
|
optionsFn: async () => {
|
|
65
66
|
const { zones } = await api.query(zoneListQuery);
|
|
66
67
|
return zones.items.map(zone => ({
|
|
@@ -72,23 +73,18 @@ function TaxRateListPage() {
|
|
|
72
73
|
}}
|
|
73
74
|
customizeColumns={{
|
|
74
75
|
name: {
|
|
75
|
-
header: 'Name',
|
|
76
76
|
cell: ({ row }) => <DetailPageButton id={row.original.id} label={row.original.name} />,
|
|
77
77
|
},
|
|
78
78
|
enabled: {
|
|
79
|
-
header: 'Enabled',
|
|
80
79
|
cell: ({ row }) => <BooleanDisplayBadge value={row.original.enabled} />,
|
|
81
80
|
},
|
|
82
81
|
category: {
|
|
83
|
-
header: 'Category',
|
|
84
82
|
cell: ({ row }) => row.original.category?.name,
|
|
85
83
|
},
|
|
86
84
|
zone: {
|
|
87
|
-
header: 'Zone',
|
|
88
85
|
cell: ({ row }) => row.original.zone?.name,
|
|
89
86
|
},
|
|
90
87
|
value: {
|
|
91
|
-
header: 'Value',
|
|
92
88
|
cell: ({ row }) => `${row.original.value}%`,
|
|
93
89
|
},
|
|
94
90
|
}}
|