@vendure/dashboard 3.6.0-minor-202511061550 → 3.6.0-minor-202512161252

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.
Files changed (152) hide show
  1. package/dist/plugin/constants.js +2 -2
  2. package/dist/vite/constants.js +1 -0
  3. package/dist/vite/utils/compiler.d.ts +1 -0
  4. package/dist/vite/utils/compiler.js +5 -4
  5. package/dist/vite/utils/get-dashboard-paths.d.ts +5 -0
  6. package/dist/vite/utils/get-dashboard-paths.js +20 -0
  7. package/dist/vite/vite-plugin-dashboard-metadata.js +2 -1
  8. package/dist/vite/vite-plugin-tailwind-source.js +2 -15
  9. package/dist/vite/vite-plugin-translations.d.ts +10 -1
  10. package/dist/vite/vite-plugin-translations.js +156 -45
  11. package/dist/vite/vite-plugin-vendure-dashboard.d.ts +12 -0
  12. package/dist/vite/vite-plugin-vendure-dashboard.js +1 -0
  13. package/lingui.config.js +1 -0
  14. package/package.json +7 -7
  15. package/src/app/routeTree.gen.ts +1221 -0
  16. package/src/app/routes/_authenticated/_administrators/administrators.tsx +9 -12
  17. package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +9 -12
  18. package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +6 -9
  19. package/src/app/routes/_authenticated/_channels/channels.tsx +9 -12
  20. package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +9 -12
  21. package/src/app/routes/_authenticated/_collections/collections.tsx +9 -12
  22. package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +9 -12
  23. package/src/app/routes/_authenticated/_countries/countries.tsx +9 -12
  24. package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +9 -12
  25. package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +9 -12
  26. package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +9 -12
  27. package/src/app/routes/_authenticated/_customers/components/customer-history/index.ts +0 -1
  28. package/src/app/routes/_authenticated/_customers/customers.tsx +9 -12
  29. package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +9 -12
  30. package/src/app/routes/_authenticated/_facets/facets.tsx +9 -12
  31. package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +9 -12
  32. package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +9 -12
  33. package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +10 -13
  34. package/src/app/routes/_authenticated/_orders/components/add-surcharge-form.tsx +139 -0
  35. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +3 -0
  36. package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +3 -1
  37. package/src/app/routes/_authenticated/_orders/components/order-address.tsx +3 -3
  38. package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +41 -41
  39. package/src/app/routes/_authenticated/_orders/components/order-history/order-history-utils.tsx +1 -1
  40. package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +49 -11
  41. package/src/app/routes/_authenticated/_orders/components/order-table.tsx +4 -1
  42. package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +2 -3
  43. package/src/app/routes/_authenticated/_orders/orders.tsx +3 -3
  44. package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +12 -3
  45. package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +27 -30
  46. package/src/app/routes/_authenticated/_orders/utils/use-modify-order.ts +23 -0
  47. package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +9 -12
  48. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +9 -12
  49. package/src/app/routes/_authenticated/_product-variants/components/add-currency-dropdown.tsx +3 -3
  50. package/src/app/routes/_authenticated/_product-variants/components/add-stock-location-dropdown.tsx +2 -2
  51. package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +1 -0
  52. package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +10 -12
  53. package/src/app/routes/_authenticated/_products/products.graphql.ts +1 -0
  54. package/src/app/routes/_authenticated/_products/products.tsx +15 -18
  55. package/src/app/routes/_authenticated/_products/products_.$id.tsx +9 -12
  56. package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +9 -12
  57. package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +9 -12
  58. package/src/app/routes/_authenticated/_profile/profile.tsx +3 -3
  59. package/src/app/routes/_authenticated/_promotions/promotions.tsx +9 -12
  60. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +9 -12
  61. package/src/app/routes/_authenticated/_roles/roles.tsx +9 -12
  62. package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +9 -12
  63. package/src/app/routes/_authenticated/_sellers/sellers.tsx +9 -12
  64. package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +9 -12
  65. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +11 -12
  66. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +19 -20
  67. package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +9 -12
  68. package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +9 -12
  69. package/src/app/routes/_authenticated/_system/healthchecks.tsx +2 -3
  70. package/src/app/routes/_authenticated/_system/job-queue.tsx +3 -3
  71. package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +9 -12
  72. package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +9 -12
  73. package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +9 -12
  74. package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +9 -12
  75. package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +49 -1
  76. package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +34 -16
  77. package/src/app/routes/_authenticated/_zones/zones.tsx +9 -12
  78. package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +9 -12
  79. package/src/app/routes/_authenticated/index.tsx +5 -3
  80. package/src/i18n/locales/bg.po +3436 -0
  81. package/src/lib/components/data-input/datetime-input.tsx +1 -1
  82. package/src/lib/components/data-input/default-relation-input.tsx +1 -1
  83. package/src/lib/components/data-input/relation-selector.tsx +1 -1
  84. package/src/lib/components/data-input/string-list-input.tsx +188 -26
  85. package/src/lib/components/data-input/struct-form-input.tsx +175 -174
  86. package/src/lib/components/data-table/column-header-wrapper.tsx +1 -1
  87. package/src/lib/components/data-table/data-table-filter-badge.tsx +2 -2
  88. package/src/lib/components/data-table/data-table.tsx +1 -1
  89. package/src/lib/components/data-table/use-generated-columns.tsx +1 -1
  90. package/src/lib/components/layout/channel-switcher.tsx +6 -2
  91. package/src/lib/components/layout/content-language-selector.tsx +6 -7
  92. package/src/lib/components/layout/dev-mode-indicator.tsx +7 -3
  93. package/src/lib/components/layout/language-dialog.tsx +26 -13
  94. package/src/lib/components/layout/manage-languages-dialog.tsx +10 -29
  95. package/src/lib/components/layout/nav-item-wrapper.tsx +1 -1
  96. package/src/lib/components/shared/asset/asset-gallery.tsx +8 -3
  97. package/src/lib/components/shared/configurable-operation-multi-selector.tsx +14 -16
  98. package/src/lib/components/shared/custom-fields-form.tsx +14 -9
  99. package/src/lib/components/shared/language-selector.tsx +14 -6
  100. package/src/lib/components/shared/multi-select.tsx +1 -1
  101. package/src/lib/components/shared/navigation-confirmation.tsx +1 -1
  102. package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +4 -4
  103. package/src/lib/components/ui/carousel.tsx +2 -2
  104. package/src/lib/components/ui/chart.tsx +1 -1
  105. package/src/lib/components/ui/context-menu.tsx +1 -1
  106. package/src/lib/components/ui/drawer.tsx +1 -1
  107. package/src/lib/components/ui/grid-layout.tsx +1 -1
  108. package/src/lib/components/ui/input-group.tsx +1 -0
  109. package/src/lib/components/ui/input-otp.tsx +1 -1
  110. package/src/lib/components/ui/menubar.tsx +1 -1
  111. package/src/lib/components/ui/navigation-menu.tsx +1 -1
  112. package/src/lib/components/ui/progress.tsx +1 -1
  113. package/src/lib/components/ui/radio-group.tsx +1 -1
  114. package/src/lib/components/ui/resizable.tsx +1 -1
  115. package/src/lib/components/ui/select.tsx +1 -1
  116. package/src/lib/components/ui/slider.tsx +1 -1
  117. package/src/lib/components/ui/toggle-group.tsx +2 -2
  118. package/src/lib/components/ui/toggle.tsx +1 -1
  119. package/src/lib/framework/component-registry/component-registry.tsx +2 -6
  120. package/src/lib/framework/document-introspection/add-custom-fields.spec.ts +907 -1
  121. package/src/lib/framework/document-introspection/add-custom-fields.ts +248 -119
  122. package/src/lib/framework/extension-api/display-component-extensions.tsx +4 -3
  123. package/src/lib/framework/extension-api/logic/detail-forms.ts +0 -13
  124. package/src/lib/framework/extension-api/logic/navigation.ts +1 -1
  125. package/src/lib/framework/extension-api/types/data-table.ts +4 -2
  126. package/src/lib/framework/extension-api/types/layout.ts +34 -1
  127. package/src/lib/framework/extension-api/types/navigation.ts +7 -2
  128. package/src/lib/framework/form-engine/use-generated-form.tsx +7 -1
  129. package/src/lib/framework/history-entry/history-entry.tsx +1 -1
  130. package/src/lib/framework/layout-engine/action-bar-item-wrapper.tsx +185 -0
  131. package/src/lib/framework/layout-engine/dev-mode-button.tsx +15 -13
  132. package/src/lib/framework/layout-engine/location-wrapper.tsx +3 -1
  133. package/src/lib/framework/layout-engine/page-layout.spec.tsx +138 -0
  134. package/src/lib/framework/layout-engine/page-layout.tsx +294 -69
  135. package/src/lib/framework/nav-menu/nav-menu-extensions.ts +1 -1
  136. package/src/lib/framework/page/detail-page-route-loader.tsx +1 -1
  137. package/src/lib/framework/page/page-api.ts +1 -1
  138. package/src/lib/framework/page/use-detail-page.ts +4 -2
  139. package/src/lib/framework/page/use-extended-router.tsx +20 -16
  140. package/src/lib/framework/registry/registry-types.ts +2 -1
  141. package/src/lib/graphql/api.ts +3 -8
  142. package/src/lib/graphql/graphql-env.d.ts +29 -10
  143. package/src/lib/hooks/use-permissions.ts +3 -3
  144. package/src/lib/hooks/use-sorted-languages.ts +41 -0
  145. package/src/lib/index.ts +1 -0
  146. package/src/lib/lib/load-i18n-messages.ts +4 -1
  147. package/src/lib/providers/channel-provider.tsx +11 -7
  148. package/src/lib/utils/config-utils.ts +19 -0
  149. package/src/lib/virtual.d.ts +3 -0
  150. package/LICENSE.md +0 -42
  151. package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +0 -129
  152. /package/src/{app/routes/_authenticated/_global-settings → lib}/utils/global-languages.ts +0 -0
