@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
|
@@ -2,7 +2,6 @@ import { useAuth } from '@/vdb/hooks/use-auth.js';
|
|
|
2
2
|
import { Link, useNavigate, useRouter } from '@tanstack/react-router';
|
|
3
3
|
import { ChevronsUpDown, LogOut, Monitor, Moon, Sparkles, Sun } from 'lucide-react';
|
|
4
4
|
|
|
5
|
-
// import { Avatar, AvatarFallback, AvatarImage } from '@/vdb/components/ui/avatar.js';
|
|
6
5
|
import {
|
|
7
6
|
DropdownMenu,
|
|
8
7
|
DropdownMenuContent,
|
|
@@ -19,9 +18,10 @@ import {
|
|
|
19
18
|
DropdownMenuTrigger,
|
|
20
19
|
} from '@/vdb/components/ui/dropdown-menu.js';
|
|
21
20
|
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '@/vdb/components/ui/sidebar.js';
|
|
21
|
+
import { useDisplayLocale } from '@/vdb/hooks/use-display-locale.js';
|
|
22
22
|
import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
|
|
23
|
-
import { Trans } from '@/vdb/lib/trans.js';
|
|
24
23
|
import { Theme } from '@/vdb/providers/theme-provider.js';
|
|
24
|
+
import { Trans } from '@lingui/react/macro';
|
|
25
25
|
import { useMemo } from 'react';
|
|
26
26
|
import { Dialog, DialogTrigger } from '../ui/dialog.js';
|
|
27
27
|
import { LanguageDialog } from './language-dialog.js';
|
|
@@ -30,6 +30,7 @@ export function NavUser() {
|
|
|
30
30
|
const { isMobile } = useSidebar();
|
|
31
31
|
const router = useRouter();
|
|
32
32
|
const navigate = useNavigate();
|
|
33
|
+
const { humanReadableLanguage } = useDisplayLocale();
|
|
33
34
|
const { user, ...auth } = useAuth();
|
|
34
35
|
const { settings, setTheme, setDevMode } = useUserSettings();
|
|
35
36
|
|
|
@@ -61,12 +62,6 @@ export function NavUser() {
|
|
|
61
62
|
size="lg"
|
|
62
63
|
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
63
64
|
>
|
|
64
|
-
{/* Avatar component temporarily disabled due to https://github.com/radix-ui/primitives/issues/3489
|
|
65
|
-
error in published package version */}
|
|
66
|
-
{/*<Avatar className="h-8 w-8 rounded-lg">*/}
|
|
67
|
-
{/* <AvatarImage src={user.id} alt={user.firstName} />*/}
|
|
68
|
-
{/* <AvatarFallback className="rounded-lg">{avatarFallback}</AvatarFallback>*/}
|
|
69
|
-
{/*</Avatar>*/}
|
|
70
65
|
<div className="relative flex rounded-lg border justify-center items-center w-8 h-8">
|
|
71
66
|
{avatarFallback}
|
|
72
67
|
</div>
|
|
@@ -87,12 +82,6 @@ export function NavUser() {
|
|
|
87
82
|
>
|
|
88
83
|
<DropdownMenuLabel className="p-0 font-normal">
|
|
89
84
|
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
|
90
|
-
{/*<Avatar className="h-8 w-8 rounded-lg">*/}
|
|
91
|
-
{/* <AvatarImage src={user.id} alt={user.firstName} />*/}
|
|
92
|
-
{/* <AvatarFallback className="rounded-lg">*/}
|
|
93
|
-
{/* {avatarFallback}*/}
|
|
94
|
-
{/* </AvatarFallback>*/}
|
|
95
|
-
{/*</Avatar>*/}
|
|
96
85
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
97
86
|
<span className="truncate font-semibold">
|
|
98
87
|
{user.firstName} {user.lastName}
|
|
@@ -106,20 +95,27 @@ export function NavUser() {
|
|
|
106
95
|
<DropdownMenuItem asChild>
|
|
107
96
|
<a href="https://vendure.io/pricing" target="_blank">
|
|
108
97
|
<Sparkles />
|
|
109
|
-
Explore Enterprise Edition
|
|
98
|
+
<Trans>Explore Enterprise Edition</Trans>
|
|
110
99
|
</a>
|
|
111
100
|
</DropdownMenuItem>
|
|
112
101
|
</DropdownMenuGroup>
|
|
113
102
|
<DropdownMenuSeparator />
|
|
114
103
|
<DropdownMenuGroup>
|
|
115
104
|
<DropdownMenuItem asChild>
|
|
116
|
-
<Link to="/profile">
|
|
105
|
+
<Link to="/profile">
|
|
106
|
+
<Trans>Profile</Trans>
|
|
107
|
+
</Link>
|
|
117
108
|
</DropdownMenuItem>
|
|
118
109
|
<DialogTrigger asChild>
|
|
119
|
-
<DropdownMenuItem>
|
|
110
|
+
<DropdownMenuItem className="flex gap-2">
|
|
111
|
+
<div>
|
|
112
|
+
<Trans>Language</Trans>
|
|
113
|
+
</div>
|
|
114
|
+
<div className="text-muted-foreground">{humanReadableLanguage}</div>
|
|
115
|
+
</DropdownMenuItem>
|
|
120
116
|
</DialogTrigger>
|
|
121
117
|
<DropdownMenuSub>
|
|
122
|
-
<DropdownMenuSubTrigger>Theme</DropdownMenuSubTrigger>
|
|
118
|
+
<DropdownMenuSubTrigger><Trans>Theme</Trans></DropdownMenuSubTrigger>
|
|
123
119
|
<DropdownMenuPortal>
|
|
124
120
|
<DropdownMenuSubContent>
|
|
125
121
|
<DropdownMenuRadioGroup
|
|
@@ -128,15 +124,15 @@ export function NavUser() {
|
|
|
128
124
|
>
|
|
129
125
|
<DropdownMenuRadioItem value="light">
|
|
130
126
|
<Sun />
|
|
131
|
-
Light
|
|
127
|
+
<Trans context='theme'>Light</Trans>
|
|
132
128
|
</DropdownMenuRadioItem>
|
|
133
129
|
<DropdownMenuRadioItem value="dark">
|
|
134
130
|
<Moon />
|
|
135
|
-
Dark
|
|
131
|
+
<Trans context='theme'>Dark</Trans>
|
|
136
132
|
</DropdownMenuRadioItem>
|
|
137
133
|
<DropdownMenuRadioItem value="system">
|
|
138
134
|
<Monitor />
|
|
139
|
-
System
|
|
135
|
+
<Trans context='theme'>System</Trans>
|
|
140
136
|
</DropdownMenuRadioItem>
|
|
141
137
|
</DropdownMenuRadioGroup>
|
|
142
138
|
</DropdownMenuSubContent>
|
|
@@ -145,7 +141,7 @@ export function NavUser() {
|
|
|
145
141
|
</DropdownMenuGroup>
|
|
146
142
|
{isDevMode && (
|
|
147
143
|
<DropdownMenuSub>
|
|
148
|
-
<DropdownMenuSubTrigger>Dev Mode</DropdownMenuSubTrigger>
|
|
144
|
+
<DropdownMenuSubTrigger><Trans>Dev Mode</Trans></DropdownMenuSubTrigger>
|
|
149
145
|
<DropdownMenuPortal>
|
|
150
146
|
<DropdownMenuSubContent>
|
|
151
147
|
<DropdownMenuRadioGroup
|
|
@@ -166,7 +162,7 @@ export function NavUser() {
|
|
|
166
162
|
<DropdownMenuSeparator />
|
|
167
163
|
<DropdownMenuItem onClick={handleLogout}>
|
|
168
164
|
<LogOut />
|
|
169
|
-
Log out
|
|
165
|
+
<Trans>Log out</Trans>
|
|
170
166
|
</DropdownMenuItem>
|
|
171
167
|
</DropdownMenuContent>
|
|
172
168
|
</DropdownMenu>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
2
|
import { Card, CardContent } from '@/vdb/components/ui/card.js';
|
|
3
3
|
import { Input } from '@/vdb/components/ui/input.js';
|
|
4
|
-
import { Trans } from '
|
|
4
|
+
import { Trans } from '@lingui/react/macro';
|
|
5
5
|
import { cn } from '@/vdb/lib/utils.js';
|
|
6
6
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
7
7
|
import { Loader2 } from 'lucide-react';
|
|
@@ -11,7 +11,7 @@ import { getBulkActions } from '@/vdb/framework/data-table/data-table-extensions
|
|
|
11
11
|
import { useFloatingBulkActions } from '@/vdb/hooks/use-floating-bulk-actions.js';
|
|
12
12
|
import { usePageBlock } from '@/vdb/hooks/use-page-block.js';
|
|
13
13
|
import { usePage } from '@/vdb/hooks/use-page.js';
|
|
14
|
-
import { Trans } from '
|
|
14
|
+
import { Trans } from '@lingui/react/macro';
|
|
15
15
|
import { ChevronDown } from 'lucide-react';
|
|
16
16
|
import { Asset } from './asset-gallery.js';
|
|
17
17
|
|
|
@@ -37,7 +37,7 @@ export function AssetBulkActions({ selection, bulkActions, refetch }: Readonly<A
|
|
|
37
37
|
const { pageId } = usePage();
|
|
38
38
|
const pageBlock = usePageBlock();
|
|
39
39
|
const blockId = pageBlock?.blockId;
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
const { position, shouldShow } = useFloatingBulkActions({
|
|
42
42
|
selectionCount: selection.length,
|
|
43
43
|
containerSelector: '[data-asset-gallery]'
|
|
@@ -71,8 +71,8 @@ export function AssetBulkActions({ selection, bulkActions, refetch }: Readonly<A
|
|
|
71
71
|
return (
|
|
72
72
|
<div
|
|
73
73
|
className="flex items-center gap-4 px-8 py-2 animate-in fade-in duration-200 fixed transform -translate-x-1/2 bg-white shadow-2xl rounded-md border z-50"
|
|
74
|
-
style={{
|
|
75
|
-
height: 'auto',
|
|
74
|
+
style={{
|
|
75
|
+
height: 'auto',
|
|
76
76
|
maxHeight: '60px',
|
|
77
77
|
bottom: position.bottom,
|
|
78
78
|
left: position.left
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
|
-
import { Trans } from '
|
|
2
|
+
import { Trans } from '@lingui/react/macro';
|
|
3
3
|
import { cn } from '@/vdb/lib/utils.js';
|
|
4
4
|
import { DndContext, useDraggable } from '@dnd-kit/core';
|
|
5
5
|
import { restrictToParentElement } from '@dnd-kit/modifiers';
|
|
@@ -16,7 +16,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|
|
16
16
|
import { api } from '@/vdb/graphql/api.js';
|
|
17
17
|
import { assetFragment, AssetFragment } from '@/vdb/graphql/fragments.js';
|
|
18
18
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
19
|
-
import { Trans } from '
|
|
19
|
+
import { Trans } from '@lingui/react/macro';
|
|
20
20
|
import { formatFileSize } from '@/vdb/lib/utils.js';
|
|
21
21
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
22
22
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
@@ -153,18 +153,18 @@ export interface AssetGalleryProps {
|
|
|
153
153
|
* @docsWeight 0
|
|
154
154
|
*/
|
|
155
155
|
export function AssetGallery({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}: AssetGalleryProps) {
|
|
156
|
+
onSelect,
|
|
157
|
+
selectable = true,
|
|
158
|
+
multiSelect = undefined,
|
|
159
|
+
initialSelectedAssets = [],
|
|
160
|
+
pageSize = 24,
|
|
161
|
+
fixedHeight = false,
|
|
162
|
+
showHeader = true,
|
|
163
|
+
className = '',
|
|
164
|
+
onFilesDropped,
|
|
165
|
+
bulkActions,
|
|
166
|
+
displayBulkActions = true,
|
|
167
|
+
}: AssetGalleryProps) {
|
|
168
168
|
// State
|
|
169
169
|
const [page, setPage] = useState(1);
|
|
170
170
|
const [search, setSearch] = useState('');
|
|
@@ -380,7 +380,8 @@ export function AssetGallery({
|
|
|
380
380
|
<input {...getInputProps()} />
|
|
381
381
|
|
|
382
382
|
{isDragActive && (
|
|
383
|
-
<div
|
|
383
|
+
<div
|
|
384
|
+
className="absolute inset-0 bg-background/80 backdrop-blur-sm z-10 flex flex-col items-center justify-center rounded-md">
|
|
384
385
|
<Upload className="h-12 w-12 text-primary mb-2" />
|
|
385
386
|
<p className="text-center font-medium">Drop files here to upload</p>
|
|
386
387
|
</div>
|
|
@@ -5,7 +5,7 @@ import { DataTableBulkActionItem } from '@/vdb/components/data-table/data-table-
|
|
|
5
5
|
import { AssignToChannelDialog } from '@/vdb/components/shared/assign-to-channel-dialog.js';
|
|
6
6
|
import { usePaginatedList } from '@/vdb/components/shared/paginated-list-data-table.js';
|
|
7
7
|
import { useChannel } from '@/vdb/hooks/use-channel.js';
|
|
8
|
-
import { Trans } from '
|
|
8
|
+
import { Trans } from '@lingui/react/macro';
|
|
9
9
|
|
|
10
10
|
interface AssignToChannelBulkActionProps {
|
|
11
11
|
selection: any[];
|
|
@@ -23,16 +23,16 @@ interface AssignToChannelBulkActionProps {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function AssignToChannelBulkAction({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}: Readonly<AssignToChannelBulkActionProps>) {
|
|
26
|
+
selection,
|
|
27
|
+
table,
|
|
28
|
+
entityType,
|
|
29
|
+
mutationFn,
|
|
30
|
+
requiredPermissions,
|
|
31
|
+
buildInput,
|
|
32
|
+
additionalFields,
|
|
33
|
+
additionalData = {},
|
|
34
|
+
onSuccess,
|
|
35
|
+
}: Readonly<AssignToChannelBulkActionProps>) {
|
|
36
36
|
const { refetchPaginatedList } = usePaginatedList();
|
|
37
37
|
const { channels } = useChannel();
|
|
38
38
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { Input } from '@/vdb/components/ui/input.js';
|
|
16
16
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/vdb/components/ui/select.js';
|
|
17
17
|
import { ResultOf } from '@/vdb/graphql/graphql.js';
|
|
18
|
-
import { Trans, useLingui } from '
|
|
18
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
19
19
|
|
|
20
20
|
import { useChannel } from '@/vdb/hooks/use-channel.js';
|
|
21
21
|
|
|
@@ -54,9 +54,10 @@ export function AssignToChannelDialog({
|
|
|
54
54
|
additionalFields,
|
|
55
55
|
additionalData = {},
|
|
56
56
|
}: Readonly<AssignToChannelDialogProps>) {
|
|
57
|
-
const {
|
|
57
|
+
const { t } = useLingui();
|
|
58
58
|
const [selectedChannelId, setSelectedChannelId] = useState<string>('');
|
|
59
59
|
const { channels, activeChannel } = useChannel();
|
|
60
|
+
const entityIdsLength = entityIds.length;
|
|
60
61
|
|
|
61
62
|
// Filter out the currently selected channel from available options
|
|
62
63
|
const availableChannels = channels.filter(channel => channel.id !== activeChannel?.id);
|
|
@@ -64,12 +65,12 @@ export function AssignToChannelDialog({
|
|
|
64
65
|
const { mutate, isPending } = useMutation({
|
|
65
66
|
mutationFn,
|
|
66
67
|
onSuccess: () => {
|
|
67
|
-
toast.success(
|
|
68
|
+
toast.success(t`Successfully assigned ${entityIdsLength} ${entityType} to channel`);
|
|
68
69
|
onSuccess?.();
|
|
69
70
|
onOpenChange(false);
|
|
70
71
|
},
|
|
71
72
|
onError: () => {
|
|
72
|
-
toast.error(`Failed to assign ${
|
|
73
|
+
toast.error(`Failed to assign ${entityIdsLength} ${entityType} to channel`);
|
|
73
74
|
},
|
|
74
75
|
});
|
|
75
76
|
|
|
@@ -103,7 +104,7 @@ export function AssignToChannelDialog({
|
|
|
103
104
|
</label>
|
|
104
105
|
<Select value={selectedChannelId} onValueChange={setSelectedChannelId}>
|
|
105
106
|
<SelectTrigger>
|
|
106
|
-
<SelectValue placeholder={
|
|
107
|
+
<SelectValue placeholder={t`Select a channel`} />
|
|
107
108
|
</SelectTrigger>
|
|
108
109
|
<SelectContent>
|
|
109
110
|
{availableChannels.map(channel => (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CHANNEL_CODE } from '@/vdb/constants.js';
|
|
2
|
-
import { Trans } from '
|
|
2
|
+
import { Trans } from '@lingui/react/macro';
|
|
3
3
|
|
|
4
4
|
export function ChannelCodeLabel({ code }: Readonly<{ code: string }> | Readonly<{ code: undefined }>) {
|
|
5
5
|
return code === DEFAULT_CHANNEL_CODE ? <Trans>Default channel</Trans> : code;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { api } from '@/vdb/graphql/api.js';
|
|
2
2
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
3
|
-
import { useLingui } from '
|
|
3
|
+
import { useLingui } from '@lingui/react/macro';
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
5
|
import { ChannelCodeLabel } from './channel-code-label.js';
|
|
6
6
|
import { MultiSelect } from './multi-select.js';
|
|
@@ -24,7 +24,7 @@ export interface ChannelSelectorProps<T extends boolean> {
|
|
|
24
24
|
|
|
25
25
|
export function ChannelSelector<T extends boolean>(props: ChannelSelectorProps<T>) {
|
|
26
26
|
const { value, onChange, multiple } = props;
|
|
27
|
-
const {
|
|
27
|
+
const { t } = useLingui();
|
|
28
28
|
|
|
29
29
|
const { data: channelsData } = useQuery({
|
|
30
30
|
queryKey: ['channels'],
|
|
@@ -44,8 +44,8 @@ export function ChannelSelector<T extends boolean>(props: ChannelSelectorProps<T
|
|
|
44
44
|
onChange={onChange}
|
|
45
45
|
multiple={multiple}
|
|
46
46
|
items={items}
|
|
47
|
-
placeholder={
|
|
48
|
-
searchPlaceholder={
|
|
47
|
+
placeholder={t`Select a channel`}
|
|
48
|
+
searchPlaceholder={t`Search channels...`}
|
|
49
49
|
/>
|
|
50
50
|
);
|
|
51
51
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@/vdb/components/ui/dropdown-menu.js';
|
|
9
9
|
import { api } from '@/vdb/graphql/api.js';
|
|
10
10
|
import { ConfigurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
|
|
11
|
-
import { Trans } from '
|
|
11
|
+
import { Trans } from '@lingui/react/macro';
|
|
12
12
|
import { DefinedInitialDataOptions, useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
13
13
|
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
|
|
14
14
|
import { Plus } from 'lucide-react';
|
|
@@ -94,17 +94,17 @@ type QueryData = {
|
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
96
|
export function ConfigurableOperationMultiSelector({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}: Readonly<ConfigurableOperationMultiSelectorProps>) {
|
|
97
|
+
value,
|
|
98
|
+
onChange,
|
|
99
|
+
queryDocument,
|
|
100
|
+
queryOptions,
|
|
101
|
+
queryKey,
|
|
102
|
+
dataPath,
|
|
103
|
+
buttonText,
|
|
104
|
+
dropdownTitle,
|
|
105
|
+
emptyText = 'No options found',
|
|
106
|
+
showEnhancedDropdown = true,
|
|
107
|
+
}: Readonly<ConfigurableOperationMultiSelectorProps>) {
|
|
108
108
|
const { data } = useQuery<QueryData>(
|
|
109
109
|
queryOptions || {
|
|
110
110
|
queryKey: [queryKey],
|
|
@@ -195,8 +195,10 @@ export function ConfigurableOperationMultiSelector({
|
|
|
195
195
|
onCombinationModeChange(index, newValue)
|
|
196
196
|
}
|
|
197
197
|
name={''}
|
|
198
|
-
ref={() => {
|
|
199
|
-
|
|
198
|
+
ref={() => {
|
|
199
|
+
}}
|
|
200
|
+
onBlur={() => {
|
|
201
|
+
}}
|
|
200
202
|
position={index}
|
|
201
203
|
/>
|
|
202
204
|
</div>
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@/vdb/components/ui/dropdown-menu.js';
|
|
8
8
|
import { api } from '@/vdb/graphql/api.js';
|
|
9
9
|
import { ConfigurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
|
|
10
|
-
import { Trans } from '
|
|
10
|
+
import { Trans } from '@lingui/react/macro';
|
|
11
11
|
import { useQuery } from '@tanstack/react-query';
|
|
12
12
|
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
|
|
13
13
|
import { Plus } from 'lucide-react';
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
AlertDialogTitle,
|
|
10
10
|
AlertDialogTrigger,
|
|
11
11
|
} from '@/vdb/components/ui/alert-dialog.js';
|
|
12
|
-
import { Trans } from '
|
|
12
|
+
import { Trans } from '@lingui/react/macro';
|
|
13
13
|
import { useState } from 'react';
|
|
14
14
|
|
|
15
15
|
export function ConfirmationDialog({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}: {
|
|
16
|
+
title,
|
|
17
|
+
description,
|
|
18
|
+
onConfirm,
|
|
19
|
+
children,
|
|
20
|
+
confirmText,
|
|
21
|
+
cancelText,
|
|
22
|
+
}: {
|
|
23
23
|
title: string;
|
|
24
24
|
description: string;
|
|
25
25
|
onConfirm: () => void;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
10
10
|
import { api } from '@/vdb/graphql/api.js';
|
|
11
11
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
12
|
-
import { Trans } from '
|
|
12
|
+
import { Trans } from '@lingui/react/macro';
|
|
13
13
|
import { useQuery } from '@tanstack/react-query';
|
|
14
14
|
import { Plus, Search } from 'lucide-react';
|
|
15
15
|
import { useState } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CurrencyCode } from '@/vdb/constants.js';
|
|
2
2
|
import { useLocalFormat } from '@/vdb/hooks/use-local-format.js';
|
|
3
|
-
import { useLingui } from '
|
|
3
|
+
import { useLingui } from '@lingui/react/macro';
|
|
4
4
|
import { MultiSelect } from './multi-select.js';
|
|
5
5
|
|
|
6
6
|
export interface CurrencySelectorProps<T extends boolean> {
|
|
@@ -13,7 +13,7 @@ export interface CurrencySelectorProps<T extends boolean> {
|
|
|
13
13
|
export function CurrencySelector<T extends boolean>(props: CurrencySelectorProps<T>) {
|
|
14
14
|
const { formatCurrencyName } = useLocalFormat();
|
|
15
15
|
const { value, onChange, multiple, availableCurrencyCodes } = props;
|
|
16
|
-
const {
|
|
16
|
+
const { t } = useLingui();
|
|
17
17
|
|
|
18
18
|
const items = (availableCurrencyCodes ?? Object.values(CurrencyCode)).map(currencyCode => ({
|
|
19
19
|
value: currencyCode,
|
|
@@ -26,8 +26,8 @@ export function CurrencySelector<T extends boolean>(props: CurrencySelectorProps
|
|
|
26
26
|
onChange={onChange}
|
|
27
27
|
multiple={multiple}
|
|
28
28
|
items={items}
|
|
29
|
-
placeholder={
|
|
30
|
-
searchPlaceholder={
|
|
29
|
+
placeholder={t`Select a currency`}
|
|
30
|
+
searchPlaceholder={t`Search currencies...`}
|
|
31
31
|
/>
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -12,8 +12,8 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/vdb/components/ui/ta
|
|
|
12
12
|
import { CustomFormComponent } from '@/vdb/framework/form-engine/custom-form-component.js';
|
|
13
13
|
import { useCustomFieldConfig } from '@/vdb/hooks/use-custom-field-config.js';
|
|
14
14
|
import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
|
|
15
|
-
import { useLingui } from '@/vdb/lib/trans.js';
|
|
16
15
|
import { customFieldConfigFragment } from '@/vdb/providers/server-config.js';
|
|
16
|
+
import { useLingui } from '@lingui/react/macro';
|
|
17
17
|
import { ResultOf } from 'gql.tada';
|
|
18
18
|
import React, { useMemo } from 'react';
|
|
19
19
|
import { Control } from 'react-hook-form';
|
|
@@ -29,7 +29,7 @@ interface CustomFieldsFormProps {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export function CustomFieldsForm({ entityType, control, formPathPrefix }: Readonly<CustomFieldsFormProps>) {
|
|
32
|
-
const {
|
|
32
|
+
const { t } = useLingui();
|
|
33
33
|
const customFields = useCustomFieldConfig(entityType);
|
|
34
34
|
|
|
35
35
|
const getCustomFieldBaseName = (fieldDef: CustomFieldConfig) => {
|
|
@@ -97,7 +97,7 @@ export function CustomFieldsForm({ entityType, control, formPathPrefix }: Readon
|
|
|
97
97
|
<TabsList>
|
|
98
98
|
{groupedFields.map(group => (
|
|
99
99
|
<TabsTrigger key={group.tabName} value={group.tabName}>
|
|
100
|
-
{group.tabName === 'general' ?
|
|
100
|
+
{group.tabName === 'general' ? t`General` : group.tabName}
|
|
101
101
|
</TabsTrigger>
|
|
102
102
|
))}
|
|
103
103
|
</TabsList>
|
|
@@ -151,10 +151,7 @@ function CustomFieldItem({ fieldDef, control, fieldName }: Readonly<CustomFieldI
|
|
|
151
151
|
<FormLabel>{getTranslation(fieldDef.label) ?? field.name}</FormLabel>
|
|
152
152
|
<FormControl>
|
|
153
153
|
{hasCustomFormComponent ? (
|
|
154
|
-
<CustomFormComponent
|
|
155
|
-
fieldDef={fieldDef}
|
|
156
|
-
{...field}
|
|
157
|
-
/>
|
|
154
|
+
<CustomFormComponent fieldDef={fieldDef} {...field} />
|
|
158
155
|
) : (
|
|
159
156
|
<FormControlAdapter
|
|
160
157
|
fieldDef={fieldDef}
|
|
@@ -185,10 +182,7 @@ function CustomFieldItem({ fieldDef, control, fieldName }: Readonly<CustomFieldI
|
|
|
185
182
|
getTranslation={getTranslation}
|
|
186
183
|
fieldName={fieldProps.field.name}
|
|
187
184
|
>
|
|
188
|
-
<CustomFormComponent
|
|
189
|
-
fieldDef={fieldDef}
|
|
190
|
-
{...fieldProps.field}
|
|
191
|
-
/>
|
|
185
|
+
<CustomFormComponent fieldDef={fieldDef} {...fieldProps.field} />
|
|
192
186
|
</CustomFieldFormItem>
|
|
193
187
|
)}
|
|
194
188
|
/>
|
|
@@ -215,10 +209,7 @@ function CustomFieldItem({ fieldDef, control, fieldName }: Readonly<CustomFieldI
|
|
|
215
209
|
{...field}
|
|
216
210
|
disabled={isReadonly}
|
|
217
211
|
renderInput={(index, inputField) => (
|
|
218
|
-
<StructFormInput
|
|
219
|
-
{...inputField}
|
|
220
|
-
fieldDef={fieldDef}
|
|
221
|
-
/>
|
|
212
|
+
<StructFormInput {...inputField} fieldDef={fieldDef} />
|
|
222
213
|
)}
|
|
223
214
|
defaultValue={{}} // Empty struct object as default
|
|
224
215
|
isFullWidth={true} // Structs should always be full-width
|
|
@@ -243,10 +234,7 @@ function CustomFieldItem({ fieldDef, control, fieldName }: Readonly<CustomFieldI
|
|
|
243
234
|
<FormItem>
|
|
244
235
|
<FormLabel>{getTranslation(fieldDef.label) ?? fieldDef.name}</FormLabel>
|
|
245
236
|
<FormControl>
|
|
246
|
-
<StructFormInput
|
|
247
|
-
{...field}
|
|
248
|
-
fieldDef={fieldDef}
|
|
249
|
-
/>
|
|
237
|
+
<StructFormInput {...field} fieldDef={fieldDef} />
|
|
250
238
|
</FormControl>
|
|
251
239
|
<FormDescription>{getTranslation(fieldDef.description)}</FormDescription>
|
|
252
240
|
<FormMessage />
|
|
@@ -269,11 +257,7 @@ function CustomFieldItem({ fieldDef, control, fieldName }: Readonly<CustomFieldI
|
|
|
269
257
|
getTranslation={getTranslation}
|
|
270
258
|
fieldName={fieldDef.name}
|
|
271
259
|
>
|
|
272
|
-
<FormControlAdapter
|
|
273
|
-
fieldDef={fieldDef}
|
|
274
|
-
field={field}
|
|
275
|
-
valueMode="native"
|
|
276
|
-
/>
|
|
260
|
+
<FormControlAdapter fieldDef={fieldDef} field={field} valueMode="native" />
|
|
277
261
|
</CustomFieldFormItem>
|
|
278
262
|
)}
|
|
279
263
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api } from '@/vdb/graphql/api.js';
|
|
2
2
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
3
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
4
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
5
5
|
import { useQuery } from '@tanstack/react-query';
|
|
6
6
|
import { useForm } from 'react-hook-form';
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -64,7 +64,7 @@ export function CustomerAddressForm<T>({
|
|
|
64
64
|
onSubmit,
|
|
65
65
|
onCancel,
|
|
66
66
|
}: CustomerAddressFormProps<T>) {
|
|
67
|
-
const {
|
|
67
|
+
const { t } = useLingui();
|
|
68
68
|
|
|
69
69
|
// Fetch available countries
|
|
70
70
|
const { data: countriesData, isLoading: isLoadingCountries } = useQuery({
|
|
@@ -237,7 +237,7 @@ export function CustomerAddressForm<T>({
|
|
|
237
237
|
>
|
|
238
238
|
<FormControl>
|
|
239
239
|
<SelectTrigger>
|
|
240
|
-
<SelectValue placeholder={
|
|
240
|
+
<SelectValue placeholder={t`Select a country`} />
|
|
241
241
|
</SelectTrigger>
|
|
242
242
|
</FormControl>
|
|
243
243
|
<SelectContent>
|
|
@@ -3,7 +3,7 @@ import { Command, CommandItem, CommandList } from '@/vdb/components/ui/command.j
|
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
4
4
|
import { api } from '@/vdb/graphql/api.js';
|
|
5
5
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
6
|
-
import { Trans } from '
|
|
6
|
+
import { Trans } from '@lingui/react/macro';
|
|
7
7
|
import { useQuery } from '@tanstack/react-query';
|
|
8
8
|
import { Plus } from 'lucide-react';
|
|
9
9
|
import { useState } from 'react';
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
10
10
|
import { api } from '@/vdb/graphql/api.js';
|
|
11
11
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
12
|
-
import { Trans } from '
|
|
12
|
+
import { Trans } from '@lingui/react/macro';
|
|
13
13
|
import { useQuery } from '@tanstack/react-query';
|
|
14
14
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
15
15
|
import { Plus } from 'lucide-react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Page, PageBlock, PageLayout, PageTitle } from '@/vdb/framework/layout-engine/page-layout.js';
|
|
2
|
-
import { Trans } from '
|
|
2
|
+
import { Trans } from '@lingui/react/macro';
|
|
3
3
|
import { AlertCircle } from 'lucide-react';
|
|
4
4
|
import { Alert, AlertDescription, AlertTitle } from '../ui/alert.js';
|
|
5
5
|
|