@vendure/dashboard 3.3.6-master-202507020959 → 3.3.6-master-202507030234
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 +41 -4
- package/dist/plugin/vite-plugin-config.js +5 -7
- package/package.json +4 -4
- package/src/app/app-providers.tsx +6 -6
- package/src/app/common/delete-bulk-action.tsx +4 -4
- package/src/app/common/duplicate-bulk-action.tsx +5 -5
- package/src/app/main.tsx +9 -9
- package/src/app/routes/__root.tsx +1 -2
- package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -8
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +16 -16
- package/src/app/routes/_authenticated/_assets/assets.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_assets/assets.tsx +12 -8
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_channels/channels.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_channels/channels.tsx +10 -10
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +16 -16
- package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +3 -3
- package/src/app/routes/_authenticated/_collections/collections.tsx +7 -7
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +15 -15
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +4 -5
- package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +7 -8
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +9 -5
- package/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx +10 -9
- package/src/app/routes/_authenticated/_collections/components/collection-filters-selector.tsx +7 -7
- package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_countries/countries.tsx +6 -6
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +12 -5
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +22 -17
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +6 -6
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +10 -10
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +19 -19
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +10 -10
- package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +5 -5
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history.tsx +11 -7
- package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +4 -4
- package/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx +75 -73
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +4 -4
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customers/customers.tsx +6 -6
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +9 -9
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +6 -7
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +15 -11
- package/src/app/routes/_authenticated/_facets/facets.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_facets/facets.tsx +7 -7
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_global-settings/global-settings.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +12 -12
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +11 -14
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +92 -54
- package/src/app/routes/_authenticated/_orders/components/money-gross-net.tsx +11 -9
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +3 -4
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +67 -62
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +11 -6
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +11 -7
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +39 -19
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +38 -36
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +43 -44
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_orders/orders.tsx +21 -20
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +9 -9
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +188 -90
- package/src/app/routes/_authenticated/_payment-methods/components/payment-eligibility-checker-selector.tsx +10 -7
- package/src/app/routes/_authenticated/_payment-methods/components/payment-handler-selector.tsx +11 -11
- package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +4 -5
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +7 -7
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +13 -13
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +7 -8
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +7 -6
- package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +6 -6
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +19 -19
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +10 -10
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +7 -7
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +57 -41
- package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +11 -11
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +18 -14
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +21 -15
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +7 -8
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +28 -34
- package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +6 -6
- package/src/app/routes/_authenticated/_products/products.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_products/products.tsx +6 -6
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +16 -16
- package/src/app/routes/_authenticated/_profile/profile.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_profile/profile.tsx +8 -8
- package/src/app/routes/_authenticated/_promotions/components/promotion-actions-selector.tsx +14 -11
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +4 -5
- package/src/app/routes/_authenticated/_promotions/components/promotion-conditions-selector.tsx +14 -11
- package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +7 -7
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_roles/components/expandable-permissions.tsx +5 -5
- package/src/app/routes/_authenticated/_roles/components/permissions-grid.tsx +21 -17
- package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/roles.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_roles/roles.tsx +10 -10
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +7 -7
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +10 -10
- package/src/app/routes/_authenticated/_shipping-methods/components/fulfillment-handler-selector.tsx +6 -6
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-calculator-selector.tsx +23 -21
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-eligibility-checker-selector.tsx +25 -21
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +4 -5
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-method-dialog.tsx +3 -3
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +6 -6
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +4 -5
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +6 -6
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_system/components/payload-dialog.tsx +4 -4
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +4 -4
- package/src/app/routes/_authenticated/_system/job-queue.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_system/job-queue.tsx +10 -6
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +34 -28
- package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +7 -7
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -8
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_zones/components/zone-countries-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +12 -8
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_zones/zones.tsx +6 -6
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +10 -10
- package/src/app/routes/_authenticated/index.tsx +4 -4
- package/src/app/routes/_authenticated.tsx +3 -3
- package/src/app/routes/login.tsx +2 -2
- package/src/lib/components/data-display/boolean.tsx +1 -1
- package/src/lib/components/data-display/date-time.tsx +2 -2
- package/src/lib/components/data-display/json.tsx +1 -1
- package/src/lib/components/data-display/money.tsx +2 -3
- package/src/lib/components/data-input/affixed-input.tsx +3 -8
- package/src/lib/components/data-input/customer-group-input.tsx +2 -2
- package/src/lib/components/data-input/datetime-input.tsx +129 -146
- package/src/lib/components/data-input/facet-value-input.tsx +30 -22
- package/src/lib/components/data-input/money-input.tsx +3 -3
- package/src/lib/components/data-input/richt-text-input.tsx +1 -1
- package/src/lib/components/data-table/add-filter-menu.tsx +9 -18
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +3 -3
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +7 -7
- package/src/lib/components/data-table/data-table-column-header.tsx +4 -22
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +8 -8
- package/src/lib/components/data-table/data-table-filter-badge.tsx +1 -1
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +4 -4
- package/src/lib/components/data-table/data-table-pagination.tsx +2 -2
- package/src/lib/components/data-table/data-table-view-options.tsx +25 -21
- package/src/lib/components/data-table/data-table.tsx +8 -8
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +11 -8
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +14 -23
- package/src/lib/components/data-table/filters/data-table-id-filter.tsx +15 -10
- package/src/lib/components/data-table/filters/data-table-number-filter.tsx +18 -17
- package/src/lib/components/data-table/filters/data-table-string-filter.tsx +29 -12
- package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
- package/src/lib/components/data-table/refresh-button.tsx +5 -2
- package/src/lib/components/layout/app-layout.tsx +8 -8
- package/src/lib/components/layout/app-sidebar.tsx +5 -5
- package/src/lib/components/layout/channel-switcher.tsx +8 -8
- package/src/lib/components/layout/content-language-selector.tsx +16 -10
- package/src/lib/components/layout/generated-breadcrumbs.tsx +1 -1
- package/src/lib/components/layout/language-dialog.tsx +5 -11
- package/src/lib/components/layout/nav-main.tsx +4 -4
- package/src/lib/components/layout/nav-projects.tsx +2 -2
- package/src/lib/components/layout/nav-user.tsx +7 -7
- package/src/lib/components/layout/prerelease-popup.tsx +1 -1
- package/src/lib/components/login/login-form.tsx +5 -5
- package/src/lib/components/shared/alerts.tsx +3 -3
- package/src/lib/components/shared/animated-number.tsx +2 -2
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +12 -8
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +29 -19
- package/src/lib/components/shared/asset/asset-gallery.tsx +12 -12
- package/src/lib/components/shared/asset/asset-picker-dialog.tsx +63 -66
- package/src/lib/components/shared/asset/asset-preview-dialog.tsx +3 -7
- package/src/lib/components/shared/asset/asset-preview-selector.tsx +4 -6
- package/src/lib/components/shared/asset/asset-preview.tsx +7 -15
- package/src/lib/components/shared/asset/asset-properties.tsx +7 -9
- package/src/lib/components/shared/asset/focal-point-control.tsx +5 -13
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +4 -4
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +8 -8
- package/src/lib/components/shared/channel-code-label.tsx +3 -4
- package/src/lib/components/shared/channel-selector.tsx +6 -6
- package/src/lib/components/shared/configurable-operation-arg-input.tsx +2 -2
- package/src/lib/components/shared/configurable-operation-input.tsx +15 -16
- package/src/lib/components/shared/confirmation-dialog.tsx +2 -2
- package/src/lib/components/shared/copyable-text.tsx +2 -3
- package/src/lib/components/shared/country-selector.tsx +21 -18
- package/src/lib/components/shared/currency-selector.tsx +5 -5
- package/src/lib/components/shared/custom-fields-form.tsx +9 -9
- package/src/lib/components/shared/customer-address-form.tsx +3 -3
- package/src/lib/components/shared/customer-group-selector.tsx +6 -6
- package/src/lib/components/shared/customer-selector.tsx +24 -18
- package/src/lib/components/shared/entity-assets.tsx +33 -34
- package/src/lib/components/shared/error-page.tsx +6 -6
- package/src/lib/components/shared/facet-value-chip.tsx +12 -5
- package/src/lib/components/shared/facet-value-selector.tsx +64 -63
- package/src/lib/components/shared/history-timeline/history-entry.tsx +12 -6
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +3 -3
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +4 -4
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +3 -3
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +15 -8
- package/src/lib/components/shared/language-selector.tsx +5 -5
- package/src/lib/components/shared/multi-select.tsx +5 -5
- package/src/lib/components/shared/navigation-confirmation.tsx +24 -9
- package/src/lib/components/shared/option-value-input.tsx +17 -15
- package/src/lib/components/shared/paginated-list-data-table.tsx +12 -12
- package/src/lib/components/shared/permission-guard.tsx +4 -4
- package/src/lib/components/shared/product-variant-selector.tsx +32 -31
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +4 -4
- package/src/lib/components/shared/role-code-label.tsx +10 -6
- package/src/lib/components/shared/role-selector.tsx +4 -4
- package/src/lib/components/shared/seller-selector.tsx +21 -17
- package/src/lib/components/shared/stock-level-label.tsx +5 -5
- package/src/lib/components/shared/tax-category-selector.tsx +5 -5
- package/src/lib/components/shared/translatable-form-field.tsx +1 -1
- package/src/lib/components/shared/vendure-image.tsx +1 -1
- package/src/lib/components/shared/zone-selector.tsx +5 -6
- package/src/lib/components/ui/accordion.tsx +3 -3
- package/src/lib/components/ui/alert-dialog.tsx +10 -10
- package/src/lib/components/ui/alert.tsx +3 -3
- package/src/lib/components/ui/badge.tsx +2 -2
- package/src/lib/components/ui/breadcrumb.tsx +4 -4
- package/src/lib/components/ui/button.tsx +10 -3
- package/src/lib/components/ui/calendar.tsx +392 -459
- package/src/lib/components/ui/card.tsx +2 -2
- package/src/lib/components/ui/checkbox.tsx +2 -2
- package/src/lib/components/ui/command.tsx +12 -6
- package/src/lib/components/ui/dialog.tsx +2 -2
- package/src/lib/components/ui/dropdown-menu.tsx +7 -7
- package/src/lib/components/ui/form.tsx +4 -4
- package/src/lib/components/ui/hover-card.tsx +3 -3
- package/src/lib/components/ui/input.tsx +1 -1
- package/src/lib/components/ui/label.tsx +2 -2
- package/src/lib/components/ui/pagination.tsx +87 -108
- package/src/lib/components/ui/popover.tsx +3 -3
- package/src/lib/components/ui/scroll-area.tsx +2 -2
- package/src/lib/components/ui/select.tsx +2 -2
- package/src/lib/components/ui/separator.tsx +2 -2
- package/src/lib/components/ui/sheet.tsx +5 -5
- package/src/lib/components/ui/sidebar.tsx +10 -10
- package/src/lib/components/ui/skeleton.tsx +1 -1
- package/src/lib/components/ui/switch.tsx +2 -2
- package/src/lib/components/ui/table.tsx +2 -2
- package/src/lib/components/ui/tabs.tsx +3 -3
- package/src/lib/components/ui/textarea.tsx +1 -1
- package/src/lib/components/ui/tooltip.tsx +3 -3
- package/src/lib/framework/alert/alert-extensions.tsx +2 -3
- package/src/lib/framework/alert/alert-item.tsx +5 -3
- package/src/lib/framework/dashboard-widget/base-widget.tsx +5 -13
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +7 -8
- package/src/lib/framework/dashboard-widget/latest-orders-widget/latest-orders-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +6 -7
- package/src/lib/framework/dashboard-widget/metrics-widget/metrics-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +6 -6
- package/src/lib/framework/dashboard-widget/orders-summary/order-summary-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/widget-extensions.tsx +1 -1
- package/src/lib/framework/data-table/data-table-extensions.ts +1 -1
- package/src/lib/framework/defaults.ts +1 -1
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +2 -2
- package/src/lib/framework/document-extension/extend-document.spec.ts +1 -1
- package/src/lib/framework/document-extension/extend-document.ts +1 -1
- package/src/lib/framework/document-introspection/add-custom-fields.ts +2 -2
- package/src/lib/framework/document-introspection/hooks.ts +4 -1
- package/src/lib/framework/extension-api/display-component-extensions.tsx +4 -4
- package/src/lib/framework/extension-api/extension-api-types.ts +0 -3
- package/src/lib/framework/extension-api/input-component-extensions.tsx +5 -5
- package/src/lib/framework/extension-api/logic/detail-forms.ts +1 -1
- package/src/lib/framework/extension-api/types/data-table.ts +25 -2
- package/src/lib/framework/extension-api/types/detail-forms.ts +1 -1
- package/src/lib/framework/extension-api/types/widgets.ts +7 -4
- package/src/lib/framework/form-engine/form-schema-tools.ts +1 -1
- package/src/lib/framework/layout-engine/location-wrapper.tsx +11 -8
- package/src/lib/framework/layout-engine/page-block-provider.tsx +1 -1
- package/src/lib/framework/layout-engine/page-layout.tsx +26 -19
- package/src/lib/framework/page/detail-page-route-loader.tsx +3 -3
- package/src/lib/framework/page/detail-page.tsx +9 -9
- package/src/lib/framework/page/list-page.tsx +3 -3
- package/src/lib/framework/page/use-detail-page.ts +1 -1
- package/src/lib/framework/registry/registry-types.ts +7 -7
- package/src/lib/hooks/use-auth.tsx +1 -1
- package/src/lib/hooks/use-channel.ts +1 -2
- package/src/lib/hooks/use-extended-detail-query.ts +2 -3
- package/src/lib/hooks/use-extended-list-query.ts +3 -4
- package/src/lib/hooks/use-grouped-permissions.ts +1 -2
- package/src/lib/hooks/use-page-block.tsx +1 -1
- package/src/lib/hooks/use-page.tsx +1 -1
- package/src/lib/hooks/use-server-config.ts +1 -2
- package/src/lib/hooks/use-theme.ts +1 -2
- package/src/lib/hooks/use-user-settings.tsx +1 -1
- package/src/lib/index.ts +26 -6
- package/src/lib/lib/trans.tsx +3 -3
- package/src/lib/providers/auth.tsx +4 -4
- package/src/lib/providers/channel-provider.tsx +4 -4
- package/src/lib/providers/server-config.tsx +13 -11
- package/src/lib/providers/theme-provider.tsx +2 -3
- package/vite/vite-plugin-config.ts +5 -7
- package/src/lib/framework/alert/types.ts +0 -13
- package/src/lib/framework/dashboard-widget/types.ts +0 -22
- package/src/lib/framework/data-table/data-table-types.ts +0 -25
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ProductVariantSelector } from '@/components/shared/product-variant-selector.js';
|
|
2
|
-
import { VendureImage } from '@/components/shared/vendure-image.js';
|
|
3
|
-
import { Button } from '@/components/ui/button.js';
|
|
4
|
-
import { Input } from '@/components/ui/input.js';
|
|
5
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table.js';
|
|
6
|
-
import { ResultOf } from '@/graphql/graphql.js';
|
|
7
|
-
import { Trans } from '@/lib/trans.js';
|
|
1
|
+
import { ProductVariantSelector } from '@/vdb/components/shared/product-variant-selector.js';
|
|
2
|
+
import { VendureImage } from '@/vdb/components/shared/vendure-image.js';
|
|
3
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
4
|
+
import { Input } from '@/vdb/components/ui/input.js';
|
|
5
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/vdb/components/ui/table.js';
|
|
6
|
+
import { ResultOf } from '@/vdb/graphql/graphql.js';
|
|
7
|
+
import { Trans } from '@/vdb/lib/trans.js';
|
|
8
8
|
import {
|
|
9
9
|
ColumnDef,
|
|
10
10
|
flexRender,
|
|
@@ -14,22 +14,28 @@ import {
|
|
|
14
14
|
} from '@tanstack/react-table';
|
|
15
15
|
import { Trash2 } from 'lucide-react';
|
|
16
16
|
import { useState } from 'react';
|
|
17
|
-
import {
|
|
17
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
18
|
+
import {
|
|
19
|
+
draftOrderEligibleShippingMethodsDocument,
|
|
20
|
+
orderDetailDocument,
|
|
21
|
+
orderLineFragment,
|
|
22
|
+
} from '../orders.graphql.js';
|
|
18
23
|
import { MoneyGrossNet } from './money-gross-net.js';
|
|
24
|
+
import { OrderLineCustomFieldsForm } from './order-line-custom-fields-form.js';
|
|
19
25
|
import { OrderTableTotals } from './order-table-totals.js';
|
|
20
26
|
import { ShippingMethodSelector } from './shipping-method-selector.js';
|
|
21
|
-
import { OrderLineCustomFieldsForm } from './order-line-custom-fields-form.js';
|
|
22
|
-
import { UseFormReturn } from 'react-hook-form';
|
|
23
27
|
|
|
24
28
|
type OrderFragment = NonNullable<ResultOf<typeof orderDetailDocument>['order']>;
|
|
25
29
|
type OrderLineFragment = ResultOf<typeof orderLineFragment>;
|
|
26
30
|
|
|
27
|
-
type ShippingMethodQuote = ResultOf<
|
|
31
|
+
type ShippingMethodQuote = ResultOf<
|
|
32
|
+
typeof draftOrderEligibleShippingMethodsDocument
|
|
33
|
+
>['eligibleShippingMethodsForDraftOrder'][number];
|
|
28
34
|
|
|
29
35
|
export interface OrderTableProps {
|
|
30
36
|
order: OrderFragment;
|
|
31
37
|
eligibleShippingMethods: ShippingMethodQuote[];
|
|
32
|
-
onAddItem: (event: { productVariantId: string
|
|
38
|
+
onAddItem: (event: { productVariantId: string }) => void;
|
|
33
39
|
onAdjustLine: (event: { lineId: string; quantity: number; customFields: Record<string, any> }) => void;
|
|
34
40
|
onRemoveLine: (event: { lineId: string }) => void;
|
|
35
41
|
onSetShippingMethod: (event: { shippingMethodId: string }) => void;
|
|
@@ -38,9 +44,17 @@ export interface OrderTableProps {
|
|
|
38
44
|
orderLineForm: UseFormReturn<any>;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
export function EditOrderTable({
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
export function EditOrderTable({
|
|
48
|
+
order,
|
|
49
|
+
eligibleShippingMethods,
|
|
50
|
+
onAddItem,
|
|
51
|
+
onAdjustLine,
|
|
52
|
+
onRemoveLine,
|
|
53
|
+
onSetShippingMethod,
|
|
54
|
+
onApplyCouponCode,
|
|
55
|
+
onRemoveCouponCode,
|
|
56
|
+
orderLineForm,
|
|
57
|
+
}: OrderTableProps) {
|
|
44
58
|
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});
|
|
45
59
|
const [couponCode, setCouponCode] = useState('');
|
|
46
60
|
|
|
@@ -67,30 +81,50 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
67
81
|
header: 'Unit price',
|
|
68
82
|
accessorKey: 'unitPriceWithTax',
|
|
69
83
|
cell: ({ row }) => {
|
|
70
|
-
const value = row.original.unitPriceWithTax
|
|
84
|
+
const value = row.original.unitPriceWithTax;
|
|
71
85
|
const netValue = row.original.unitPrice;
|
|
72
|
-
return <MoneyGrossNet priceWithTax={value} price={netValue} currencyCode={currencyCode}
|
|
86
|
+
return <MoneyGrossNet priceWithTax={value} price={netValue} currencyCode={currencyCode} />;
|
|
73
87
|
},
|
|
74
88
|
},
|
|
75
89
|
{
|
|
76
90
|
header: 'Quantity',
|
|
77
91
|
accessorKey: 'quantity',
|
|
78
92
|
cell: ({ row }) => {
|
|
79
|
-
return
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
return (
|
|
94
|
+
<div className="flex gap-2">
|
|
95
|
+
<Input
|
|
96
|
+
type="number"
|
|
97
|
+
value={row.original.quantity}
|
|
98
|
+
onChange={e =>
|
|
99
|
+
onAdjustLine({
|
|
100
|
+
lineId: row.original.id,
|
|
101
|
+
quantity: e.target.valueAsNumber,
|
|
102
|
+
customFields: row.original.customFields,
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
<Button
|
|
107
|
+
variant="outline"
|
|
108
|
+
type="button"
|
|
109
|
+
size="icon"
|
|
110
|
+
onClick={() => onRemoveLine({ lineId: row.original.id })}
|
|
111
|
+
>
|
|
112
|
+
<Trash2 />
|
|
113
|
+
</Button>
|
|
114
|
+
{row.original.customFields && (
|
|
115
|
+
<OrderLineCustomFieldsForm
|
|
116
|
+
onUpdate={customFields => {
|
|
117
|
+
onAdjustLine({
|
|
118
|
+
lineId: row.original.id,
|
|
119
|
+
quantity: row.original.quantity,
|
|
120
|
+
customFields: customFields,
|
|
121
|
+
});
|
|
122
|
+
}}
|
|
123
|
+
form={orderLineForm}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
94
128
|
},
|
|
95
129
|
},
|
|
96
130
|
{
|
|
@@ -130,9 +164,9 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
130
164
|
{header.isPlaceholder
|
|
131
165
|
? null
|
|
132
166
|
: flexRender(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
167
|
+
header.column.columnDef.header,
|
|
168
|
+
header.getContext(),
|
|
169
|
+
)}
|
|
136
170
|
</TableHead>
|
|
137
171
|
);
|
|
138
172
|
})}
|
|
@@ -140,24 +174,26 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
140
174
|
))}
|
|
141
175
|
</TableHeader>
|
|
142
176
|
<TableBody>
|
|
143
|
-
{table.getRowModel().rows?.length
|
|
144
|
-
table.getRowModel().rows.map(row => (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
177
|
+
{table.getRowModel().rows?.length
|
|
178
|
+
? table.getRowModel().rows.map(row => (
|
|
179
|
+
<TableRow key={row.id} data-state={row.getIsSelected() && 'selected'}>
|
|
180
|
+
{row.getVisibleCells().map(cell => (
|
|
181
|
+
<TableCell key={cell.id}>
|
|
182
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
183
|
+
</TableCell>
|
|
184
|
+
))}
|
|
185
|
+
</TableRow>
|
|
186
|
+
))
|
|
187
|
+
: null}
|
|
154
188
|
<TableRow>
|
|
155
189
|
<TableCell colSpan={columns.length} className="h-12">
|
|
156
190
|
<div className="my-4 flex justify-center">
|
|
157
191
|
<div className="max-w-lg">
|
|
158
|
-
<ProductVariantSelector
|
|
159
|
-
|
|
160
|
-
|
|
192
|
+
<ProductVariantSelector
|
|
193
|
+
onProductVariantIdChange={variantId => {
|
|
194
|
+
onAddItem({ productVariantId: variantId });
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
161
197
|
</div>
|
|
162
198
|
</div>
|
|
163
199
|
</TableCell>
|
|
@@ -168,7 +204,7 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
168
204
|
eligibleShippingMethods={eligibleShippingMethods}
|
|
169
205
|
selectedShippingMethodId={order.shippingLines?.[0]?.shippingMethod?.id}
|
|
170
206
|
currencyCode={currencyCode}
|
|
171
|
-
onSelect={
|
|
207
|
+
onSelect={shippingMethodId => onSetShippingMethod({ shippingMethodId })}
|
|
172
208
|
/>
|
|
173
209
|
</TableCell>
|
|
174
210
|
</TableRow>
|
|
@@ -180,8 +216,8 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
180
216
|
type="text"
|
|
181
217
|
placeholder="Coupon code"
|
|
182
218
|
value={couponCode}
|
|
183
|
-
onChange={
|
|
184
|
-
onKeyDown={
|
|
219
|
+
onChange={e => setCouponCode(e.target.value)}
|
|
220
|
+
onKeyDown={e => {
|
|
185
221
|
if (e.key === 'Enter') {
|
|
186
222
|
onApplyCouponCode({ couponCode });
|
|
187
223
|
}
|
|
@@ -197,7 +233,7 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
197
233
|
</div>
|
|
198
234
|
{order.couponCodes?.length > 0 && (
|
|
199
235
|
<div className="flex flex-wrap gap-2">
|
|
200
|
-
{order.couponCodes.map(
|
|
236
|
+
{order.couponCodes.map(code => (
|
|
201
237
|
<div
|
|
202
238
|
key={code}
|
|
203
239
|
className="flex items-center gap-2 px-3 py-1 text-sm border rounded-md"
|
|
@@ -208,7 +244,9 @@ export function EditOrderTable({ order, eligibleShippingMethods, onAddItem, onAd
|
|
|
208
244
|
variant="ghost"
|
|
209
245
|
size="sm"
|
|
210
246
|
className="h-6 w-6 p-0"
|
|
211
|
-
onClick={() =>
|
|
247
|
+
onClick={() =>
|
|
248
|
+
onRemoveCouponCode({ couponCode: code })
|
|
249
|
+
}
|
|
212
250
|
>
|
|
213
251
|
<Trash2 className="h-4 w-4" />
|
|
214
252
|
</Button>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Money } from
|
|
1
|
+
import { Money } from '@/vdb/components/data-display/money.js';
|
|
2
2
|
|
|
3
3
|
export interface MoneyGrossNetProps {
|
|
4
4
|
priceWithTax: number;
|
|
@@ -6,13 +6,15 @@ export interface MoneyGrossNetProps {
|
|
|
6
6
|
currencyCode: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function MoneyGrossNet({ priceWithTax, price, currencyCode }: MoneyGrossNetProps) {
|
|
10
|
-
return
|
|
11
|
-
<div>
|
|
12
|
-
<
|
|
9
|
+
export function MoneyGrossNet({ priceWithTax, price, currencyCode }: Readonly<MoneyGrossNetProps>) {
|
|
10
|
+
return (
|
|
11
|
+
<div className="flex flex-col gap-1">
|
|
12
|
+
<div>
|
|
13
|
+
<Money value={priceWithTax} currencyCode={currencyCode} />
|
|
14
|
+
</div>
|
|
15
|
+
<div className="text-xs text-muted-foreground">
|
|
16
|
+
<Money value={price} currencyCode={currencyCode} />
|
|
17
|
+
</div>
|
|
13
18
|
</div>
|
|
14
|
-
|
|
15
|
-
<Money value={price} currencyCode={currencyCode} />
|
|
16
|
-
</div>
|
|
17
|
-
</div>;
|
|
19
|
+
);
|
|
18
20
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { Separator } from '@/vdb/components/ui/separator.js';
|
|
1
2
|
import { ResultOf } from 'gql.tada';
|
|
3
|
+
import { Globe, Phone } from 'lucide-react';
|
|
2
4
|
import { orderAddressFragment } from '../orders.graphql.js';
|
|
3
|
-
import { Phone } from 'lucide-react';
|
|
4
|
-
import { Separator } from '@/components/ui/separator.js';
|
|
5
|
-
import { Globe } from 'lucide-react';
|
|
6
5
|
|
|
7
6
|
type OrderAddress = ResultOf<typeof orderAddressFragment>;
|
|
8
7
|
|
|
9
|
-
export function OrderAddress({ address }: { address?: OrderAddress }) {
|
|
8
|
+
export function OrderAddress({ address }: Readonly<{ address?: OrderAddress }>) {
|
|
10
9
|
if (!address) {
|
|
11
10
|
return null;
|
|
12
11
|
}
|
package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx
CHANGED
|
@@ -1,73 +1,78 @@
|
|
|
1
|
-
import { Alert, AlertDescription } from '@/components/ui/alert.js';
|
|
2
|
-
import {
|
|
1
|
+
import { Alert, AlertDescription } from '@/vdb/components/ui/alert.js';
|
|
2
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
|
+
import { Skeleton } from '@/vdb/components/ui/skeleton.js';
|
|
4
|
+
import { Trans } from '@/vdb/lib/trans.js';
|
|
3
5
|
import { TriangleAlert } from 'lucide-react';
|
|
4
6
|
import { OrderHistory } from './order-history.js';
|
|
5
7
|
import { useOrderHistory } from './use-order-history.js';
|
|
6
|
-
|
|
7
|
-
import { Button } from '@/components/ui/button.js';
|
|
8
|
+
|
|
8
9
|
interface OrderHistoryContainerProps {
|
|
9
|
-
|
|
10
|
+
orderId: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export function OrderHistoryContainer({ orderId }: OrderHistoryContainerProps) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
export function OrderHistoryContainer({ orderId }: Readonly<OrderHistoryContainerProps>) {
|
|
14
|
+
const {
|
|
15
|
+
historyEntries,
|
|
16
|
+
order,
|
|
17
|
+
loading,
|
|
18
|
+
error,
|
|
19
|
+
addNote,
|
|
20
|
+
updateNote,
|
|
21
|
+
deleteNote,
|
|
22
|
+
fetchNextPage,
|
|
23
|
+
hasNextPage,
|
|
24
|
+
} = useOrderHistory({ orderId, pageSize: 10 });
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
if (loading && !order) {
|
|
27
|
+
return (
|
|
28
|
+
<div className="space-y-4">
|
|
29
|
+
<h2 className="text-xl font-semibold">
|
|
30
|
+
<Trans>Order history</Trans>
|
|
31
|
+
</h2>
|
|
32
|
+
<div className="space-y-2">
|
|
33
|
+
<Skeleton className="h-20 w-full" />
|
|
34
|
+
<Skeleton className="h-24 w-full" />
|
|
35
|
+
<Skeleton className="h-24 w-full" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
if (error) {
|
|
42
|
+
return (
|
|
43
|
+
<Alert variant="destructive">
|
|
44
|
+
<TriangleAlert className="h-4 w-4" />
|
|
45
|
+
<AlertDescription>
|
|
46
|
+
<Trans>Error loading order history: {error.message}</Trans>
|
|
47
|
+
</AlertDescription>
|
|
48
|
+
</Alert>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!order) {
|
|
53
|
+
return (
|
|
54
|
+
<Alert>
|
|
55
|
+
<AlertDescription>
|
|
56
|
+
<Trans>Order not found</Trans>
|
|
57
|
+
</AlertDescription>
|
|
58
|
+
</Alert>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
48
61
|
|
|
49
|
-
if (!order) {
|
|
50
62
|
return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
<>
|
|
64
|
+
<OrderHistory
|
|
65
|
+
order={order}
|
|
66
|
+
historyEntries={historyEntries ?? []}
|
|
67
|
+
onAddNote={addNote}
|
|
68
|
+
onUpdateNote={updateNote}
|
|
69
|
+
onDeleteNote={deleteNote}
|
|
70
|
+
/>
|
|
71
|
+
{hasNextPage && (
|
|
72
|
+
<Button type="button" variant="outline" onClick={() => fetchNextPage()}>
|
|
73
|
+
<Trans>Load more</Trans>
|
|
74
|
+
</Button>
|
|
75
|
+
)}
|
|
76
|
+
</>
|
|
54
77
|
);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<>
|
|
59
|
-
<OrderHistory
|
|
60
|
-
order={order}
|
|
61
|
-
historyEntries={historyEntries ?? []}
|
|
62
|
-
onAddNote={addNote}
|
|
63
|
-
onUpdateNote={updateNote}
|
|
64
|
-
onDeleteNote={deleteNote}
|
|
65
|
-
/>
|
|
66
|
-
{hasNextPage && (
|
|
67
|
-
<Button type="button" variant="outline" onClick={() => fetchNextPage()}>
|
|
68
|
-
<Trans>Load more</Trans>
|
|
69
|
-
</Button>
|
|
70
|
-
)}
|
|
71
|
-
</>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
78
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HistoryEntry, HistoryEntryItem } from '@/vdb/components/shared/history-timeline/history-entry.js';
|
|
2
|
+
import { HistoryNoteInput } from '@/vdb/components/shared/history-timeline/history-note-input.js';
|
|
3
|
+
import { HistoryTimeline } from '@/vdb/components/shared/history-timeline/history-timeline.js';
|
|
4
|
+
import { Badge } from '@/vdb/components/ui/badge.js';
|
|
5
|
+
import { Trans } from '@/vdb/lib/trans.js';
|
|
3
6
|
import { ArrowRightToLine, CheckIcon, CreditCardIcon, SquarePen } from 'lucide-react';
|
|
4
|
-
import { HistoryEntry, HistoryEntryItem } from '@/components/shared/history-timeline/history-entry.js';
|
|
5
|
-
import { HistoryNoteInput } from '@/components/shared/history-timeline/history-note-input.js';
|
|
6
|
-
import { HistoryTimeline } from '@/components/shared/history-timeline/history-timeline.js';
|
|
7
7
|
|
|
8
8
|
interface OrderHistoryProps {
|
|
9
9
|
order: {
|
|
@@ -17,7 +17,12 @@ interface OrderHistoryProps {
|
|
|
17
17
|
onDeleteNote?: (entryId: string) => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function OrderHistory({
|
|
20
|
+
export function OrderHistory({
|
|
21
|
+
historyEntries,
|
|
22
|
+
onAddNote,
|
|
23
|
+
onUpdateNote,
|
|
24
|
+
onDeleteNote,
|
|
25
|
+
}: Readonly<OrderHistoryProps>) {
|
|
21
26
|
const getTimelineIcon = (entry: OrderHistoryProps['historyEntries'][0]) => {
|
|
22
27
|
switch (entry.type) {
|
|
23
28
|
case 'ORDER_PAYMENT_TRANSITION':
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { api } from '@/graphql/api.js';
|
|
2
|
-
import { graphql, ResultOf } from '@/graphql/graphql.js';
|
|
3
|
-
import { useLingui } from '@/lib/trans.js';
|
|
4
|
-
import {
|
|
1
|
+
import { api } from '@/vdb/graphql/api.js';
|
|
2
|
+
import { graphql, ResultOf } from '@/vdb/graphql/graphql.js';
|
|
3
|
+
import { useLingui } from '@/vdb/lib/trans.js';
|
|
4
|
+
import { useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { toast } from 'sonner';
|
|
7
7
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { CustomFieldsForm } from '@/components/shared/custom-fields-form.js';
|
|
2
|
-
import { Button } from '@/components/ui/button.js';
|
|
3
|
-
import {
|
|
1
|
+
import { CustomFieldsForm } from '@/vdb/components/shared/custom-fields-form.js';
|
|
2
|
+
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
|
+
import { Form } from '@/vdb/components/ui/form.js';
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
4
5
|
import { Settings2 } from 'lucide-react';
|
|
5
6
|
import { UseFormReturn } from 'react-hook-form';
|
|
6
|
-
import { Form } from '@/components/ui/form.js';
|
|
7
7
|
|
|
8
8
|
interface OrderLineCustomFieldsFormProps {
|
|
9
9
|
onUpdate: (customFieldValues: Record<string, any>) => void;
|
|
10
10
|
form: UseFormReturn<any>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function OrderLineCustomFieldsForm({ onUpdate, form }: OrderLineCustomFieldsFormProps) {
|
|
13
|
+
export function OrderLineCustomFieldsForm({ onUpdate, form }: Readonly<OrderLineCustomFieldsFormProps>) {
|
|
14
14
|
const onSubmit = (values: any) => {
|
|
15
15
|
onUpdate(values.input?.customFields);
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
return (
|
|
19
19
|
<Popover>
|
|
20
20
|
<PopoverTrigger asChild>
|
|
@@ -26,7 +26,11 @@ export function OrderLineCustomFieldsForm({ onUpdate, form }: OrderLineCustomFie
|
|
|
26
26
|
<Form {...form}>
|
|
27
27
|
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
|
28
28
|
<h4 className="font-medium leading-none">Custom Fields</h4>
|
|
29
|
-
<CustomFieldsForm
|
|
29
|
+
<CustomFieldsForm
|
|
30
|
+
entityType="OrderLine"
|
|
31
|
+
control={form.control}
|
|
32
|
+
formPathPrefix="input"
|
|
33
|
+
/>
|
|
30
34
|
<Button type="submit" className="w-full" disabled={!form.formState.isValid}>
|
|
31
35
|
Update
|
|
32
36
|
</Button>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { TableCell, TableRow } from '@/vdb/components/ui/table.js';
|
|
2
|
+
import { ResultOf } from '@/vdb/graphql/graphql.js';
|
|
3
|
+
import { Trans } from '@/vdb/lib/trans.js';
|
|
4
|
+
import { orderDetailDocument } from '../orders.graphql.js';
|
|
5
|
+
import { MoneyGrossNet } from './money-gross-net.js';
|
|
6
6
|
|
|
7
7
|
type OrderFragment = NonNullable<ResultOf<typeof orderDetailDocument>['order']>;
|
|
8
8
|
|
|
@@ -11,25 +11,37 @@ export interface OrderTableTotalsProps {
|
|
|
11
11
|
columnCount: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function OrderTableTotals({ order, columnCount }: OrderTableTotalsProps) {
|
|
14
|
+
export function OrderTableTotals({ order, columnCount }: Readonly<OrderTableTotalsProps>) {
|
|
15
15
|
const currencyCode = order.currencyCode;
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
{order.discounts?.length > 0
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
{order.discounts?.length > 0
|
|
20
|
+
? order.discounts.map((discount, index) => (
|
|
21
|
+
<TableRow key={`${discount.description}-${index}`}>
|
|
22
|
+
<TableCell colSpan={columnCount - 1} className="h-12">
|
|
23
|
+
<Trans>Discount</Trans>: {discount.description}
|
|
24
|
+
</TableCell>
|
|
25
|
+
<TableCell colSpan={1} className="h-12">
|
|
26
|
+
<MoneyGrossNet
|
|
27
|
+
priceWithTax={discount.amountWithTax}
|
|
28
|
+
price={discount.amount}
|
|
29
|
+
currencyCode={currencyCode}
|
|
30
|
+
/>
|
|
31
|
+
</TableCell>
|
|
32
|
+
</TableRow>
|
|
33
|
+
))
|
|
34
|
+
: null}
|
|
27
35
|
<TableRow>
|
|
28
36
|
<TableCell colSpan={columnCount - 1} className="h-12">
|
|
29
37
|
<Trans>Sub total</Trans>
|
|
30
38
|
</TableCell>
|
|
31
39
|
<TableCell colSpan={1} className="h-12">
|
|
32
|
-
<MoneyGrossNet
|
|
40
|
+
<MoneyGrossNet
|
|
41
|
+
priceWithTax={order.subTotalWithTax}
|
|
42
|
+
price={order.subTotal}
|
|
43
|
+
currencyCode={currencyCode}
|
|
44
|
+
/>
|
|
33
45
|
</TableCell>
|
|
34
46
|
</TableRow>
|
|
35
47
|
<TableRow>
|
|
@@ -37,7 +49,11 @@ export function OrderTableTotals({ order, columnCount }: OrderTableTotalsProps)
|
|
|
37
49
|
<Trans>Shipping</Trans>
|
|
38
50
|
</TableCell>
|
|
39
51
|
<TableCell colSpan={1} className="h-12">
|
|
40
|
-
<MoneyGrossNet
|
|
52
|
+
<MoneyGrossNet
|
|
53
|
+
priceWithTax={order.shippingWithTax}
|
|
54
|
+
price={order.shipping}
|
|
55
|
+
currencyCode={currencyCode}
|
|
56
|
+
/>
|
|
41
57
|
</TableCell>
|
|
42
58
|
</TableRow>
|
|
43
59
|
<TableRow>
|
|
@@ -45,9 +61,13 @@ export function OrderTableTotals({ order, columnCount }: OrderTableTotalsProps)
|
|
|
45
61
|
<Trans>Total</Trans>
|
|
46
62
|
</TableCell>
|
|
47
63
|
<TableCell colSpan={1} className="h-12 font-bold">
|
|
48
|
-
<MoneyGrossNet
|
|
64
|
+
<MoneyGrossNet
|
|
65
|
+
priceWithTax={order.totalWithTax}
|
|
66
|
+
price={order.total}
|
|
67
|
+
currencyCode={currencyCode}
|
|
68
|
+
/>
|
|
49
69
|
</TableCell>
|
|
50
70
|
</TableRow>
|
|
51
71
|
</>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VendureImage } from '@/components/shared/vendure-image.js';
|
|
2
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table.js';
|
|
3
|
-
import { ResultOf } from '@/graphql/graphql.js';
|
|
1
|
+
import { VendureImage } from '@/vdb/components/shared/vendure-image.js';
|
|
2
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/vdb/components/ui/table.js';
|
|
3
|
+
import { ResultOf } from '@/vdb/graphql/graphql.js';
|
|
4
4
|
import {
|
|
5
5
|
ColumnDef,
|
|
6
6
|
flexRender,
|
|
@@ -20,7 +20,7 @@ export interface OrderTableProps {
|
|
|
20
20
|
order: OrderFragment;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export function OrderTable({ order }: OrderTableProps) {
|
|
23
|
+
export function OrderTable({ order }: Readonly<OrderTableProps>) {
|
|
24
24
|
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});
|
|
25
25
|
|
|
26
26
|
const currencyCode = order.currencyCode;
|