@@ -1,11 +1,10 @@
1
1
  import { ChannelCodeLabel } from '@/vdb/components/shared/channel-code-label.js';
2
2
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
3
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
4
3
  import { RoleCodeLabel } from '@/vdb/components/shared/role-code-label.js';
5
4
  import { Badge } from '@/vdb/components/ui/badge.js';
6
5
  import { Button } from '@/vdb/components/ui/button.js';
7
6
  import { CUSTOMER_ROLE_CODE, SUPER_ADMIN_ROLE_CODE } from '@/vdb/constants.js';
8
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
7
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
9
8
  import { ListPage } from '@/vdb/framework/page/list-page.js';
10
9
  import { Trans } from '@lingui/react/macro';
11
10
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -84,16 +83,14 @@ function RoleListPage() {
84
83
  },
85
84
  ]}
86
85
  >
87
- <PageActionBarRight>
88
- <PermissionGuard requires={['CreateAdministrator']}>
89
- <Button asChild>
90
- <Link to="./new">
91
- <PlusIcon className="mr-2 h-4 w-4" />
92
- <Trans>New Role</Trans>
93
- </Link>
94
- </Button>
95
- </PermissionGuard>
96
- </PageActionBarRight>
86
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateAdministrator']}>
87
+ <Button asChild>
88
+ <Link to="./new">
89
+ <PlusIcon className="mr-2 h-4 w-4" />
90
+ <Trans>New Role</Trans>
91
+ </Link>
92
+ </Button>
93
+ </ActionBarItem>
97
94
  </ListPage>
