@vendure/dashboard 3.4.3-master-202509190229 → 3.4.3-master-202509230228
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/vite-plugin-config.js +1 -0
- package/package.json +4 -4
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +1 -2
- package/src/app/routes/_authenticated/_assets/assets.graphql.ts +39 -0
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +18 -7
- package/src/app/routes/_authenticated/_assets/components/asset-tag-filter.tsx +206 -0
- package/src/app/routes/_authenticated/_assets/components/asset-tags-editor.tsx +226 -0
- package/src/app/routes/_authenticated/_assets/components/manage-tags-dialog.tsx +217 -0
- package/src/app/routes/_authenticated/_channels/channels.tsx +1 -2
- package/src/app/routes/_authenticated/_collections/collections.tsx +2 -16
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +2 -0
- package/src/app/routes/_authenticated/_countries/countries.tsx +1 -2
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +1 -2
- package/src/app/routes/_authenticated/_customers/customers.tsx +1 -2
- package/src/app/routes/_authenticated/_facets/facets.tsx +0 -1
- package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +302 -0
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +16 -0
- package/src/app/routes/_authenticated/_orders/components/seller-orders-card.tsx +61 -0
- package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +17 -10
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +31 -0
- package/src/app/routes/_authenticated/_orders/orders_.$aggregateOrderId_.seller-orders.$sellerOrderId.tsx +50 -0
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +17 -290
- package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +7 -39
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +4 -26
- package/src/app/routes/_authenticated/_orders/utils/order-detail-loaders.tsx +129 -0
- package/src/app/routes/_authenticated/_orders/utils/order-utils.ts +8 -0
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +1 -2
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +1 -2
- package/src/app/routes/_authenticated/_products/products.tsx +1 -2
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +1 -2
- package/src/app/routes/_authenticated/_roles/components/permissions-table-grid.tsx +251 -0
- package/src/app/routes/_authenticated/_roles/roles.tsx +1 -2
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +5 -3
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +1 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +1 -2
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +1 -2
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +1 -2
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +1 -2
- package/src/app/routes/_authenticated/_zones/zones.tsx +1 -2
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +5 -14
- package/src/lib/components/data-table/use-all-bulk-actions.ts +19 -0
- package/src/lib/components/data-table/use-generated-columns.tsx +12 -3
- package/src/lib/components/layout/nav-main.tsx +50 -25
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +1 -1
- package/src/lib/components/shared/asset/asset-gallery.tsx +83 -50
- package/src/lib/components/shared/detail-page-button.tsx +6 -4
- package/src/lib/components/shared/paginated-list-data-table.tsx +1 -0
- package/src/lib/components/shared/vendure-image.tsx +9 -1
- package/src/lib/framework/defaults.ts +24 -0
- package/src/lib/framework/extension-api/types/navigation.ts +8 -0
- package/src/lib/framework/layout-engine/page-layout.tsx +96 -9
- package/src/lib/framework/nav-menu/nav-menu-extensions.ts +26 -0
- package/src/lib/framework/page/list-page.tsx +7 -0
- package/src/lib/hooks/use-custom-field-config.ts +19 -2
- package/src/lib/index.ts +7 -1
- package/src/lib/providers/channel-provider.tsx +22 -6
- package/src/lib/providers/server-config.tsx +1 -0
- package/src/app/routes/_authenticated/_collections/components/move-single-collection.tsx +0 -33
- package/src/app/routes/_authenticated/_roles/components/permissions-grid.tsx +0 -120
- package/src/lib/components/shared/asset/focal-point-control.tsx +0 -57
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Accordion,
|
|
3
|
-
AccordionContent,
|
|
4
|
-
AccordionItem,
|
|
5
|
-
AccordionTrigger,
|
|
6
|
-
} from '@/vdb/components/ui/accordion.js';
|
|
7
|
-
import { Button } from '@/vdb/components/ui/button.js';
|
|
8
|
-
import { Switch } from '@/vdb/components/ui/switch.js';
|
|
9
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/vdb/components/ui/tooltip.js';
|
|
10
|
-
import { useGroupedPermissions } from '@/vdb/hooks/use-grouped-permissions.js';
|
|
11
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
12
|
-
import { ServerConfig } from '@/vdb/providers/server-config.js';
|
|
13
|
-
import { useState } from 'react';
|
|
14
|
-
|
|
15
|
-
interface PermissionsGridProps {
|
|
16
|
-
value: string[];
|
|
17
|
-
onChange: (permissions: string[]) => void;
|
|
18
|
-
readonly?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function PermissionsGrid({ value, onChange, readonly = false }: Readonly<PermissionsGridProps>) {
|
|
22
|
-
const { i18n } = useLingui();
|
|
23
|
-
const groupedPermissions = useGroupedPermissions();
|
|
24
|
-
|
|
25
|
-
const setPermission = (permission: string, checked: boolean) => {
|
|
26
|
-
if (readonly) return;
|
|
27
|
-
|
|
28
|
-
const newPermissions = checked ? [...value, permission] : value.filter(p => p !== permission);
|
|
29
|
-
onChange(newPermissions);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const toggleAll = (defs: ServerConfig['permissions']) => {
|
|
33
|
-
if (readonly) return;
|
|
34
|
-
|
|
35
|
-
const shouldEnable = defs.some(d => !value.includes(d.name));
|
|
36
|
-
const newPermissions = shouldEnable
|
|
37
|
-
? [...new Set([...value, ...defs.map(d => d.name)])]
|
|
38
|
-
: value.filter(p => !defs.some(d => d.name === p));
|
|
39
|
-
onChange(newPermissions);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Get default expanded sections based on which ones have active permissions
|
|
43
|
-
const defaultExpandedSections = groupedPermissions
|
|
44
|
-
.map(section => ({
|
|
45
|
-
section,
|
|
46
|
-
hasActivePermissions: section.permissions.some(permission => value.includes(permission.name)),
|
|
47
|
-
}))
|
|
48
|
-
.filter(({ hasActivePermissions }) => hasActivePermissions)
|
|
49
|
-
.map(({ section }) => section.id);
|
|
50
|
-
|
|
51
|
-
const [accordionValue, setAccordionValue] = useState<string[]>(defaultExpandedSections);
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className="w-full">
|
|
55
|
-
<Accordion
|
|
56
|
-
type="multiple"
|
|
57
|
-
value={accordionValue.length ? accordionValue : defaultExpandedSections}
|
|
58
|
-
onValueChange={setAccordionValue}
|
|
59
|
-
className="space-y-4"
|
|
60
|
-
>
|
|
61
|
-
{groupedPermissions.map((section, index) => (
|
|
62
|
-
<AccordionItem key={index} value={section.id} className="border rounded-lg px-6">
|
|
63
|
-
<AccordionTrigger className="hover:no-underline">
|
|
64
|
-
<div className="flex flex-col items-start gap-1 text-sm py-2">
|
|
65
|
-
<div>{i18n.t(section.label)}</div>
|
|
66
|
-
<div className="text-muted-foreground text-sm font-normal">
|
|
67
|
-
{i18n.t(section.description)}
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</AccordionTrigger>
|
|
71
|
-
<AccordionContent>
|
|
72
|
-
<div className="pb-4 space-y-4">
|
|
73
|
-
{section.permissions.length > 1 && !readonly && (
|
|
74
|
-
<Button
|
|
75
|
-
variant="outline"
|
|
76
|
-
type="button"
|
|
77
|
-
size="sm"
|
|
78
|
-
onClick={() => toggleAll(section.permissions)}
|
|
79
|
-
className="w-fit"
|
|
80
|
-
>
|
|
81
|
-
<Trans>Toggle all</Trans>
|
|
82
|
-
</Button>
|
|
83
|
-
)}
|
|
84
|
-
<div className="md:grid md:grid-cols-4 md:gap-2 space-y-2">
|
|
85
|
-
{section.permissions.map(permission => (
|
|
86
|
-
<div key={permission.name} className="flex items-center space-x-2">
|
|
87
|
-
<Switch
|
|
88
|
-
id={permission.name}
|
|
89
|
-
checked={value.includes(permission.name)}
|
|
90
|
-
onCheckedChange={checked =>
|
|
91
|
-
setPermission(permission.name, checked)
|
|
92
|
-
}
|
|
93
|
-
disabled={readonly}
|
|
94
|
-
/>
|
|
95
|
-
<TooltipProvider>
|
|
96
|
-
<Tooltip>
|
|
97
|
-
<TooltipTrigger asChild>
|
|
98
|
-
<label
|
|
99
|
-
htmlFor={permission.name}
|
|
100
|
-
className="text-sm whitespace-nowrap"
|
|
101
|
-
>
|
|
102
|
-
{i18n.t(permission.name)}
|
|
103
|
-
</label>
|
|
104
|
-
</TooltipTrigger>
|
|
105
|
-
<TooltipContent align="end">
|
|
106
|
-
<p>{i18n.t(permission.description)}</p>
|
|
107
|
-
</TooltipContent>
|
|
108
|
-
</Tooltip>
|
|
109
|
-
</TooltipProvider>
|
|
110
|
-
</div>
|
|
111
|
-
))}
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</AccordionContent>
|
|
115
|
-
</AccordionItem>
|
|
116
|
-
))}
|
|
117
|
-
</Accordion>
|
|
118
|
-
</div>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/vdb/lib/utils.js';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
|
|
4
|
-
export interface Point {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface FocalPointControlProps {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
point: Point;
|
|
13
|
-
onChange: (point: Point) => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function FocalPointControl({ width, height, point, onChange }: Readonly<FocalPointControlProps>) {
|
|
17
|
-
const [dragging, setDragging] = useState(false);
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!dragging) return;
|
|
21
|
-
|
|
22
|
-
const handleMouseMove = (e: MouseEvent) => {
|
|
23
|
-
const rect = (e.target as HTMLDivElement)?.getBoundingClientRect();
|
|
24
|
-
const x = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
25
|
-
const y = Math.max(0, Math.min(1, (e.clientY - rect.top) / rect.height));
|
|
26
|
-
onChange({ x, y });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const handleMouseUp = () => {
|
|
30
|
-
setDragging(false);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
34
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
35
|
-
|
|
36
|
-
return () => {
|
|
37
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
38
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
39
|
-
};
|
|
40
|
-
}, [dragging, onChange]);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="absolute inset-0 cursor-crosshair" onMouseDown={() => setDragging(true)}>
|
|
44
|
-
<div
|
|
45
|
-
className={cn(
|
|
46
|
-
'absolute w-6 h-6 border-2 border-white rounded-full -translate-x-1/2 -translate-y-1/2',
|
|
47
|
-
'shadow-[0_0_0_1px_rgba(0,0,0,0.3)]',
|
|
48
|
-
dragging && 'scale-75',
|
|
49
|
-
)}
|
|
50
|
-
style={{
|
|
51
|
-
left: `${point.x * width}px`,
|
|
52
|
-
top: `${point.y * height}px`,
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|