@vendure/dashboard 3.6.0-minor-202511061555 → 3.6.0-minor-202512161454

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,9 +1,8 @@
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 { RoleCodeLabel } from '@/vdb/components/shared/role-code-label.js';
4
3
  import { Badge } from '@/vdb/components/ui/badge.js';
5
4
  import { Button } from '@/vdb/components/ui/button.js';
6
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
5
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
7
6
  import { ListPage } from '@/vdb/framework/page/list-page.js';
8
7
  import { Trans } from '@lingui/react/macro';
9
8
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -89,16 +88,14 @@ function AdministratorListPage() {
89
88
  },
90
89
  ]}
91
90
  >
92
- <PageActionBarRight>
93
- <PermissionGuard requires={['CreateAdministrator']}>
94
- <Button asChild>
95
- <Link to="./new">
96
- <PlusIcon />
97
- New Administrator
98
- </Link>
99
- </Button>
100
- </PermissionGuard>
101
- </PageActionBarRight>
91
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateAdministrator']}>
92
+ <Button asChild>
93
+ <Link to="./new">
94
+ <PlusIcon />
95
+ New Administrator
96
+ </Link>
97
+ </Button>
98
+ </ActionBarItem>
102
99
  </ListPage>
103
100
  );
104
101
  }
@@ -1,15 +1,14 @@
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 { RoleSelector } from '@/vdb/components/shared/role-selector.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
  CustomFieldsPageBlock,
10
10
  Page,
11
11
  PageActionBar,
12
- PageActionBarRight,
13
12
  PageBlock,
14
13
  PageLayout,
15
14
  PageTitle,
@@ -99,16 +98,14 @@ function AdministratorDetailPage() {
99
98
  <PageTitle>{creatingNewEntity ? <Trans>New administrator</Trans> : name}</PageTitle>
100
99
 
101
100
  <PageActionBar>
102
- <PageActionBarRight>
103
- <PermissionGuard requires={['UpdateAdministrator']}>
104
- <Button
105
- type="submit"
106
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
107
- >
108
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
109
- </Button>
110
- </PermissionGuard>
111
- </PageActionBarRight>
101
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateAdministrator']}>
102
+ <Button
103
+ type="submit"
104
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
105
+ >
106
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
107
+ </Button>
108
+ </ActionBarItem>
112
109
  </PageActionBar>
113
110
  <PageLayout>
114
111
  <PageBlock column="main" blockId="main-form">
@@ -3,15 +3,14 @@ import { AssetPreviewSelector } from '@/vdb/components/shared/asset/asset-previe
3
3
  import { PreviewPreset } from '@/vdb/components/shared/asset/asset-preview.js';
4
4
  import { AssetProperties } from '@/vdb/components/shared/asset/asset-properties.js';
5
5
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
6
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
7
6
  import { VendureImage } from '@/vdb/components/shared/vendure-image.js';
8
7
  import { Button } from '@/vdb/components/ui/button.js';
9
8
  import { Label } from '@/vdb/components/ui/label.js';
10
9
  import {
10
+ ActionBarItem,
11
11
  CustomFieldsPageBlock,
12
12
  Page,
13
13
  PageActionBar,
14
- PageActionBarRight,
15
14
  PageBlock,
16
15
  PageLayout,
17
16
  PageTitle,
@@ -95,13 +94,11 @@ function AssetDetailPage() {
95
94
  <Trans>Edit asset</Trans>
96
95
  </PageTitle>
97
96
  <PageActionBar>
98
- <PageActionBarRight>
99
- <PermissionGuard requires={['UpdateChannel']}>
100
- <Button type="submit" disabled={!form.formState.isDirty || isPending}>
101
- <Trans>Update</Trans>
102
- </Button>
103
- </PermissionGuard>
104
- </PageActionBarRight>
97
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateChannel']}>
98
+ <Button type="submit" disabled={!form.formState.isDirty || isPending}>
99
+ <Trans>Update</Trans>
100
+ </Button>
101
+ </ActionBarItem>
105
102
  </PageActionBar>
106
103
  <PageLayout>
107
104
  <PageBlock column="main" blockId="asset-preview">
@@ -1,8 +1,7 @@
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 { 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 { useLocalFormat } from '@/vdb/hooks/use-local-format.js';
8
7
  import { Trans } from '@lingui/react/macro';
@@ -66,16 +65,14 @@ function ChannelListPage() {
66
65
  },
67
66
  ]}
68
67
  >
69
- <PageActionBarRight>
70
- <PermissionGuard requires={['CreateChannel']}>
71
- <Button asChild>
72
- <Link to="./new">
73
- <PlusIcon className="mr-2 h-4 w-4" />
74
- <Trans>New Channel</Trans>
75
- </Link>
76
- </Button>
77
- </PermissionGuard>
78
- </PageActionBarRight>
68
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateChannel']}>
69
+ <Button asChild>
70
+ <Link to="./new">
71
+ <PlusIcon className="mr-2 h-4 w-4" />
72
+ <Trans>New Channel</Trans>
73
+ </Link>
74
+ </Button>
75
+ </ActionBarItem>
79
76
  </ListPage>
80
77
  );
81
78
  }
