@vendure/dashboard 3.3.5 → 3.3.6-master-202506290242

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.3.5",
4
+ "version": "3.3.6-master-202506290242",
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.5",
90
- "@vendure/core": "3.3.5",
89
+ "@vendure/common": "^3.3.6-master-202506290242",
90
+ "@vendure/core": "^3.3.6-master-202506290242",
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": "71d36ec5164c833d9f05f6e8140db13c450f4d29"
133
+ "gitHead": "6d4bc0d2c892f4b081fc037ea9b88aa86885cb2f"
134
134
  }
@@ -3,10 +3,11 @@ import { NEW_ENTITY_PATH } from '@/constants.js';
3
3
  import { PageBreadcrumb } from '@/components/layout/generated-breadcrumbs.js';
4
4
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
5
5
  import { FileBaseRouteOptions } from '@tanstack/react-router';
6
+ import { addCustomFields } from '../document-introspection/add-custom-fields.js';
6
7
  import { getQueryName, getQueryTypeFieldInfo } from '../document-introspection/get-document-structure.js';
7
8
  import { DetailEntity } from './page-types.js';
8
9
  import { getDetailQueryOptions } from './use-detail-page.js';
9
- import { addCustomFields } from '../document-introspection/add-custom-fields.js';
10
+
10
11
  export interface DetailPageRouteLoaderConfig<T extends TypedDocumentNode<any, any>> {
11
12
  queryDocument: T;
12
13
  breadcrumb: (isNew: boolean, entity: DetailEntity<T>) => Array<PageBreadcrumb | undefined>;
@@ -16,7 +16,11 @@ import { FormEvent } from 'react';
16
16
  import { UseFormReturn } from 'react-hook-form';
17
17
 
18
18
  import { addCustomFields } from '../document-introspection/add-custom-fields.js';
19
- import { getMutationName, getQueryName } from '../document-introspection/get-document-structure.js';
19
+ import {
20
+ getEntityName,
21
+ getMutationName,
22
+ getQueryName,
23
+ } from '../document-introspection/get-document-structure.js';
20
24
  import { useGeneratedForm } from '../form-engine/use-generated-form.js';
21
25
 
22
26
  import { DetailEntityPath } from './page-types.js';
@@ -65,8 +69,9 @@ export interface DetailPageOptions<
65
69
  * @description
66
70
  * The entity type name for custom field configuration lookup.
67
71
  * Required to filter out readonly custom fields before mutations.
72
+ * If not provided, the function will try to infer it from the query document.
68
73
  */
69
- entityName: string;
74
+ entityName?: string;
70
75
  /**
71
76
  * @description
72
77
  * The document to create the entity.
@@ -246,7 +251,8 @@ export function useDetailPage<
246
251
  } = options;
247
252
  const isNew = params.id === NEW_ENTITY_PATH;
248
253
  const queryClient = useQueryClient();
249
- const customFieldConfig = useCustomFieldConfig(entityName);
254
+ const returnEntityName = entityName ?? getEntityName(queryDocument);
255
+ const customFieldConfig = useCustomFieldConfig(returnEntityName);
250
256
  const detailQueryOptions = getDetailQueryOptions(addCustomFields(queryDocument), {
251
257
  id: isNew ? '__NEW__' : params.id,
252
258
  });