98
95
  );
99
96
  }
@@ -1,15 +1,14 @@
1
1
  import { ChannelSelector } from '@/vdb/components/shared/channel-selector.js';
2
2
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
3
3
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
4
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
5
4
  import { Button } from '@/vdb/components/ui/button.js';
6
5
  import { Input } from '@/vdb/components/ui/input.js';
7
6
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
8
7
  import {
8
+ ActionBarItem,
9
9
  DetailFormGrid,
10
10
  Page,
11
11
  PageActionBar,
12
- PageActionBarRight,
13
12
  PageBlock,
14
13
  PageLayout,
15
14
  PageTitle,
@@ -78,16 +77,14 @@ function RoleDetailPage() {
78
77
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
79
78
  <PageTitle>{creatingNewEntity ? <Trans>New role</Trans> : (entity?.description ?? '')}</PageTitle>
80
79
  <PageActionBar>
81
- <PageActionBarRight>
82
- <PermissionGuard requires={['UpdateAdministrator']}>
83
- <Button
84
- type="submit"
85
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
86
- >
87
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
88
- </Button>
89
- </PermissionGuard>
90
- </PageActionBarRight>
80
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateAdministrator']}>
81
+ <Button
82
+ type="submit"
83
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
84
+ >
85
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
86
+ </Button>
87
+ </ActionBarItem>
91
88
  </PageActionBar>
92
89
  <PageLayout>
93
90
  <PageBlock column="main" blockId="main-form">
@@ -1,7 +1,6 @@
1
1
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
2
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
3
2
  import { Button } from '@/vdb/components/ui/button.js';
4
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
3
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
5
4
  import { ListPage } from '@/vdb/framework/page/list-page.js';
6
5
  import { Trans } from '@lingui/react/macro';
7
6
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -41,16 +40,14 @@ function SellerListPage() {
41
40
  },
42
41
  ]}
