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