@vendure/dashboard 3.5.0-minor-202510201346 → 3.5.0
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/dist/vite/types.d.ts +39 -0
- package/dist/vite/utils/plugin-discovery.js +15 -4
- package/dist/vite/vite-plugin-ui-config.d.ts +27 -0
- package/dist/vite/vite-plugin-vendure-dashboard.d.ts +18 -1
- package/dist/vite/vite-plugin-vendure-dashboard.js +19 -7
- package/lingui.config.js +1 -0
- package/package.json +172 -172
- package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +88 -61
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +46 -47
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +12 -1
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +12 -7
- package/src/app/routes/_authenticated/_products/products.tsx +13 -1
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +8 -2
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +1 -0
- package/src/i18n/locales/ar.po +214 -186
- package/src/i18n/locales/cs.po +214 -186
- package/src/i18n/locales/de.po +214 -186
- package/src/i18n/locales/en.po +214 -186
- package/src/i18n/locales/es.po +214 -186
- package/src/i18n/locales/fa.po +214 -186
- package/src/i18n/locales/fr.po +214 -186
- package/src/i18n/locales/he.po +214 -186
- package/src/i18n/locales/hr.po +214 -186
- package/src/i18n/locales/it.po +214 -186
- package/src/i18n/locales/ja.po +214 -186
- package/src/i18n/locales/nb.po +214 -186
- package/src/i18n/locales/ne.po +214 -186
- package/src/i18n/locales/pl.po +214 -186
- package/src/i18n/locales/pt_BR.po +214 -186
- package/src/i18n/locales/pt_PT.po +214 -186
- package/src/i18n/locales/ru.po +214 -186
- package/src/i18n/locales/sv.po +214 -186
- package/src/i18n/locales/tr.po +214 -186
- package/src/i18n/locales/uk.po +214 -186
- package/src/i18n/locales/zh_Hans.po +214 -186
- package/src/i18n/locales/zh_Hant.po +214 -186
- package/src/lib/components/data-table/data-table-pagination.tsx +4 -4
- package/src/lib/components/data-table/data-table.stories.tsx +1 -1
- package/src/lib/components/data-table/data-table.tsx +1 -1
- package/src/lib/components/data-table/use-generated-columns.tsx +5 -1
- package/src/lib/components/layout/app-layout.tsx +0 -2
- package/src/lib/components/shared/asset/asset-gallery.stories.tsx +1 -1
- package/src/lib/components/shared/asset/asset-picker-dialog.stories.tsx +1 -1
- package/src/lib/components/shared/detail-page-button.stories.tsx +1 -1
- package/src/lib/components/shared/facet-value-selector.stories.tsx +1 -1
- package/src/lib/components/shared/paginated-list-data-table.stories.tsx +1 -1
- package/src/lib/components/shared/permission-guard.stories.tsx +1 -1
- package/src/lib/components/shared/vendure-image.stories.tsx +1 -1
- package/src/lib/index.ts +0 -1
- package/src/lib/components/layout/prerelease-popup.tsx +0 -34
package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Alert, AlertDescription, AlertTitle } from '@/vdb/components/ui/alert.j
|
|
|
3
3
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
4
4
|
import { addCustomFields } from '@/vdb/framework/document-introspection/add-custom-fields.js';
|
|
5
5
|
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
6
|
+
import { Trans } from '@lingui/react/macro';
|
|
6
7
|
import { useQuery } from '@tanstack/react-query';
|
|
7
8
|
import { Link } from '@tanstack/react-router';
|
|
8
9
|
import { ColumnFiltersState, SortingState } from '@tanstack/react-table';
|
|
@@ -52,7 +53,15 @@ export function CollectionContentsPreviewTable({
|
|
|
52
53
|
for (const arg of filterDef.args) {
|
|
53
54
|
const argPair = f.arguments.find(a => a.name === arg.name);
|
|
54
55
|
const argValue = argPair?.value ?? arg.defaultValue;
|
|
55
|
-
|
|
56
|
+
let isValidValue = true;
|
|
57
|
+
if (arg.list) {
|
|
58
|
+
try {
|
|
59
|
+
JSON.parse(argValue);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
isValidValue = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!isValidValue || (arg.required && argValue == null)) {
|
|
56
65
|
return false;
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -61,66 +70,84 @@ export function CollectionContentsPreviewTable({
|
|
|
61
70
|
|
|
62
71
|
return (
|
|
63
72
|
<div>
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
73
|
+
{effectiveFilters.length === 0 ? (
|
|
74
|
+
<Alert className="mb-4">
|
|
75
|
+
<Eye className="h-4 w-4" />
|
|
76
|
+
<AlertTitle>
|
|
77
|
+
<Trans>Preview</Trans>
|
|
78
|
+
</AlertTitle>
|
|
79
|
+
<AlertDescription>
|
|
80
|
+
<Trans>Add filters to preview the collection contents.</Trans>
|
|
81
|
+
</AlertDescription>
|
|
82
|
+
</Alert>
|
|
83
|
+
) : (
|
|
84
|
+
<>
|
|
85
|
+
<Alert className="mb-4">
|
|
86
|
+
<Eye className="h-4 w-4" />
|
|
87
|
+
<AlertTitle>
|
|
88
|
+
<Trans>Preview</Trans>
|
|
89
|
+
</AlertTitle>
|
|
90
|
+
<AlertDescription>
|
|
91
|
+
<Trans>
|
|
92
|
+
This is a preview of the collection contents based on the current filter
|
|
93
|
+
settings. Once you save the collection, the contents will be updated to
|
|
94
|
+
reflect the new filter settings.
|
|
95
|
+
</Trans>
|
|
96
|
+
</AlertDescription>
|
|
97
|
+
</Alert>
|
|
98
|
+
<PaginatedListDataTable
|
|
99
|
+
listQuery={addCustomFields(previewCollectionContentsDocument)}
|
|
100
|
+
transformQueryKey={queryKey => {
|
|
101
|
+
return [...queryKey, JSON.stringify(effectiveFilters), inheritFilters];
|
|
102
|
+
}}
|
|
103
|
+
transformVariables={variables => {
|
|
104
|
+
return {
|
|
105
|
+
options: variables.options,
|
|
106
|
+
input: {
|
|
107
|
+
parentId,
|
|
108
|
+
filters: effectiveFilters,
|
|
109
|
+
inheritFilters,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}}
|
|
113
|
+
customizeColumns={{
|
|
114
|
+
name: {
|
|
115
|
+
header: 'Variant name',
|
|
116
|
+
cell: ({ row }) => {
|
|
117
|
+
return (
|
|
118
|
+
<Button asChild variant="ghost">
|
|
119
|
+
<Link to={`../../product-variants/${row.original.id}`}>
|
|
120
|
+
{row.original.name}{' '}
|
|
121
|
+
</Link>
|
|
122
|
+
</Button>
|
|
123
|
+
);
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
}}
|
|
127
|
+
page={page}
|
|
128
|
+
itemsPerPage={pageSize}
|
|
129
|
+
sorting={sorting}
|
|
130
|
+
columnFilters={filters}
|
|
131
|
+
onPageChange={(_, page, perPage) => {
|
|
132
|
+
setPage(page);
|
|
133
|
+
setPageSize(perPage);
|
|
134
|
+
}}
|
|
135
|
+
onSortChange={(_, sorting) => {
|
|
136
|
+
setSorting(sorting);
|
|
137
|
+
}}
|
|
138
|
+
onFilterChange={(_, filters) => {
|
|
139
|
+
setFilters(filters);
|
|
140
|
+
}}
|
|
141
|
+
onSearchTermChange={searchTerm => {
|
|
142
|
+
return {
|
|
143
|
+
name: {
|
|
144
|
+
contains: searchTerm,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
</>
|
|
150
|
+
)}
|
|
124
151
|
</div>
|
|
125
152
|
);
|
|
126
153
|
}
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
DialogTitle,
|
|
15
15
|
} from '@/vdb/components/ui/dialog.js';
|
|
16
16
|
import { Input } from '@/vdb/components/ui/input.js';
|
|
17
|
-
import { ScrollArea } from '@/vdb/components/ui/scroll-area.js';
|
|
18
17
|
import { api } from '@/vdb/graphql/api.js';
|
|
19
18
|
import { Trans, useLingui } from '@lingui/react/macro';
|
|
20
19
|
import { ChevronRight, Folder, FolderOpen, Search } from 'lucide-react';
|
|
@@ -68,7 +67,7 @@ function TargetAlert({
|
|
|
68
67
|
collectionNameCache,
|
|
69
68
|
}: Readonly<TargetAlertProps>) {
|
|
70
69
|
return (
|
|
71
|
-
<Alert className={selectedCollectionId ? 'border-blue-200 bg-blue-50' : ''}>
|
|
70
|
+
<Alert className={selectedCollectionId ? 'border-blue-200 bg-blue-50' : 'opacity-50'}>
|
|
72
71
|
<Folder className="h-4 w-4" />
|
|
73
72
|
<AlertDescription>
|
|
74
73
|
{selectedCollectionId ? (
|
|
@@ -330,8 +329,8 @@ export function MoveCollectionsDialog({
|
|
|
330
329
|
|
|
331
330
|
return (
|
|
332
331
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
333
|
-
<DialogContent className="sm:max-w-[600px]
|
|
334
|
-
<DialogHeader>
|
|
332
|
+
<DialogContent className="sm:max-w-[600px] h-[90vh] flex flex-col p-0 gap-0">
|
|
333
|
+
<DialogHeader className="px-6 pt-6 pb-4">
|
|
335
334
|
<DialogTitle>
|
|
336
335
|
<Trans>Move Collections</Trans>
|
|
337
336
|
</DialogTitle>
|
|
@@ -345,7 +344,7 @@ export function MoveCollectionsDialog({
|
|
|
345
344
|
</Trans>
|
|
346
345
|
</DialogDescription>
|
|
347
346
|
</DialogHeader>
|
|
348
|
-
<div className="px-6 py-3 bg-muted/50 border-
|
|
347
|
+
<div className="px-6 py-3 bg-muted/50 border-y shrink-0">
|
|
349
348
|
<div className="flex flex-wrap gap-2">
|
|
350
349
|
{collectionsToMove.map(collection => (
|
|
351
350
|
<div
|
|
@@ -358,9 +357,9 @@ export function MoveCollectionsDialog({
|
|
|
358
357
|
))}
|
|
359
358
|
</div>
|
|
360
359
|
</div>
|
|
361
|
-
<div className="py-4">
|
|
362
|
-
<div className="
|
|
363
|
-
<div className="relative
|
|
360
|
+
<div className="flex-1 min-h-0 overflow-auto px-6 py-4">
|
|
361
|
+
<div className="h-full flex flex-col gap-3">
|
|
362
|
+
<div className="relative shrink-0">
|
|
364
363
|
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
365
364
|
<Input
|
|
366
365
|
placeholder={t`Filter by collection name`}
|
|
@@ -369,47 +368,47 @@ export function MoveCollectionsDialog({
|
|
|
369
368
|
className="pl-10"
|
|
370
369
|
/>
|
|
371
370
|
</div>
|
|
372
|
-
<
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
<
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
371
|
+
<div className="space-y-1">
|
|
372
|
+
{isLoading ? (
|
|
373
|
+
<div className="flex items-center justify-center py-8">
|
|
374
|
+
<Trans>Loading collections...</Trans>
|
|
375
|
+
</div>
|
|
376
|
+
) : (
|
|
377
|
+
<>
|
|
378
|
+
{!debouncedSearchTerm && !selectionHasTopLevelParent && (
|
|
379
|
+
<MoveToTopLevel
|
|
380
|
+
selectedCollectionId={selectedCollectionId}
|
|
381
|
+
topLevelCollectionId={topLevelCollectionId}
|
|
382
|
+
onSelect={setSelectedCollectionId}
|
|
383
|
+
/>
|
|
384
|
+
)}
|
|
385
|
+
{collections.map((collection: Collection) => (
|
|
386
|
+
<CollectionTreeNode
|
|
387
|
+
key={collection.id}
|
|
388
|
+
collection={collection}
|
|
389
|
+
depth={0}
|
|
390
|
+
expanded={expanded}
|
|
391
|
+
onToggleExpanded={handleToggleExpanded}
|
|
392
|
+
onSelect={handleSelect}
|
|
393
|
+
selectedCollectionId={selectedCollectionId}
|
|
394
|
+
collectionsToMove={collectionsToMove}
|
|
395
|
+
childCollectionsByParentId={childCollectionsByParentId}
|
|
396
|
+
/>
|
|
397
|
+
))}
|
|
398
|
+
</>
|
|
399
|
+
)}
|
|
400
|
+
</div>
|
|
401
|
+
<div className="shrink-0">
|
|
402
|
+
<TargetAlert
|
|
403
|
+
selectedCollectionId={selectedCollectionId}
|
|
404
|
+
collectionsToMove={collectionsToMove}
|
|
405
|
+
topLevelCollectionId={topLevelCollectionId}
|
|
406
|
+
collectionNameCache={collectionNameCache}
|
|
407
|
+
/>
|
|
408
|
+
</div>
|
|
410
409
|
</div>
|
|
411
410
|
</div>
|
|
412
|
-
<DialogFooter>
|
|
411
|
+
<DialogFooter className="px-6 pb-6 pt-4 shrink-0">
|
|
413
412
|
<Button variant="outline" onClick={() => onOpenChange(false)}>
|
|
414
413
|
<Trans>Cancel</Trans>
|
|
415
414
|
</Button>
|
|
@@ -77,8 +77,19 @@ function ProductListPage() {
|
|
|
77
77
|
},
|
|
78
78
|
}}
|
|
79
79
|
onSearchTermChange={searchTerm => {
|
|
80
|
+
return searchTerm
|
|
81
|
+
? {
|
|
82
|
+
name: { contains: searchTerm },
|
|
83
|
+
sku: { contains: searchTerm },
|
|
84
|
+
}
|
|
85
|
+
: {};
|
|
86
|
+
}}
|
|
87
|
+
transformVariables={variables => {
|
|
80
88
|
return {
|
|
81
|
-
|
|
89
|
+
options: {
|
|
90
|
+
...variables.options,
|
|
91
|
+
filterOperator: 'OR',
|
|
92
|
+
},
|
|
82
93
|
};
|
|
83
94
|
}}
|
|
84
95
|
route={Route}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MoneyInput } from '@/vdb/components/data-input/money-input.js';
|
|
2
2
|
import { NumberInput } from '@/vdb/components/data-input/number-input.js';
|
|
3
3
|
import { AssignedFacetValues } from '@/vdb/components/shared/assigned-facet-values.js';
|
|
4
|
+
import { DetailPageButton } from '@/vdb/components/shared/detail-page-button.js';
|
|
4
5
|
import { EntityAssets } from '@/vdb/components/shared/entity-assets.js';
|
|
5
6
|
import { ErrorPage } from '@/vdb/components/shared/error-page.js';
|
|
6
7
|
import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
|
|
@@ -234,7 +235,7 @@ function ProductVariantDetailPage() {
|
|
|
234
235
|
<TranslatableFormFieldWrapper
|
|
235
236
|
control={form.control}
|
|
236
237
|
name="name"
|
|
237
|
-
label={<Trans>
|
|
238
|
+
label={<Trans>Variant name</Trans>}
|
|
238
239
|
render={({ field }) => <Input {...field} />}
|
|
239
240
|
/>
|
|
240
241
|
|
|
@@ -422,21 +423,25 @@ function ProductVariantDetailPage() {
|
|
|
422
423
|
/>
|
|
423
424
|
</PageBlock>
|
|
424
425
|
|
|
425
|
-
<PageBlock column="side" blockId="facet-values">
|
|
426
|
+
<PageBlock column="side" blockId="facet-values" title={<Trans>Facet Values</Trans>}>
|
|
426
427
|
<FormFieldWrapper
|
|
427
428
|
control={form.control}
|
|
428
429
|
name="facetValueIds"
|
|
429
|
-
label={<Trans>Facet values</Trans>}
|
|
430
430
|
render={({ field }) => (
|
|
431
431
|
<AssignedFacetValues facetValues={entity?.facetValues ?? []} {...field} />
|
|
432
432
|
)}
|
|
433
433
|
/>
|
|
434
434
|
</PageBlock>
|
|
435
|
-
|
|
435
|
+
|
|
436
|
+
<PageBlock column="side" blockId="parent-product" title={<Trans>Parent product</Trans>}>
|
|
437
|
+
<DetailPageButton
|
|
438
|
+
label={entity?.product.name}
|
|
439
|
+
href={`/products/${entity?.product.id}`}
|
|
440
|
+
className="border"
|
|
441
|
+
/>
|
|
442
|
+
</PageBlock>
|
|
443
|
+
<PageBlock column="side" blockId="assets" title={<Trans>Assets</Trans>}>
|
|
436
444
|
<FormItem>
|
|
437
|
-
<FormLabel>
|
|
438
|
-
<Trans>Assets</Trans>
|
|
439
|
-
</FormLabel>
|
|
440
445
|
<FormControl>
|
|
441
446
|
<EntityAssets
|
|
442
447
|
assets={entity?.assets}
|
|
@@ -54,8 +54,20 @@ function ProductListPage() {
|
|
|
54
54
|
},
|
|
55
55
|
}}
|
|
56
56
|
onSearchTermChange={searchTerm => {
|
|
57
|
+
return searchTerm
|
|
58
|
+
? {
|
|
59
|
+
name: { contains: searchTerm },
|
|
60
|
+
slug: { contains: searchTerm },
|
|
61
|
+
sku: { contains: searchTerm },
|
|
62
|
+
}
|
|
63
|
+
: {};
|
|
64
|
+
}}
|
|
65
|
+
transformVariables={variables => {
|
|
57
66
|
return {
|
|
58
|
-
|
|
67
|
+
options: {
|
|
68
|
+
...variables.options,
|
|
69
|
+
filterOperator: 'OR',
|
|
70
|
+
},
|
|
59
71
|
};
|
|
60
72
|
}}
|
|
61
73
|
defaultVisibility={{
|
|
@@ -121,7 +121,13 @@ function ShippingMethodDetailPage() {
|
|
|
121
121
|
<PermissionGuard requires={['UpdateShippingMethod']}>
|
|
122
122
|
<Button
|
|
123
123
|
type="submit"
|
|
124
|
-
disabled={
|
|
124
|
+
disabled={
|
|
125
|
+
!form.formState.isDirty ||
|
|
126
|
+
!form.formState.isValid ||
|
|
127
|
+
isPending ||
|
|
128
|
+
!checker?.code ||
|
|
129
|
+
!calculator?.code
|
|
130
|
+
}
|
|
125
131
|
>
|
|
126
132
|
{creatingNewEntity ? <Trans>Create</Trans> : <Trans>Update</Trans>}
|
|
127
133
|
</Button>
|
|
@@ -163,7 +169,7 @@ function ShippingMethodDetailPage() {
|
|
|
163
169
|
/>
|
|
164
170
|
</DetailFormGrid>
|
|
165
171
|
</PageBlock>
|
|
166
|
-
<CustomFieldsPageBlock column="main" entityType="
|
|
172
|
+
<CustomFieldsPageBlock column="main" entityType="ShippingMethod" control={form.control} />
|
|
167
173
|
<PageBlock column="main" blockId="conditions" title={<Trans>Conditions</Trans>}>
|
|
168
174
|
<FormFieldWrapper
|
|
169
175
|
control={form.control}
|