43
42
  >
44
- <PageActionBarRight>
45
- <PermissionGuard requires={['CreateSeller']}>
46
- <Button asChild>
47
- <Link to="./new">
48
- <PlusIcon className="mr-2 h-4 w-4" />
49
- <Trans>New Seller</Trans>
50
- </Link>
51
- </Button>
52
- </PermissionGuard>
53
- </PageActionBarRight>
43
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateSeller']}>
44
+ <Button asChild>
45
+ <Link to="./new">
46
+ <PlusIcon className="mr-2 h-4 w-4" />
47
+ <Trans>New Seller</Trans>
48
+ </Link>
49
+ </Button>
50
+ </ActionBarItem>
54
51
  </ListPage>
55
52
  );
56
53
  }
@@ -1,14 +1,13 @@
1
1
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
2
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
3
2
  import { Button } from '@/vdb/components/ui/button.js';
4
3
  import { FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/vdb/components/ui/form.js';
5
4
  import { Input } from '@/vdb/components/ui/input.js';
6
5
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
7
6
  import {
7
+ ActionBarItem,
8
8
  CustomFieldsPageBlock,
9
9
  Page,
10
10
  PageActionBar,
11
- PageActionBarRight,
12
11
  PageBlock,
13
12
  PageLayout,
14
13
  PageTitle,
@@ -72,16 +71,14 @@ function SellerDetailPage() {
72
71
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
73
72
  <PageTitle>{creatingNewEntity ? <Trans>New seller</Trans> : (entity?.name ?? '')}</PageTitle>
74
73
  <PageActionBar>
75
- <PageActionBarRight>
76
- <PermissionGuard requires={['UpdateSeller']}>
77
- <Button
78
- type="submit"
79
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
80
- >
81
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
82
- </Button>
83
- </PermissionGuard>
84
- </PageActionBarRight>
74
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateSeller']}>
75
+ <Button
76
+ type="submit"
77
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
78
+ >
79
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
80
+ </Button>
81
+ </ActionBarItem>
85
82
  </PageActionBar>
86
83
  <PageLayout>
87
84
  <PageBlock column="main" blockId="main-form">
@@ -1,8 +1,7 @@
1
1
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
2
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
3
2
  import { RichTextDescriptionCell } from '@/vdb/components/shared/table-cell/order-table-cell-components.js';
4
3
  import { Button } from '@/vdb/components/ui/button.js';
5
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
4
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
6
5
  import { ListPage } from '@/vdb/framework/page/list-page.js';
7
6
  import { Trans } from '@lingui/react/macro';
8
7
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -60,17 +59,17 @@ function ShippingMethodListPage() {
60
59
  },
61
60
  ]}
62
61
  >
63
- <PageActionBarRight>
62
+ <ActionBarItem itemId="test-shipping-button">
64
63
  <TestShippingMethodsSheet />
65
- <PermissionGuard requires={['CreateShippingMethod']}>
66
- <Button asChild>
67
- <Link to="./new">
68
- <PlusIcon className="mr-2 h-4 w-4" />
69
- <Trans>New Shipping Method</Trans>
70
- </Link>
71
- </Button>
72
- </PermissionGuard>
73
- </PageActionBarRight>
64
+ </ActionBarItem>
65
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateShippingMethod']}>
66
+ <Button asChild>
67
+ <Link to="./new">
68
+ <PlusIcon className="mr-2 h-4 w-4" />
69
+ <Trans>New Shipping Method</Trans>
70
+ </Link>
71
+ </Button>
72
+ </ActionBarItem>
74
73
  </ListPage>
75
74
  );