@@ -3,7 +3,6 @@ import { CurrencySelector } from '@/vdb/components/shared/currency-selector.js';
3
3
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
4
4
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
5
5
  import { LanguageSelector } from '@/vdb/components/shared/language-selector.js';
6
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
7
6
  import { SellerSelector } from '@/vdb/components/shared/seller-selector.js';
8
7
  import { ZoneSelector } from '@/vdb/components/shared/zone-selector.js';
9
8
  import { Button } from '@/vdb/components/ui/button.js';
@@ -11,11 +10,11 @@ import { Input } from '@/vdb/components/ui/input.js';
11
10
  import { Switch } from '@/vdb/components/ui/switch.js';
12
11
  import { DEFAULT_CHANNEL_CODE, NEW_ENTITY_PATH } from '@/vdb/constants.js';
13
12
  import {
13
+ ActionBarItem,
14
14
  CustomFieldsPageBlock,
15
15
  DetailFormGrid,
16
16
  Page,
17
17
  PageActionBar,
18
- PageActionBarRight,
19
18
  PageBlock,
20
19
  PageLayout,
21
20
  PageTitle,
@@ -116,16 +115,14 @@ function ChannelDetailPage() {
116
115
  )}
117
116
  </PageTitle>
118
117
  <PageActionBar>
119
- <PageActionBarRight>
120
- <PermissionGuard requires={['UpdateChannel']}>
121
- <Button
122
- type="submit"
123
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
124
- >
125
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
126
- </Button>
127
- </PermissionGuard>
128
- </PageActionBarRight>
118
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateChannel']}>
119
+ <Button
120
+ type="submit"
121
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
122
+ >
123
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
124
+ </Button>
125
+ </ActionBarItem>
129
126
  </PageActionBar>
130
127
  <PageLayout>
131
128
  <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 { api } from '@/vdb/graphql/api.js';
7
6
  import { Trans } from '@lingui/react/macro';
@@ -239,16 +238,14 @@ function CollectionListPage() {
239
238
  },
240
239
  ]}
241
240
  >
242
- <PageActionBarRight>
243
- <PermissionGuard requires={['CreateCollection', 'CreateCatalog']}>
244
- <Button asChild>
245
- <Link to="./new">
246
- <PlusIcon className="mr-2 h-4 w-4" />
247
- <Trans>New Collection</Trans>
248
- </Link>
249
- </Button>
250
- </PermissionGuard>
251
- </PageActionBarRight>
241
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateCollection', 'CreateCatalog']}>
242
+ <Button asChild>
243
+ <Link to="./new">
244
+ <PlusIcon className="mr-2 h-4 w-4" />
245
+ <Trans>New Collection</Trans>
246
+ </Link>
247
+ </Button>
248
+ </ActionBarItem>
252
249
  </ListPage>
253
250
  </>
254
251
  );
