@vendure/dashboard 3.3.4-master-202506181256 → 3.3.4-master-202506181504
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.4-master-
|
|
4
|
+
"version": "3.3.4-master-202506181504",
|
|
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.4-master-
|
|
90
|
-
"@vendure/core": "^3.3.4-master-
|
|
89
|
+
"@vendure/common": "^3.3.4-master-202506181504",
|
|
90
|
+
"@vendure/core": "^3.3.4-master-202506181504",
|
|
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": "6b6d55f050655378698459826c8f4786e5648afb"
|
|
134
134
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { DateTimeInput } from '@/components/data-input/datetime-input.js';
|
|
1
2
|
import { FormFieldWrapper } from '@/components/shared/form-field-wrapper.js';
|
|
3
|
+
import { Button } from '@/components/ui/button.js';
|
|
4
|
+
import { Checkbox } from '@/components/ui/checkbox.js';
|
|
2
5
|
import { Input } from '@/components/ui/input.js';
|
|
6
|
+
import { NEW_ENTITY_PATH } from '@/constants.js';
|
|
3
7
|
import { useDetailPage } from '@/framework/page/use-detail-page.js';
|
|
4
8
|
import { Trans } from '@/lib/trans.js';
|
|
5
9
|
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
6
10
|
import { AnyRoute, useNavigate } from '@tanstack/react-router';
|
|
7
11
|
import { ResultOf, VariablesOf } from 'gql.tada';
|
|
8
|
-
import { DateTimeInput } from '@/components/data-input/datetime-input.js';
|
|
9
|
-
import { Button } from '@/components/ui/button.js';
|
|
10
|
-
import { Checkbox } from '@/components/ui/checkbox.js';
|
|
11
|
-
import { NEW_ENTITY_PATH } from '@/constants.js';
|
|
12
12
|
import { toast } from 'sonner';
|
|
13
13
|
import { getOperationVariablesFields } from '../document-introspection/get-document-structure.js';
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
+
CustomFieldsPageBlock,
|
|
16
17
|
DetailFormGrid,
|
|
17
18
|
Page,
|
|
18
19
|
PageActionBar,
|
|
@@ -37,6 +38,11 @@ export interface DetailPageProps<
|
|
|
37
38
|
U extends TypedDocumentNode<any, any>,
|
|
38
39
|
EntityField extends keyof ResultOf<T> = DetailEntityPath<T>,
|
|
39
40
|
> {
|
|
41
|
+
/**
|
|
42
|
+
* @description
|
|
43
|
+
* The name of the entity.
|
|
44
|
+
*/
|
|
45
|
+
entityName?: string;
|
|
40
46
|
/**
|
|
41
47
|
* @description
|
|
42
48
|
* A unique identifier for the page.
|
|
@@ -94,6 +100,7 @@ export function DetailPage<
|
|
|
94
100
|
>({
|
|
95
101
|
pageId,
|
|
96
102
|
route,
|
|
103
|
+
entityName,
|
|
97
104
|
queryDocument,
|
|
98
105
|
createDocument,
|
|
99
106
|
updateDocument,
|
|
@@ -110,7 +117,7 @@ export function DetailPage<
|
|
|
110
117
|
createDocument,
|
|
111
118
|
params: { id: params.id },
|
|
112
119
|
setValuesForUpdate,
|
|
113
|
-
onSuccess: async
|
|
120
|
+
onSuccess: async data => {
|
|
114
121
|
toast.success('Updated successfully');
|
|
115
122
|
resetForm();
|
|
116
123
|
const id = (data as any).id;
|
|
@@ -143,41 +150,53 @@ export function DetailPage<
|
|
|
143
150
|
<PageLayout>
|
|
144
151
|
<PageBlock column="main" blockId="main-form">
|
|
145
152
|
<DetailFormGrid>
|
|
146
|
-
{updateFields
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
153
|
+
{updateFields
|
|
154
|
+
.filter(fieldInfo => fieldInfo.name !== 'customFields')
|
|
155
|
+
.map(fieldInfo => {
|
|
156
|
+
if (fieldInfo.name === 'id' && fieldInfo.type === 'ID') {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return (
|
|
160
|
+
<FormFieldWrapper
|
|
161
|
+
key={fieldInfo.name}
|
|
162
|
+
control={form.control}
|
|
163
|
+
name={fieldInfo.name as never}
|
|
164
|
+
label={fieldInfo.name}
|
|
165
|
+
render={({ field }) => {
|
|
166
|
+
switch (fieldInfo.type) {
|
|
167
|
+
case 'Int':
|
|
168
|
+
case 'Float':
|
|
169
|
+
return (
|
|
170
|
+
<Input
|
|
171
|
+
type="number"
|
|
172
|
+
value={field.value}
|
|
173
|
+
onChange={e =>
|
|
174
|
+
field.onChange(e.target.valueAsNumber)
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
case 'DateTime':
|
|
179
|
+
return <DateTimeInput {...field} />;
|
|
180
|
+
case 'Boolean':
|
|
181
|
+
return (
|
|
182
|
+
<Checkbox
|
|
183
|
+
value={field.value}
|
|
184
|
+
onCheckedChange={field.onChange}
|
|
185
|
+
/>
|
|
186
|
+
);
|
|
187
|
+
case 'String':
|
|
188
|
+
default:
|
|
189
|
+
return <Input {...field} />;
|
|
190
|
+
}
|
|
191
|
+
}}
|
|
192
|
+
/>
|
|
193
|
+
);
|
|
194
|
+
})}
|
|
179
195
|
</DetailFormGrid>
|
|
180
196
|
</PageBlock>
|
|
197
|
+
{entityName && (
|
|
198
|
+
<CustomFieldsPageBlock column="main" entityType={entityName} control={form.control} />
|
|
199
|
+
)}
|
|
181
200
|
</PageLayout>
|
|
182
201
|
</Page>
|
|
183
202
|
);
|