76
75
  }
@@ -1,17 +1,16 @@
1
1
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
2
2
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
3
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
4
3
  import { TranslatableFormFieldWrapper } from '@/vdb/components/shared/translatable-form-field.js';
5
4
  import { Button } from '@/vdb/components/ui/button.js';
6
5
  import { Input } from '@/vdb/components/ui/input.js';
7
6
  import { Textarea } from '@/vdb/components/ui/textarea.js';
8
7
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
9
8
  import {
9
+ ActionBarItem,
10
10
  CustomFieldsPageBlock,
11
11
  DetailFormGrid,
12
12
  Page,
13
13
  PageActionBar,
14
- PageActionBarRight,
15
14
  PageBlock,
16
15
  PageLayout,
17
16
  PageTitle,
@@ -114,25 +113,25 @@ function ShippingMethodDetailPage() {
114
113
  {creatingNewEntity ? <Trans>New shipping method</Trans> : (entity?.name ?? '')}
115
114
  </PageTitle>
116
115
  <PageActionBar>
117
- <PageActionBarRight>
118
- {!creatingNewEntity && entity && (
116
+ {!creatingNewEntity && entity && (
117
+ <ActionBarItem itemId="test-shipping-button">
119
118
  <TestSingleShippingMethodSheet checker={checker} calculator={calculator} />
120
- )}
121
- <PermissionGuard requires={['UpdateShippingMethod']}>
122
- <Button
123
- type="submit"
124
- disabled={
125
- !form.formState.isDirty ||
126
- !form.formState.isValid ||
127
- isPending ||
128
- !checker?.code ||
129
- !calculator?.code
130
- }
131
- >
132
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
133
- </Button>
134
- </PermissionGuard>
135
- </PageActionBarRight>
119
+ </ActionBarItem>
120
+ )}
121
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateShippingMethod']}>
122
+ <Button
123
+ type="submit"
124
+ disabled={
125
+ !form.formState.isDirty ||
126
+ !form.formState.isValid ||
127
+ isPending ||
128
+ !checker?.code ||
129
+ !calculator?.code
130
+ }
131
+ >
132
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
133
+ </Button>
134
+ </ActionBarItem>
136
135
  </PageActionBar>
137
136
  <PageLayout>
138
137
  <PageBlock column="main" blockId="main-form">
@@ -1,7 +1,6 @@
1
1
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
2
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
3
2
  import { Button } from '@/vdb/components/ui/button.js';
4
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
3
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
5
4
  import { ListPage } from '@/vdb/framework/page/list-page.js';
6
5
  import { Trans } from '@lingui/react/macro';
7
6
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -50,16 +49,14 @@ function StockLocationListPage() {
50
49
  },
51
50
  ]}
52
51
  >
53
- <PageActionBarRight>
54
- <PermissionGuard requires={['CreateStockLocation']}>
55
- <Button asChild>
56
- <Link to="./new">
57
- <PlusIcon className="mr-2 h-4 w-4" />
58
- <Trans>New Stock Location</Trans>
59
- </Link>
60
- </Button>
61
- </PermissionGuard>
62
- </PageActionBarRight>
52
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateStockLocation']}>
53
+ <Button asChild>
54
+ <Link to="./new">
55
+ <PlusIcon className="mr-2 h-4 w-4" />
56
+ <Trans>New Stock Location</Trans>
57
+ </Link>
58
+ </Button>
59
+ </ActionBarItem>
63
60
  </ListPage>
64
61
  );
65
62
  }
@@ -1,16 +1,15 @@
1
1
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
2
2
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
3
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
4
3
  import { Button } from '@/vdb/components/ui/button.js';