@@ -3,7 +3,6 @@ import { RichTextInput } from '@/vdb/components/data-input/rich-text-input.js';
3
3
  import { EntityAssets } from '@/vdb/components/shared/entity-assets.js';
4
4
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
5
5
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
6
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
7
6
  import { TranslatableFormFieldWrapper } from '@/vdb/components/shared/translatable-form-field.js';
8
7
  import { Button } from '@/vdb/components/ui/button.js';
9
8
  import { FormControl, FormDescription, FormItem, FormLabel, FormMessage } from '@/vdb/components/ui/form.js';
@@ -11,11 +10,11 @@ import { Input } from '@/vdb/components/ui/input.js';
11
10
  import { Switch } from '@/vdb/components/ui/switch.js';
12
11
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
13
12
  import {
13
+ ActionBarItem,
14
14
  CustomFieldsPageBlock,
15
15
  DetailFormGrid,
16
16
  Page,
17
17
  PageActionBar,
18
- PageActionBarRight,
19
18
  PageBlock,
20
19
  PageLayout,
21
20
  PageTitle,
@@ -115,16 +114,14 @@ function CollectionDetailPage() {
115
114
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
116
115
  <PageTitle>{creatingNewEntity ? <Trans>New collection</Trans> : (entity?.name ?? '')}</PageTitle>
117
116
  <PageActionBar>
118
- <PageActionBarRight>
119
- <PermissionGuard requires={['UpdateCollection', 'UpdateCatalog']}>
120
- <Button
121
- type="submit"
122
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
123
- >
124
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
125
- </Button>
126
- </PermissionGuard>
127
- </PageActionBarRight>
117
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateCollection', 'UpdateCatalog']}>
118
+ <Button
119
+ type="submit"
120
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
121
+ >
122
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
123
+ </Button>
124
+ </ActionBarItem>
128
125
  </PageActionBar>
129
126
  <PageLayout>
130
127
  <PageBlock column="side" blockId="privacy">
@@ -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';
@@ -57,16 +56,14 @@ function CountryListPage() {
57
56
  },
58
57
  ]}
59
58
  >
60
- <PageActionBarRight>
61
- <PermissionGuard requires={['CreateCountry']}>
62
- <Button asChild>
63
- <Link to="./new">
64
- <PlusIcon />
65
- <Trans>Add Country</Trans>
66
- </Link>
67
- </Button>
68
- </PermissionGuard>
69
- </PageActionBarRight>
59
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateCountry']}>
60
+ <Button asChild>
61
+ <Link to="./new">
62
+ <PlusIcon />
63
+ <Trans>Add Country</Trans>
64
+ </Link>
65
+ </Button>
66
+ </ActionBarItem>
70
67
  </ListPage>
71
68
  );
72
69
  }
@@ -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 { Switch } from '@/vdb/components/ui/switch.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,
@@ -78,16 +77,14 @@ function CountryDetailPage() {
78
77
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
79
78
  <PageTitle>{creatingNewEntity ? <Trans>New country</Trans> : (entity?.name ?? '')}</PageTitle>
80
79
  <PageActionBar>
81
- <PageActionBarRight>
82
- <PermissionGuard requires={['UpdateCountry']}>
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={['UpdateCountry']}>
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="side" blockId="enabled">
@@ -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';
@@ -57,16 +56,14 @@ function CustomerGroupListPage() {
57
56
  },
58
57
  ]}
59
58
  >
60
- <PageActionBarRight>
61
- <PermissionGuard requires={['CreateCustomerGroup']}>
62
- <Button asChild>
63
- <Link to="./new">
64
- <PlusIcon className="mr-2 h-4 w-4" />
65
- <Trans>New Customer Group</Trans>
66
- </Link>
67
- </Button>
68
- </PermissionGuard>
69
- </PageActionBarRight>
59
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateCustomerGroup']}>
60
+ <Button asChild>
61
+ <Link to="./new">
62
+ <PlusIcon className="mr-2 h-4 w-4" />
63
+ <Trans>New Customer Group</Trans>
64
+ </Link>
65
+ </Button>
66
+ </ActionBarItem>
70
67
  </ListPage>
