@vendure/dashboard 3.3.6-master-202507010243 → 3.3.6-master-202507010731
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/package.json +4 -4
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +7 -2
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +9 -5
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +8 -5
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +5 -2
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +6 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +9 -5
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +8 -4
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +8 -4
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +50 -0
- package/src/lib/framework/document-extension/extend-document.spec.ts +335 -0
- package/src/lib/framework/document-introspection/add-custom-fields.ts +48 -0
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +19 -1
- package/src/lib/framework/extension-api/extension-api-types.ts +15 -2
- package/src/lib/framework/form-engine/custom-form-component-extensions.ts +13 -3
- package/src/lib/framework/layout-engine/page-layout.tsx +1 -0
- package/src/lib/framework/page/detail-page-route-loader.tsx +13 -1
- package/src/lib/framework/page/use-detail-page.ts +11 -2
- package/src/lib/framework/registry/registry-types.ts +1 -0
- package/src/lib/graphql/graphql-env.d.ts +8 -6
- package/src/lib/hooks/use-extended-detail-query.ts +37 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/dashboard",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.3.6-master-
|
|
4
|
+
"version": "3.3.6-master-202507010731",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"@types/react-dom": "^19.0.4",
|
|
87
87
|
"@types/react-grid-layout": "^1.3.5",
|
|
88
88
|
"@uidotdev/usehooks": "^2.4.1",
|
|
89
|
-
"@vendure/common": "^3.3.6-master-
|
|
90
|
-
"@vendure/core": "^3.3.6-master-
|
|
89
|
+
"@vendure/common": "^3.3.6-master-202507010731",
|
|
90
|
+
"@vendure/core": "^3.3.6-master-202507010731",
|
|
91
91
|
"@vitejs/plugin-react": "^4.3.4",
|
|
92
92
|
"awesome-graphql-client": "^2.1.0",
|
|
93
93
|
"class-variance-authority": "^0.7.1",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"lightningcss-linux-arm64-musl": "^1.29.3",
|
|
131
131
|
"lightningcss-linux-x64-musl": "^1.29.1"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "f5da386affaa5dcc54296a51228e2a7e5d3b0f84"
|
|
134
134
|
}
|
|
@@ -26,9 +26,12 @@ import {
|
|
|
26
26
|
} from './administrators.graphql.js';
|
|
27
27
|
import { RolePermissionsDisplay } from './components/role-permissions-display.js';
|
|
28
28
|
|
|
29
|
+
const pageId = 'administrator-detail';
|
|
30
|
+
|
|
29
31
|
export const Route = createFileRoute('/_authenticated/_administrators/administrators_/$id')({
|
|
30
32
|
component: AdministratorDetailPage,
|
|
31
33
|
loader: detailPageRouteLoader({
|
|
34
|
+
pageId,
|
|
32
35
|
queryDocument: administratorDetailDocument,
|
|
33
36
|
breadcrumb: (isNew, entity) => {
|
|
34
37
|
const name = `${entity?.firstName} ${entity?.lastName}`;
|
|
@@ -48,6 +51,7 @@ function AdministratorDetailPage() {
|
|
|
48
51
|
const { i18n } = useLingui();
|
|
49
52
|
|
|
50
53
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
54
|
+
pageId,
|
|
51
55
|
queryDocument: administratorDetailDocument,
|
|
52
56
|
createDocument: createAdministratorDocument,
|
|
53
57
|
updateDocument: updateAdministratorDocument,
|
|
@@ -87,7 +91,7 @@ function AdministratorDetailPage() {
|
|
|
87
91
|
const roleIds = form.watch('roleIds');
|
|
88
92
|
|
|
89
93
|
return (
|
|
90
|
-
<Page pageId=
|
|
94
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
91
95
|
<PageTitle>{creatingNewEntity ? <Trans>New administrator</Trans> : name}</PageTitle>
|
|
92
96
|
|
|
93
97
|
<PageActionBar>
|
|
@@ -25,9 +25,13 @@ import { FocusIcon } from 'lucide-react';
|
|
|
25
25
|
import { useRef, useState } from 'react';
|
|
26
26
|
import { toast } from 'sonner';
|
|
27
27
|
import { assetDetailDocument, assetUpdateDocument } from './assets.graphql.js';
|
|
28
|
+
|
|
29
|
+
const pageId = 'asset-detail';
|
|
30
|
+
|
|
28
31
|
export const Route = createFileRoute('/_authenticated/_assets/assets_/$id')({
|
|
29
32
|
component: AssetDetailPage,
|
|
30
33
|
loader: detailPageRouteLoader({
|
|
34
|
+
pageId,
|
|
31
35
|
queryDocument: assetDetailDocument,
|
|
32
36
|
breadcrumb(isNew, entity) {
|
|
33
37
|
return [
|
|
@@ -49,7 +53,8 @@ function AssetDetailPage() {
|
|
|
49
53
|
const [height, setHeight] = useState(0);
|
|
50
54
|
const [focalPoint, setFocalPoint] = useState<Point | undefined>(undefined);
|
|
51
55
|
const [settingFocalPoint, setSettingFocalPoint] = useState(false);
|
|
52
|
-
const { form, submitHandler, entity, isPending } = useDetailPage({
|
|
56
|
+
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
57
|
+
pageId,
|
|
53
58
|
queryDocument: assetDetailDocument,
|
|
54
59
|
updateDocument: assetUpdateDocument,
|
|
55
60
|
setValuesForUpdate: entity => {
|
|
@@ -86,7 +91,7 @@ function AssetDetailPage() {
|
|
|
86
91
|
return null;
|
|
87
92
|
}
|
|
88
93
|
return (
|
|
89
|
-
<Page pageId=
|
|
94
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
90
95
|
<PageTitle>
|
|
91
96
|
<Trans>Edit asset</Trans>
|
|
92
97
|
</PageTitle>
|
|
@@ -27,9 +27,12 @@ import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
|
27
27
|
import { toast } from 'sonner';
|
|
28
28
|
import { channelDetailDocument, createChannelDocument, updateChannelDocument } from './channels.graphql.js';
|
|
29
29
|
|
|
30
|
+
const pageId = 'channel-detail';
|
|
31
|
+
|
|
30
32
|
export const Route = createFileRoute('/_authenticated/_channels/channels_/$id')({
|
|
31
33
|
component: ChannelDetailPage,
|
|
32
34
|
loader: detailPageRouteLoader({
|
|
35
|
+
pageId,
|
|
33
36
|
queryDocument: channelDetailDocument,
|
|
34
37
|
breadcrumb(isNew, entity) {
|
|
35
38
|
return [
|
|
@@ -48,6 +51,7 @@ function ChannelDetailPage() {
|
|
|
48
51
|
const { i18n } = useLingui();
|
|
49
52
|
|
|
50
53
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
54
|
+
pageId,
|
|
51
55
|
queryDocument: channelDetailDocument,
|
|
52
56
|
createDocument: createChannelDocument,
|
|
53
57
|
updateDocument: updateChannelDocument,
|
|
@@ -100,7 +104,7 @@ function ChannelDetailPage() {
|
|
|
100
104
|
const codeIsDefault = entity?.code === DEFAULT_CHANNEL_CODE;
|
|
101
105
|
|
|
102
106
|
return (
|
|
103
|
-
<Page pageId=
|
|
107
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
104
108
|
<PageTitle>
|
|
105
109
|
{creatingNewEntity ? (
|
|
106
110
|
<Trans>New channel</Trans>
|
|
@@ -33,9 +33,12 @@ import { CollectionContentsPreviewTable } from './components/collection-contents
|
|
|
33
33
|
import { CollectionContentsTable } from './components/collection-contents-table.js';
|
|
34
34
|
import { CollectionFiltersSelector } from './components/collection-filters-selector.js';
|
|
35
35
|
|
|
36
|
+
const pageId = 'collection-detail';
|
|
37
|
+
|
|
36
38
|
export const Route = createFileRoute('/_authenticated/_collections/collections_/$id')({
|
|
37
39
|
component: CollectionDetailPage,
|
|
38
40
|
loader: detailPageRouteLoader({
|
|
41
|
+
pageId,
|
|
39
42
|
queryDocument: collectionDetailDocument,
|
|
40
43
|
breadcrumb: (isNew, entity) => [
|
|
41
44
|
{ path: '/collections', label: 'Collections' },
|
|
@@ -52,6 +55,7 @@ function CollectionDetailPage() {
|
|
|
52
55
|
const { i18n } = useLingui();
|
|
53
56
|
|
|
54
57
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
58
|
+
pageId,
|
|
55
59
|
queryDocument: collectionDetailDocument,
|
|
56
60
|
createDocument: createCollectionDocument,
|
|
57
61
|
transformCreateInput: values => {
|
|
@@ -105,7 +109,7 @@ function CollectionDetailPage() {
|
|
|
105
109
|
const currentInheritFiltersValue = form.watch('inheritFilters');
|
|
106
110
|
|
|
107
111
|
return (
|
|
108
|
-
<Page pageId=
|
|
112
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
109
113
|
<PageTitle>{creatingNewEntity ? <Trans>New collection</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
110
114
|
<PageActionBar>
|
|
111
115
|
<PageActionBarRight>
|
|
@@ -21,12 +21,15 @@ import { useDetailPage } from '@/framework/page/use-detail-page.js';
|
|
|
21
21
|
import { Trans, useLingui } from '@/lib/trans.js';
|
|
22
22
|
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
23
23
|
import { toast } from 'sonner';
|
|
24
|
-
import {
|
|
24
|
+
import { countryDetailDocument, createCountryDocument, updateCountryDocument } from './countries.graphql.js';
|
|
25
|
+
|
|
26
|
+
const pageId = 'country-detail';
|
|
25
27
|
|
|
26
28
|
export const Route = createFileRoute('/_authenticated/_countries/countries_/$id')({
|
|
27
29
|
component: CountryDetailPage,
|
|
28
30
|
loader: detailPageRouteLoader({
|
|
29
|
-
|
|
31
|
+
pageId,
|
|
32
|
+
queryDocument: countryDetailDocument,
|
|
30
33
|
breadcrumb: (isNew, entity) => [
|
|
31
34
|
{ path: '/countries', label: 'Countries' },
|
|
32
35
|
isNew ? <Trans>New country</Trans> : entity?.name,
|
|
@@ -41,8 +44,9 @@ function CountryDetailPage() {
|
|
|
41
44
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
42
45
|
const { i18n } = useLingui();
|
|
43
46
|
|
|
44
|
-
const { form, submitHandler, entity, isPending } = useDetailPage({
|
|
45
|
-
|
|
47
|
+
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
48
|
+
pageId,
|
|
49
|
+
queryDocument: countryDetailDocument,
|
|
46
50
|
createDocument: createCountryDocument,
|
|
47
51
|
updateDocument: updateCountryDocument,
|
|
48
52
|
setValuesForUpdate: entity => {
|
|
@@ -71,7 +75,7 @@ function CountryDetailPage() {
|
|
|
71
75
|
});
|
|
72
76
|
|
|
73
77
|
return (
|
|
74
|
-
<Page pageId=
|
|
78
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
75
79
|
<PageTitle>{creatingNewEntity ? <Trans>New country</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
76
80
|
<PageActionBar>
|
|
77
81
|
<PageActionBarRight>
|
|
@@ -4,7 +4,6 @@ import { PermissionGuard } from '@/components/shared/permission-guard.js';
|
|
|
4
4
|
import { Button } from '@/components/ui/button.js';
|
|
5
5
|
import { Input } from '@/components/ui/input.js';
|
|
6
6
|
import { NEW_ENTITY_PATH } from '@/constants.js';
|
|
7
|
-
import { addCustomFields } from '@/framework/document-introspection/add-custom-fields.js';
|
|
8
7
|
import {
|
|
9
8
|
CustomFieldsPageBlock,
|
|
10
9
|
DetailFormGrid,
|
|
@@ -23,14 +22,17 @@ import { toast } from 'sonner';
|
|
|
23
22
|
import { CustomerGroupMembersTable } from './components/customer-group-members-table.js';
|
|
24
23
|
import {
|
|
25
24
|
createCustomerGroupDocument,
|
|
26
|
-
|
|
25
|
+
customerGroupDetailDocument,
|
|
27
26
|
updateCustomerGroupDocument,
|
|
28
27
|
} from './customer-groups.graphql.js';
|
|
29
28
|
|
|
29
|
+
const pageId = 'customer-group-detail';
|
|
30
|
+
|
|
30
31
|
export const Route = createFileRoute('/_authenticated/_customer-groups/customer-groups_/$id')({
|
|
31
32
|
component: CustomerGroupDetailPage,
|
|
32
33
|
loader: detailPageRouteLoader({
|
|
33
|
-
|
|
34
|
+
pageId,
|
|
35
|
+
queryDocument: customerGroupDetailDocument,
|
|
34
36
|
breadcrumb: (isNew, entity) => [
|
|
35
37
|
{ path: '/customer-groups', label: 'Customer groups' },
|
|
36
38
|
isNew ? <Trans>New customer group</Trans> : entity?.name,
|
|
@@ -46,7 +48,8 @@ function CustomerGroupDetailPage() {
|
|
|
46
48
|
const { i18n } = useLingui();
|
|
47
49
|
|
|
48
50
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
49
|
-
|
|
51
|
+
pageId,
|
|
52
|
+
queryDocument: customerGroupDetailDocument,
|
|
50
53
|
createDocument: createCustomerGroupDocument,
|
|
51
54
|
updateDocument: updateCustomerGroupDocument,
|
|
52
55
|
setValuesForUpdate: entity => {
|
|
@@ -72,7 +75,7 @@ function CustomerGroupDetailPage() {
|
|
|
72
75
|
});
|
|
73
76
|
|
|
74
77
|
return (
|
|
75
|
-
<Page pageId=
|
|
78
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
76
79
|
<PageTitle>
|
|
77
80
|
{creatingNewEntity ? <Trans>New customer group</Trans> : (entity?.name ?? '')}
|
|
78
81
|
</PageTitle>
|
|
@@ -47,9 +47,12 @@ import {
|
|
|
47
47
|
updateCustomerDocument,
|
|
48
48
|
} from './customers.graphql.js';
|
|
49
49
|
|
|
50
|
+
const pageId = 'customer-detail';
|
|
51
|
+
|
|
50
52
|
export const Route = createFileRoute('/_authenticated/_customers/customers_/$id')({
|
|
51
53
|
component: CustomerDetailPage,
|
|
52
54
|
loader: detailPageRouteLoader({
|
|
55
|
+
pageId,
|
|
53
56
|
queryDocument: customerDetailDocument,
|
|
54
57
|
breadcrumb: (isNew, entity) => [
|
|
55
58
|
{ path: '/customers', label: 'Customers' },
|
|
@@ -67,6 +70,7 @@ function CustomerDetailPage() {
|
|
|
67
70
|
const [newAddressOpen, setNewAddressOpen] = useState(false);
|
|
68
71
|
|
|
69
72
|
const { form, submitHandler, entity, isPending, refreshEntity, resetForm } = useDetailPage({
|
|
73
|
+
pageId,
|
|
70
74
|
queryDocument: customerDetailDocument,
|
|
71
75
|
createDocument: createCustomerDocument,
|
|
72
76
|
updateDocument: updateCustomerDocument,
|
|
@@ -137,7 +141,7 @@ function CustomerDetailPage() {
|
|
|
137
141
|
const customerName = entity ? `${entity.firstName} ${entity.lastName}` : '';
|
|
138
142
|
|
|
139
143
|
return (
|
|
140
|
-
<Page pageId=
|
|
144
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
141
145
|
<PageTitle>{creatingNewEntity ? <Trans>New customer</Trans> : customerName}</PageTitle>
|
|
142
146
|
<PageActionBar>
|
|
143
147
|
<PageActionBarRight>
|
|
@@ -24,9 +24,12 @@ import { toast } from 'sonner';
|
|
|
24
24
|
import { FacetValuesTable } from './components/facet-values-table.js';
|
|
25
25
|
import { createFacetDocument, facetDetailDocument, updateFacetDocument } from './facets.graphql.js';
|
|
26
26
|
|
|
27
|
+
const pageId = 'facet-detail';
|
|
28
|
+
|
|
27
29
|
export const Route = createFileRoute('/_authenticated/_facets/facets_/$id')({
|
|
28
30
|
component: FacetDetailPage,
|
|
29
31
|
loader: detailPageRouteLoader({
|
|
32
|
+
pageId,
|
|
30
33
|
queryDocument: facetDetailDocument,
|
|
31
34
|
breadcrumb(isNew, entity) {
|
|
32
35
|
return [{ path: '/facets', label: 'Facets' }, isNew ? <Trans>New facet</Trans> : entity?.name];
|
|
@@ -42,6 +45,7 @@ function FacetDetailPage() {
|
|
|
42
45
|
const { i18n } = useLingui();
|
|
43
46
|
|
|
44
47
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
48
|
+
pageId,
|
|
45
49
|
queryDocument: facetDetailDocument,
|
|
46
50
|
createDocument: createFacetDocument,
|
|
47
51
|
updateDocument: updateFacetDocument,
|
|
@@ -82,7 +86,7 @@ function FacetDetailPage() {
|
|
|
82
86
|
});
|
|
83
87
|
|
|
84
88
|
return (
|
|
85
|
-
<Page pageId=
|
|
89
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
86
90
|
<PageTitle>{creatingNewEntity ? <Trans>New facet</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
87
91
|
<PageActionBar>
|
|
88
92
|
<PageActionBarRight>
|
|
@@ -25,6 +25,8 @@ import { OrderTaxSummary } from './components/order-tax-summary.js';
|
|
|
25
25
|
import { PaymentDetails } from './components/payment-details.js';
|
|
26
26
|
import { orderDetailDocument } from './orders.graphql.js';
|
|
27
27
|
|
|
28
|
+
const pageId = 'order-detail';
|
|
29
|
+
|
|
28
30
|
export const Route = createFileRoute('/_authenticated/_orders/orders_/$id')({
|
|
29
31
|
component: OrderDetailPage,
|
|
30
32
|
loader: async ({ context, params }) => {
|
|
@@ -58,7 +60,8 @@ function OrderDetailPage() {
|
|
|
58
60
|
const params = Route.useParams();
|
|
59
61
|
const { i18n } = useLingui();
|
|
60
62
|
|
|
61
|
-
const { form, submitHandler, entity, isPending } = useDetailPage({
|
|
63
|
+
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
64
|
+
pageId,
|
|
62
65
|
queryDocument: orderDetailDocument,
|
|
63
66
|
setValuesForUpdate: entity => {
|
|
64
67
|
return {
|
|
@@ -83,7 +86,7 @@ function OrderDetailPage() {
|
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
return (
|
|
86
|
-
<Page pageId=
|
|
89
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
87
90
|
<PageTitle>{entity?.code ?? ''}</PageTitle>
|
|
88
91
|
<PageActionBar>
|
|
89
92
|
<PageActionBarRight>
|
|
@@ -30,9 +30,12 @@ import {
|
|
|
30
30
|
updatePaymentMethodDocument,
|
|
31
31
|
} from './payment-methods.graphql.js';
|
|
32
32
|
|
|
33
|
+
const pageId = 'payment-method-detail';
|
|
34
|
+
|
|
33
35
|
export const Route = createFileRoute('/_authenticated/_payment-methods/payment-methods_/$id')({
|
|
34
36
|
component: PaymentMethodDetailPage,
|
|
35
37
|
loader: detailPageRouteLoader({
|
|
38
|
+
pageId,
|
|
36
39
|
queryDocument: paymentMethodDetailDocument,
|
|
37
40
|
breadcrumb(_isNew, entity) {
|
|
38
41
|
return [{ path: '/payment-methods', label: 'Payment methods' }, entity?.name];
|
|
@@ -48,6 +51,7 @@ function PaymentMethodDetailPage() {
|
|
|
48
51
|
const { i18n } = useLingui();
|
|
49
52
|
|
|
50
53
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
54
|
+
pageId,
|
|
51
55
|
queryDocument: paymentMethodDetailDocument,
|
|
52
56
|
createDocument: createPaymentMethodDocument,
|
|
53
57
|
updateDocument: updatePaymentMethodDocument,
|
|
@@ -102,7 +106,7 @@ function PaymentMethodDetailPage() {
|
|
|
102
106
|
});
|
|
103
107
|
|
|
104
108
|
return (
|
|
105
|
-
<Page pageId=
|
|
109
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
106
110
|
<PageTitle>
|
|
107
111
|
{creatingNewEntity ? <Trans>New payment method</Trans> : (entity?.name ?? '')}
|
|
108
112
|
</PageTitle>
|
|
@@ -36,9 +36,12 @@ import {
|
|
|
36
36
|
updateProductVariantDocument,
|
|
37
37
|
} from './product-variants.graphql.js';
|
|
38
38
|
|
|
39
|
+
const pageId = 'product-variant-detail';
|
|
40
|
+
|
|
39
41
|
export const Route = createFileRoute('/_authenticated/_product-variants/product-variants_/$id')({
|
|
40
42
|
component: ProductVariantDetailPage,
|
|
41
43
|
loader: detailPageRouteLoader({
|
|
44
|
+
pageId,
|
|
42
45
|
queryDocument: productVariantDetailDocument,
|
|
43
46
|
breadcrumb(_isNew, entity, location) {
|
|
44
47
|
if ((location.search as any).from === 'product') {
|
|
@@ -62,6 +65,7 @@ function ProductVariantDetailPage() {
|
|
|
62
65
|
const { activeChannel } = useChannel();
|
|
63
66
|
|
|
64
67
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
68
|
+
pageId,
|
|
65
69
|
queryDocument: productVariantDetailDocument,
|
|
66
70
|
createDocument: createProductVariantDocument,
|
|
67
71
|
updateDocument: updateProductVariantDocument,
|
|
@@ -109,7 +113,7 @@ function ProductVariantDetailPage() {
|
|
|
109
113
|
const [price, taxCategoryId] = form.watch(['price', 'taxCategoryId']);
|
|
110
114
|
|
|
111
115
|
return (
|
|
112
|
-
<Page pageId=
|
|
116
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
113
117
|
<PageTitle>
|
|
114
118
|
{creatingNewEntity ? <Trans>New product variant</Trans> : (entity?.name ?? '')}
|
|
115
119
|
</PageTitle>
|
|
@@ -31,9 +31,12 @@ import { CreateProductVariantsDialog } from './components/create-product-variant
|
|
|
31
31
|
import { ProductVariantsTable } from './components/product-variants-table.js';
|
|
32
32
|
import { createProductDocument, productDetailDocument, updateProductDocument } from './products.graphql.js';
|
|
33
33
|
|
|
34
|
+
const pageId = 'product-detail';
|
|
35
|
+
|
|
34
36
|
export const Route = createFileRoute('/_authenticated/_products/products_/$id')({
|
|
35
37
|
component: ProductDetailPage,
|
|
36
38
|
loader: detailPageRouteLoader({
|
|
39
|
+
pageId,
|
|
37
40
|
queryDocument: productDetailDocument,
|
|
38
41
|
breadcrumb(isNew, entity) {
|
|
39
42
|
return [
|
|
@@ -53,6 +56,7 @@ function ProductDetailPage() {
|
|
|
53
56
|
const refreshRef = useRef<() => void>(() => {});
|
|
54
57
|
|
|
55
58
|
const { form, submitHandler, entity, isPending, refreshEntity, resetForm } = useDetailPage({
|
|
59
|
+
pageId,
|
|
56
60
|
entityName: 'Product',
|
|
57
61
|
queryDocument: productDetailDocument,
|
|
58
62
|
createDocument: createProductDocument,
|
|
@@ -91,7 +95,7 @@ function ProductDetailPage() {
|
|
|
91
95
|
});
|
|
92
96
|
|
|
93
97
|
return (
|
|
94
|
-
<Page pageId=
|
|
98
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
95
99
|
<PageTitle>{creatingNewEntity ? <Trans>New product</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
96
100
|
<PageActionBar>
|
|
97
101
|
<PageActionBarRight>
|
|
@@ -31,9 +31,12 @@ import {
|
|
|
31
31
|
updatePromotionDocument,
|
|
32
32
|
} from './promotions.graphql.js';
|
|
33
33
|
|
|
34
|
+
const pageId = 'promotion-detail';
|
|
35
|
+
|
|
34
36
|
export const Route = createFileRoute('/_authenticated/_promotions/promotions_/$id')({
|
|
35
37
|
component: PromotionDetailPage,
|
|
36
38
|
loader: detailPageRouteLoader({
|
|
39
|
+
pageId,
|
|
37
40
|
queryDocument: promotionDetailDocument,
|
|
38
41
|
breadcrumb(isNew, entity) {
|
|
39
42
|
return [
|
|
@@ -52,6 +55,7 @@ function PromotionDetailPage() {
|
|
|
52
55
|
const { i18n } = useLingui();
|
|
53
56
|
|
|
54
57
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
58
|
+
pageId,
|
|
55
59
|
queryDocument: promotionDetailDocument,
|
|
56
60
|
createDocument: createPromotionDocument,
|
|
57
61
|
transformCreateInput: values => {
|
|
@@ -114,7 +118,7 @@ function PromotionDetailPage() {
|
|
|
114
118
|
});
|
|
115
119
|
|
|
116
120
|
return (
|
|
117
|
-
<Page pageId=
|
|
121
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
118
122
|
<PageTitle>{creatingNewEntity ? <Trans>New promotion</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
119
123
|
<PageActionBar>
|
|
120
124
|
<PageActionBarRight>
|
|
@@ -22,9 +22,12 @@ import { toast } from 'sonner';
|
|
|
22
22
|
import { PermissionsGrid } from './components/permissions-grid.js';
|
|
23
23
|
import { createRoleDocument, roleDetailDocument, updateRoleDocument } from './roles.graphql.js';
|
|
24
24
|
|
|
25
|
+
const pageId = 'role-detail';
|
|
26
|
+
|
|
25
27
|
export const Route = createFileRoute('/_authenticated/_roles/roles_/$id')({
|
|
26
28
|
component: RoleDetailPage,
|
|
27
29
|
loader: detailPageRouteLoader({
|
|
30
|
+
pageId,
|
|
28
31
|
queryDocument: roleDetailDocument,
|
|
29
32
|
breadcrumb(isNew, entity) {
|
|
30
33
|
return [
|
|
@@ -43,6 +46,7 @@ function RoleDetailPage() {
|
|
|
43
46
|
const { i18n } = useLingui();
|
|
44
47
|
|
|
45
48
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
49
|
+
pageId,
|
|
46
50
|
queryDocument: roleDetailDocument,
|
|
47
51
|
createDocument: createRoleDocument,
|
|
48
52
|
updateDocument: updateRoleDocument,
|
|
@@ -71,7 +75,7 @@ function RoleDetailPage() {
|
|
|
71
75
|
});
|
|
72
76
|
|
|
73
77
|
return (
|
|
74
|
-
<Page pageId=
|
|
78
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
75
79
|
<PageTitle>{creatingNewEntity ? <Trans>New role</Trans> : (entity?.description ?? '')}</PageTitle>
|
|
76
80
|
<PageActionBar>
|
|
77
81
|
<PageActionBarRight>
|
|
@@ -20,9 +20,12 @@ import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
|
20
20
|
import { toast } from 'sonner';
|
|
21
21
|
import { createSellerDocument, sellerDetailDocument, updateSellerDocument } from './sellers.graphql.js';
|
|
22
22
|
|
|
23
|
+
const pageId = 'seller-detail';
|
|
24
|
+
|
|
23
25
|
export const Route = createFileRoute('/_authenticated/_sellers/sellers_/$id')({
|
|
24
26
|
component: SellerDetailPage,
|
|
25
27
|
loader: detailPageRouteLoader({
|
|
28
|
+
pageId,
|
|
26
29
|
queryDocument: sellerDetailDocument,
|
|
27
30
|
breadcrumb: (isNew, entity) => [
|
|
28
31
|
{ path: '/sellers', label: 'Sellers' },
|
|
@@ -38,7 +41,8 @@ function SellerDetailPage() {
|
|
|
38
41
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
39
42
|
const { i18n } = useLingui();
|
|
40
43
|
|
|
41
|
-
const { form, submitHandler, entity, isPending } = useDetailPage({
|
|
44
|
+
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
45
|
+
pageId,
|
|
42
46
|
queryDocument: sellerDetailDocument,
|
|
43
47
|
createDocument: createSellerDocument,
|
|
44
48
|
updateDocument: updateSellerDocument,
|
|
@@ -65,7 +69,7 @@ function SellerDetailPage() {
|
|
|
65
69
|
});
|
|
66
70
|
|
|
67
71
|
return (
|
|
68
|
-
<Page pageId=
|
|
72
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
69
73
|
<PageTitle>{creatingNewEntity ? <Trans>New seller</Trans> : (entity?.name ?? '')}</PageTitle>
|
|
70
74
|
<PageActionBar>
|
|
71
75
|
<PageActionBarRight>
|
|
@@ -30,9 +30,12 @@ import {
|
|
|
30
30
|
updateShippingMethodDocument,
|
|
31
31
|
} from './shipping-methods.graphql.js';
|
|
32
32
|
|
|
33
|
+
const pageId = 'shipping-method-detail';
|
|
34
|
+
|
|
33
35
|
export const Route = createFileRoute('/_authenticated/_shipping-methods/shipping-methods_/$id')({
|
|
34
36
|
component: ShippingMethodDetailPage,
|
|
35
37
|
loader: detailPageRouteLoader({
|
|
38
|
+
pageId,
|
|
36
39
|
queryDocument: shippingMethodDetailDocument,
|
|
37
40
|
breadcrumb(isNew, entity) {
|
|
38
41
|
return [
|
|
@@ -51,6 +54,7 @@ function ShippingMethodDetailPage() {
|
|
|
51
54
|
const { i18n } = useLingui();
|
|
52
55
|
|
|
53
56
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
57
|
+
pageId,
|
|
54
58
|
queryDocument: shippingMethodDetailDocument,
|
|
55
59
|
createDocument: createShippingMethodDocument,
|
|
56
60
|
updateDocument: updateShippingMethodDocument,
|
|
@@ -94,7 +98,7 @@ function ShippingMethodDetailPage() {
|
|
|
94
98
|
});
|
|
95
99
|
|
|
96
100
|
return (
|
|
97
|
-
<Page pageId=
|
|
101
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
98
102
|
<PageTitle>
|
|
99
103
|
{creatingNewEntity ? <Trans>New shipping method</Trans> : (entity?.name ?? '')}
|
|
100
104
|
</PageTitle>
|
|
@@ -26,9 +26,12 @@ import {
|
|
|
26
26
|
updateStockLocationDocument,
|
|
27
27
|
} from './stock-locations.graphql.js';
|
|
28
28
|
|
|
29
|
+
const pageId = 'stock-location-detail';
|
|
30
|
+
|
|
29
31
|
export const Route = createFileRoute('/_authenticated/_stock-locations/stock-locations_/$id')({
|
|
30
32
|
component: StockLocationDetailPage,
|
|
31
33
|
loader: detailPageRouteLoader({
|
|
34
|
+
pageId,
|
|
32
35
|
queryDocument: stockLocationDetailQuery,
|
|
33
36
|
breadcrumb(isNew, entity) {
|
|
34
37
|
return [
|
|
@@ -47,6 +50,7 @@ function StockLocationDetailPage() {
|
|
|
47
50
|
const { i18n } = useLingui();
|
|
48
51
|
|
|
49
52
|
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
53
|
+
pageId,
|
|
50
54
|
queryDocument: stockLocationDetailQuery,
|
|
51
55
|
createDocument: createStockLocationDocument,
|
|
52
56
|
updateDocument: updateStockLocationDocument,
|
|
@@ -74,7 +78,7 @@ function StockLocationDetailPage() {
|
|
|
74
78
|
});
|
|
75
79
|
|
|
76
80
|
return (
|
|
77
|
-
<Page pageId=
|
|
81
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
78
82
|
<PageTitle>
|
|
79
83
|
{creatingNewEntity ? <Trans>New stock location</Trans> : (entity?.name ?? '')}
|
|
80
84
|
</PageTitle>
|
|
@@ -22,14 +22,17 @@ import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
|
22
22
|
import { toast } from 'sonner';
|
|
23
23
|
import {
|
|
24
24
|
createTaxCategoryDocument,
|
|
25
|
-
|
|
25
|
+
taxCategoryDetailDocument,
|
|
26
26
|
updateTaxCategoryDocument,
|
|
27
27
|
} from './tax-categories.graphql.js';
|
|
28
28
|
|
|
29
|
+
const pageId = 'tax-category-detail';
|
|
30
|
+
|
|
29
31
|
export const Route = createFileRoute('/_authenticated/_tax-categories/tax-categories_/$id')({
|
|
30
32
|
component: TaxCategoryDetailPage,
|
|
31
33
|
loader: detailPageRouteLoader({
|
|
32
|
-
|
|
34
|
+
pageId,
|
|
35
|
+
queryDocument: taxCategoryDetailDocument,
|
|
33
36
|
breadcrumb(isNew, entity) {
|
|
34
37
|
return [
|
|
35
38
|
{ path: '/tax-categories', label: 'Tax categories' },
|
|
@@ -46,8 +49,9 @@ function TaxCategoryDetailPage() {
|
|
|
46
49
|
const creatingNewEntity = params.id === NEW_ENTITY_PATH;
|
|
47
50
|
const { i18n } = useLingui();
|
|
48
51
|
|
|
49
|
-
const { form, submitHandler, entity, isPending } = useDetailPage({
|
|
50
|
-
|
|
52
|
+
const { form, submitHandler, entity, isPending, resetForm } = useDetailPage({
|
|
53
|
+
pageId,
|
|
54
|
+
queryDocument: taxCategoryDetailDocument,
|
|
51
55
|
createDocument: createTaxCategoryDocument,
|
|
52
56
|
updateDocument: updateTaxCategoryDocument,
|
|
53
57
|
setValuesForUpdate: entity => {
|
|
@@ -73,7 +77,7 @@ function TaxCategoryDetailPage() {
|
|
|
73
77
|
});
|
|
74
78
|
|
|
75
79
|
return (
|
|
76
|
-
<Page pageId=
|
|
80
|
+
<Page pageId={pageId} form={form} submitHandler={submitHandler} entity={entity}>
|
|
77
81
|
<PageTitle>
|
|
78
82
|
{creatingNewEntity ? <Trans>New tax category</Trans> : (entity?.name ?? '')}
|
|
79
83
|
</PageTitle>
|