5
4
  import { Input } from '@/vdb/components/ui/input.js';
6
5
  import { Textarea } from '@/vdb/components/ui/textarea.js';
7
6
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
8
7
  import {
8
+ ActionBarItem,
9
9
  CustomFieldsPageBlock,
10
10
  DetailFormGrid,
11
11
  Page,
12
12
  PageActionBar,
13
- PageActionBarRight,
14
13
  PageBlock,
15
14
  PageLayout,
16
15
  PageTitle,
@@ -90,16 +89,14 @@ function StockLocationDetailPage() {
90
89
  {creatingNewEntity ? <Trans>New stock location</Trans> : (entity?.name ?? '')}
91
90
  </PageTitle>
92
91
  <PageActionBar>
93
- <PageActionBarRight>
94
- <PermissionGuard requires={['UpdateStockLocation']}>
95
- <Button
96
- type="submit"
97
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
98
- >
99
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
100
- </Button>
101
- </PermissionGuard>
102
- </PageActionBarRight>
92
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateStockLocation']}>
93
+ <Button
94
+ type="submit"
95
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
96
+ >
97
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
98
+ </Button>
99
+ </ActionBarItem>
103
100
  </PageActionBar>
104
101
  <PageLayout>
105
102
  <PageBlock column="main" blockId="main-form">
@@ -1,12 +1,12 @@
1
1
  import { Button } from '@/vdb/components/ui/button.js';
2
2
  import { Card, CardContent, CardHeader, CardTitle } from '@/vdb/components/ui/card.js';
3
3
  import { Page, PageActionBar, PageTitle } from '@/vdb/framework/layout-engine/page-layout.js';
4
+ import { getApiBaseUrl } from '@/vdb/utils/config-utils.js';
4
5
  import { Trans } from '@lingui/react/macro';
5
6
  import { useQuery } from '@tanstack/react-query';
6
7
  import { createFileRoute } from '@tanstack/react-router';
7
8
  import { formatRelative } from 'date-fns';
8
9
  import { CheckCircle2Icon, CircleXIcon } from 'lucide-react';
9
- import { uiConfig } from 'virtual:vendure-ui-config';
10
10
 
11
11
  export const Route = createFileRoute('/_authenticated/_system/healthchecks')({
12
12
  component: HealthchecksPage,
@@ -28,8 +28,7 @@ function HealthchecksPage() {
28
28
  const { data, refetch, dataUpdatedAt } = useQuery({
29
29
  queryKey: ['healthchecks'],
30
30
  queryFn: async () => {
31
- const schemeAndHost =
32
- uiConfig.api.host + (uiConfig.api.port !== 'auto' ? `:${uiConfig.api.port}` : '');
31
+ const schemeAndHost = getApiBaseUrl();
33
32
 
34
33
  const res = await fetch(`${schemeAndHost}/health`);
35
34
  return res.json() as Promise<HealthcheckResponse>;
@@ -6,7 +6,7 @@ import {
6
6
  DropdownMenuItem,
7
7
  DropdownMenuTrigger,
8
8
  } from '@/vdb/components/ui/dropdown-menu.js';
9
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
9
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
10
10
  import { ListPage } from '@/vdb/framework/page/list-page.js';
11
11
  import { api } from '@/vdb/graphql/api.js';
12
12
  import { Trans, useLingui } from '@lingui/react/macro';
@@ -227,7 +227,7 @@ function JobQueuePage() {
227
227
  refreshRef.current = refresher;
228
228
  }}
229
229
  >
230
- <PageActionBarRight>
230
+ <ActionBarItem itemId="auto-refresh-button">
231
231
  <DropdownMenu>
232
232
  <DropdownMenuTrigger asChild>
233
233
  <Button variant="outline" size="sm" className="gap-2">
@@ -250,7 +250,7 @@ function JobQueuePage() {
250
250
  ))}
251
251
  </DropdownMenuContent>
252
252
  </DropdownMenu>
253
- </PageActionBarRight>
253
+ </ActionBarItem>
254
254
  </ListPage>
255
255
  );
256
256
  }
@@ -1,8 +1,7 @@
1
1
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
2
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
3
2
  import { Badge } from '@/vdb/components/ui/badge.js';
4
3
  import { Button } from '@/vdb/components/ui/button.js';
5
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
4
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
6
5
  import { ListPage } from '@/vdb/framework/page/list-page.js';
7
6
  import { Trans } from '@lingui/react/macro';
8
7
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -54,16 +53,14 @@ function TaxCategoryListPage() {
54
53
  },
55
54
  ]}
56
55
  >
57
- <PageActionBarRight>
58
- <PermissionGuard requires={['CreateTaxCategory']}>
59
- <Button asChild>
60
- <Link to="./new">
61
- <PlusIcon />
62
- <Trans>New Tax Category</Trans>
63
- </Link>
64
- </Button>
65
- </PermissionGuard>
66
- </PageActionBarRight>
56
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateTaxCategory']}>
57
+ <Button asChild>
58
+ <Link to="./new">
59
+ <PlusIcon />
60
+ <Trans>New Tax Category</Trans>
61
+ </Link>
62
+ </Button>
63
+ </ActionBarItem>
67
64
  </ListPage>
68
65
  );