71
68
  );
72
69
  }
@@ -1,15 +1,14 @@
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 { NEW_ENTITY_PATH } from '@/vdb/constants.js';
7
6
  import {
7
+ ActionBarItem,
8
8
  CustomFieldsPageBlock,
9
9
  DetailFormGrid,
10
10
  Page,
11
11
  PageActionBar,
12
- PageActionBarRight,
13
12
  PageBlock,
14
13
  PageLayout,
15
14
  PageTitle,
@@ -87,16 +86,14 @@ function CustomerGroupDetailPage() {
87
86
  {creatingNewEntity ? <Trans>New customer group</Trans> : (entity?.name ?? '')}
88
87
  </PageTitle>
89
88
  <PageActionBar>
90
- <PageActionBarRight>
91
- <PermissionGuard requires={['UpdateCustomerGroup']}>
92
- <Button
93
- type="submit"
94
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
95
- >
96
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
97
- </Button>
98
- </PermissionGuard>
99
- </PageActionBarRight>
89
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateCustomerGroup']}>
90
+ <Button
91
+ type="submit"
92
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
93
+ >
94
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
95
+ </Button>
96
+ </ActionBarItem>
100
97
  </PageActionBar>
101
98
  <PageLayout>
102
99
  <PageBlock column="main" blockId="main-form">
@@ -2,4 +2,3 @@ export * from './customer-history-container.js';
2
2
  export * from './customer-history-utils.js';
3
3
  export * from './customer-history.js';
4
4
  export * from './default-customer-history-components.js';
5
- export * from './default-customer-history-registry.js';
@@ -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';
@@ -89,16 +88,14 @@ function CustomerListPage() {
89
88
  },
90
89
  ]}
91
90
  >
92
- <PageActionBarRight>
93
- <PermissionGuard requires={['CreateCustomer']}>
94
- <Button asChild>
95
- <Link to="./new">
96
- <PlusIcon />
97
- <Trans>New Customer</Trans>
98
- </Link>
99
- </Button>
100
- </PermissionGuard>
101
- </PageActionBarRight>
91
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateCustomer']}>
92
+ <Button asChild>
93
+ <Link to="./new">
94
+ <PlusIcon />
95
+ <Trans>New Customer</Trans>
96
+ </Link>
97
+ </Button>
98
+ </ActionBarItem>
102
99
  </ListPage>
103
100
  );
104
101
  }
@@ -2,7 +2,6 @@ import { CustomerGroupChip } from '@/vdb/components/shared/customer-group-chip.j
2
2
  import { CustomerGroupSelector } from '@/vdb/components/shared/customer-group-selector.js';
3
3
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
4
4
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
5
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
6
5
  import { Button } from '@/vdb/components/ui/button.js';