69
66
  }
@@ -1,16 +1,15 @@
1
1
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
2
2
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
3
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
4
3
  import { Button } from '@/vdb/components/ui/button.js';
5
4
  import { Input } from '@/vdb/components/ui/input.js';
6
5
  import { Switch } from '@/vdb/components/ui/switch.js';
7
6
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
8
7
  import {
8
+ ActionBarItem,
9
9
  CustomFieldsPageBlock,
10
10
  DetailFormGrid,
11
11
  Page,
12
12
  PageActionBar,
13
- PageActionBarRight,
14
13
  PageBlock,
15
14
  PageLayout,
16
15
  PageTitle,
@@ -90,16 +89,14 @@ function TaxCategoryDetailPage() {
90
89
  {creatingNewEntity ? <Trans>New tax category</Trans> : (entity?.name ?? '')}
91
90
  </PageTitle>
92
91
  <PageActionBar>
93
- <PageActionBarRight>
94
- <PermissionGuard requires={['UpdateTaxCategory']}>
95
- <Button
96
- type="submit"
97
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
98
- >
99
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
100
- </Button>
101
- </PermissionGuard>
102
- </PageActionBarRight>
92
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateTaxCategory']}>
93
+ <Button
94
+ type="submit"
95
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
96
+ >
97
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
98
+ </Button>
99
+ </ActionBarItem>
103
100
  </PageActionBar>
104
101
  <PageLayout>
105
102
  <PageBlock column="main" blockId="main-form">
@@ -1,8 +1,7 @@
1
1
  import { BooleanDisplayBadge } from '@/vdb/components/data-display/boolean.js';
2
2
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
3
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
4
3
  import { Button } from '@/vdb/components/ui/button.js';
5
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
4
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
6
5
  import { ListPage } from '@/vdb/framework/page/list-page.js';
7
6
  import { api } from '@/vdb/graphql/api.js';
8
7
  import { Trans, useLingui } from '@lingui/react/macro';
@@ -104,16 +103,14 @@ function TaxRateListPage() {
104
103
  },
105
104
  ]}
106
105
  >
107
- <PageActionBarRight>
108
- <PermissionGuard requires={['CreateTaxRate']}>
109
- <Button asChild>
110
- <Link to="./new">
111
- <PlusIcon />
112
- <Trans>New Tax Rate</Trans>
113
- </Link>
114
- </Button>
115
- </PermissionGuard>
116
- </PageActionBarRight>
106
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateTaxRate']}>
107
+ <Button asChild>
108
+ <Link to="./new">
109
+ <PlusIcon />
110
+ <Trans>New Tax Rate</Trans>
111
+ </Link>
112
+ </Button>
113
+ </ActionBarItem>
117
114
  </ListPage>
118
115
  );
119
116
  }
@@ -1,7 +1,6 @@
1
1
  import { AffixedInput } from '@/vdb/components/data-input/affixed-input.js';
2
2
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
3
3
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
4
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
5
4
  import { TaxCategorySelector } from '@/vdb/components/shared/tax-category-selector.js';
6
5
  import { ZoneSelector } from '@/vdb/components/shared/zone-selector.js';
7
6
  import { Button } from '@/vdb/components/ui/button.js';
@@ -9,11 +8,11 @@ import { Input } from '@/vdb/components/ui/input.js';
9
8
  import { Switch } from '@/vdb/components/ui/switch.js';
10
9
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
11
10
  import {
11
+ ActionBarItem,
12
12
  CustomFieldsPageBlock,
13
13
  DetailFormGrid,
14
14
  Page,
15
15
  PageActionBar,
16
- PageActionBarRight,
17
16
  PageBlock,
18
17
  PageLayout,
19
18
  PageTitle,
@@ -86,16 +85,14 @@ function TaxRateDetailPage() {
86
85
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
87
86
  <PageTitle>{creatingNewEntity ? <Trans>New tax rate</Trans> : (entity?.name ?? '')}</PageTitle>
88
87
  <PageActionBar>
89
- <PageActionBarRight>
90
- <PermissionGuard requires={['UpdateTaxRate']}>
91
- <Button
92
- type="submit"
93
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
94
- >
95
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
96
- </Button>
97
- </PermissionGuard>
98
- </PageActionBarRight>
88
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateTaxRate']}>
89
+ <Button
90
+ type="submit"
91
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
92
+ >
93
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
94
+ </Button>
95
+ </ActionBarItem>
99
96
  </PageActionBar>
100
97
  <PageLayout>
101
98
  <PageBlock column="side" blockId="enabled">
@@ -1,6 +1,12 @@
1
1
  import { BulkActionComponent } from '@/vdb/framework/extension-api/types/index.js';
2
2
  import { DeleteBulkAction } from '../../../../common/delete-bulk-action.js';
3
- import { deleteZonesDocument } from '../zones.graphql.js';
3
+ import { deleteZonesDocument, removeCountryFromZoneMutation } from '../zones.graphql.js';
4
+ import { DataTableBulkActionItem } from '@/vdb/components/data-table/data-table-bulk-action-item.js';
5
+ import { TrashIcon } from 'lucide-react';
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { api } from '@/vdb/graphql/api.js';
8
+ import { toast } from 'sonner';
9
+ import { Trans, useLingui } from '@lingui/react/macro';
4
10
 
5
11
  export const DeleteZonesBulkAction: BulkActionComponent<any> = ({ selection, table }) => {
6
12
  return (
@@ -13,3 +19,45 @@ export const DeleteZonesBulkAction: BulkActionComponent<any> = ({ selection, tab
13
19
  />
14
20
  );
15
21
  };
22
+
23
+ export function removeCountryFromZoneBulkAction(zoneId: string): BulkActionComponent<any> {
24
+ const RemoveCountryFromZoneBulkAction: BulkActionComponent<any> = ({ selection, table }) => {
25
+ const { t } = useLingui();
26
+ const queryClient = useQueryClient();
27
+
28
+ const { mutate } = useMutation({
29
+ mutationFn: api.mutate(removeCountryFromZoneMutation),
30
+ onSuccess: () => {
31
+ toast.success(t`Removed ${selection.length} ${selection.length === 1 ? 'country' : 'countries'} from zone`);
32
+ queryClient.invalidateQueries({ queryKey: ['zone', zoneId] });
33
+ table.resetRowSelection();
34
+ },
35
+ onError: () => {
36
+ toast.error(t`Failed to remove countries from zone`);
37
+ },
38
+ });
39
+
40
+ return (
41
+ <DataTableBulkActionItem
42
+ requiresPermission={['UpdateZone']}
43
+ onClick={() => {
44
+ mutate({
45
+ zoneId,
46
+ memberIds: selection.map(s => s.id),
47
+ });
48
+ }}
49
+ label={<Trans>Remove from zone</Trans>}
50
+ confirmationText={
51
+ <Trans>
52
+ Are you sure you want to remove {selection.length} {selection.length === 1 ? 'country' : 'countries'} from this zone?
53
+ </Trans>
54
+ }
55
+ icon={TrashIcon}
56
+ className="text-destructive"
57
+ />
58
+ );
59
+ };
60
+
61
+ return RemoveCountryFromZoneBulkAction;
62
+ }
63
+