7
6
  import {
8
7
  Dialog,
@@ -15,11 +14,11 @@ import {
15
14
  import { Input } from '@/vdb/components/ui/input.js';
16
15
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
17
16
  import {
17
+ ActionBarItem,
18
18
  CustomFieldsPageBlock,
19
19
  DetailFormGrid,
20
20
  Page,
21
21
  PageActionBar,
22
- PageActionBarRight,
23
22
  PageBlock,
24
23
  PageLayout,
25
24
  PageTitle,
@@ -146,16 +145,14 @@ function CustomerDetailPage() {
146
145
  <Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
147
146
  <PageTitle>{creatingNewEntity ? <Trans>New customer</Trans> : customerName}</PageTitle>
148
147
  <PageActionBar>
149
- <PageActionBarRight>
150
- <PermissionGuard requires={['UpdateCustomer']}>
151
- <Button
152
- type="submit"
153
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
154
- >
155
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
156
- </Button>
157
- </PermissionGuard>
158
- </PageActionBarRight>
148
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateCustomer']}>
149
+ <Button
150
+ type="submit"
151
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
152
+ >
153
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
154
+ </Button>
155
+ </ActionBarItem>
159
156
  </PageActionBar>
160
157
  <PageLayout>
161
158
  <PageBlock column="main" blockId="main-form">
@@ -1,10 +1,9 @@
1
1
  import { DataTableCellComponent } from '@/vdb/components/data-table/types.js';
2
2
  import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
3
3
  import { FacetValueChip } from '@/vdb/components/shared/facet-value-chip.js';
4
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
5
4
  import { Badge } from '@/vdb/components/ui/badge.js';
6
5
  import { Button } from '@/vdb/components/ui/button.js';
7
- import { PageActionBarRight } from '@/vdb/framework/layout-engine/page-layout.js';
6
+ import { ActionBarItem } from '@/vdb/framework/layout-engine/page-layout.js';
8
7
  import { ListPage } from '@/vdb/framework/page/list-page.js';
9
8
  import { Trans } from '@lingui/react/macro';
10
9
  import { createFileRoute, Link } from '@tanstack/react-router';
@@ -122,16 +121,14 @@ function FacetListPage() {
122
121
  ]}
123
122
  route={Route}
124
123
  >
125
- <PageActionBarRight>
126
- <PermissionGuard requires={['CreateFacet', 'CreateCatalog']}>
127
- <Button asChild>
128
- <Link to="./new">
129
- <PlusIcon className="mr-2 h-4 w-4" />
130
- <Trans>New Facet</Trans>
131
- </Link>
132
- </Button>
133
- </PermissionGuard>
134
- </PageActionBarRight>
124
+ <ActionBarItem itemId="create-button" requiresPermission={['CreateFacet', 'CreateCatalog']}>
125
+ <Button asChild>
126
+ <Link to="./new">
127
+ <PlusIcon className="mr-2 h-4 w-4" />
128
+ <Trans>New Facet</Trans>
129
+ </Link>
130
+ </Button>
131
+ </ActionBarItem>
135
132
  </ListPage>
136
133
  );
137
134
  }
@@ -2,17 +2,16 @@ import { SlugInput } from '@/vdb/components/data-input/index.js';
2
2
  import { PageBreadcrumb } from '@/vdb/components/layout/generated-breadcrumbs.js';
3
3
  import { ErrorPage } from '@/vdb/components/shared/error-page.js';
4
4
  import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
5
- import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js';
6
5
  import { TranslatableFormFieldWrapper } from '@/vdb/components/shared/translatable-form-field.js';
7
6
  import { Button } from '@/vdb/components/ui/button.js';
8
7
  import { Input } from '@/vdb/components/ui/input.js';
9
8
  import { NEW_ENTITY_PATH } from '@/vdb/constants.js';
10
9
  import {
10
+ ActionBarItem,
11
11
  CustomFieldsPageBlock,
12
12
  DetailFormGrid,
13
13
  Page,
14
14
  PageActionBar,
15
- PageActionBarRight,
16
15
  PageBlock,
17
16
  PageLayout,
18
17
  PageTitle,
@@ -104,16 +103,14 @@ function FacetValueDetailPage() {
104
103
  {creatingNewEntity ? <Trans>New facet value</Trans> : ((entity as any)?.name ?? '')}
105
104
  </PageTitle>
106
105
  <PageActionBar>
107
- <PageActionBarRight>
108
- <PermissionGuard requires={['UpdateProduct', 'UpdateCatalog']}>
109
- <Button
110
- type="submit"
111
- disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
112
- >
113
- {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
114
- </Button>
115
- </PermissionGuard>
116
- </PageActionBarRight>
106
+ <ActionBarItem itemId="save-button" requiresPermission={['UpdateProduct', 'UpdateCatalog']}>
107
+ <Button
108
+ type="submit"
109
+ disabled={!form.formState.isDirty || !form.formState.isValid || isPending}
110
+ >
111
+ {creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
112
+ </Button>
113
+ </ActionBarItem>
117
114
  </PageActionBar>
118
115
  <PageLayout>
119
116
  {entity?.facet && (