@vendure/dashboard 3.3.6-master-202507011151 → 3.3.6-master-202507020959

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.
Files changed (86) hide show
  1. package/package.json +4 -4
  2. package/src/app/common/delete-bulk-action.tsx +147 -0
  3. package/src/app/common/duplicate-bulk-action.tsx +1 -1
  4. package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +9 -0
  5. package/src/app/routes/_authenticated/_administrators/administrators.tsx +7 -0
  6. package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +15 -0
  7. package/src/app/routes/_authenticated/_assets/assets.graphql.ts +11 -0
  8. package/src/app/routes/_authenticated/_assets/assets.tsx +10 -2
  9. package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +45 -0
  10. package/src/app/routes/_authenticated/_channels/channels.graphql.ts +9 -0
  11. package/src/app/routes/_authenticated/_channels/channels.tsx +7 -0
  12. package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +15 -0
  13. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +39 -110
  14. package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +15 -0
  15. package/src/app/routes/_authenticated/_countries/countries.graphql.ts +9 -0
  16. package/src/app/routes/_authenticated/_countries/countries.tsx +7 -0
  17. package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +15 -0
  18. package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +9 -0
  19. package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +7 -0
  20. package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +15 -0
  21. package/src/app/routes/_authenticated/_customers/customers.graphql.ts +9 -1
  22. package/src/app/routes/_authenticated/_customers/customers.tsx +7 -0
  23. package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +104 -0
  24. package/src/app/routes/_authenticated/_facets/facets.graphql.ts +30 -0
  25. package/src/app/routes/_authenticated/_facets/facets.tsx +24 -0
  26. package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +58 -0
  27. package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +27 -0
  28. package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +30 -8
  29. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +4 -1
  30. package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +36 -110
  31. package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +36 -105
  32. package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +82 -0
  33. package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +25 -0
  34. package/src/app/routes/_authenticated/_promotions/promotions.tsx +24 -0
  35. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +1 -1
  36. package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +15 -0
  37. package/src/app/routes/_authenticated/_roles/roles.graphql.ts +9 -0
  38. package/src/app/routes/_authenticated/_roles/roles.tsx +7 -0
  39. package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +15 -0
  40. package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +9 -0
  41. package/src/app/routes/_authenticated/_sellers/sellers.tsx +7 -0
  42. package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +1 -1
  43. package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +61 -0
  44. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +27 -0
  45. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +19 -0
  46. package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +58 -0
  47. package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +25 -0
  48. package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +19 -0
  49. package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +15 -0
  50. package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +9 -0
  51. package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +7 -0
  52. package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +15 -0
  53. package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +9 -0
  54. package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +7 -0
  55. package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +15 -0
  56. package/src/app/routes/_authenticated/_zones/zones.graphql.ts +9 -0
  57. package/src/app/routes/_authenticated/_zones/zones.tsx +7 -0
  58. package/src/lib/components/shared/asset/asset-bulk-actions.tsx +90 -0
  59. package/src/lib/components/shared/asset/asset-gallery.tsx +12 -7
  60. package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +70 -0
  61. package/src/{app/routes/_authenticated/_products/components → lib/components/shared}/assign-to-channel-dialog.tsx +48 -30
  62. package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +89 -0
  63. package/src/lib/framework/component-registry/component-registry.tsx +31 -47
  64. package/src/lib/framework/extension-api/define-dashboard-extension.ts +29 -95
  65. package/src/lib/framework/extension-api/display-component-extensions.tsx +69 -0
  66. package/src/lib/framework/extension-api/extension-api-types.ts +18 -160
  67. package/src/lib/framework/extension-api/input-component-extensions.tsx +69 -0
  68. package/src/lib/framework/extension-api/logic/alerts.ts +10 -0
  69. package/src/lib/framework/extension-api/logic/data-table.ts +60 -0
  70. package/src/lib/framework/extension-api/logic/detail-forms.ts +48 -0
  71. package/src/lib/framework/extension-api/logic/form-components.ts +13 -0
  72. package/src/lib/framework/extension-api/logic/index.ts +8 -0
  73. package/src/lib/framework/extension-api/logic/layout.ts +22 -0
  74. package/src/lib/framework/extension-api/logic/navigation.ts +37 -0
  75. package/src/lib/framework/extension-api/logic/widgets.ts +10 -0
  76. package/src/lib/framework/extension-api/types/alerts.ts +54 -0
  77. package/src/lib/framework/extension-api/types/data-table.ts +64 -0
  78. package/src/lib/framework/extension-api/types/detail-forms.ts +81 -0
  79. package/src/lib/framework/extension-api/types/form-components.ts +32 -0
  80. package/src/lib/framework/extension-api/types/index.ts +8 -0
  81. package/src/lib/framework/extension-api/types/layout.ts +78 -0
  82. package/src/lib/framework/extension-api/types/navigation.ts +19 -0
  83. package/src/lib/framework/extension-api/types/widgets.ts +94 -0
  84. package/src/lib/framework/page/detail-page.tsx +48 -3
  85. package/src/lib/framework/registry/registry-types.ts +3 -0
  86. package/src/app/routes/_authenticated/_collections/components/assign-collections-to-channel-dialog.tsx +0 -110
@@ -1,110 +0,0 @@
1
- import { useMutation } from '@tanstack/react-query';
2
- import { useState } from 'react';
3
- import { toast } from 'sonner';
4
-
5
- import { ChannelCodeLabel } from '@/components/shared/channel-code-label.js';
6
- import { Button } from '@/components/ui/button.js';
7
- import {
8
- Dialog,
9
- DialogContent,
10
- DialogDescription,
11
- DialogFooter,
12
- DialogHeader,
13
- DialogTitle,
14
- } from '@/components/ui/dialog.js';
15
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select.js';
16
- import { ResultOf } from '@/graphql/graphql.js';
17
- import { Trans, useLingui } from '@/lib/trans.js';
18
-
19
- import { useChannel } from '@/hooks/use-channel.js';
20
-
21
- interface AssignCollectionsToChannelDialogProps {
22
- open: boolean;
23
- onOpenChange: (open: boolean) => void;
24
- entityIds: string[];
25
- mutationFn: (variables: any) => Promise<ResultOf<any>>;
26
- onSuccess?: () => void;
27
- }
28
-
29
- export function AssignCollectionsToChannelDialog({
30
- open,
31
- onOpenChange,
32
- entityIds,
33
- mutationFn,
34
- onSuccess,
35
- }: AssignCollectionsToChannelDialogProps) {
36
- const { i18n } = useLingui();
37
- const [selectedChannelId, setSelectedChannelId] = useState<string>('');
38
- const { channels, selectedChannel } = useChannel();
39
-
40
- // Filter out the currently selected channel from available options
41
- const availableChannels = channels.filter(channel => channel.id !== selectedChannel?.id);
42
-
43
- const { mutate, isPending } = useMutation({
44
- mutationFn,
45
- onSuccess: () => {
46
- toast.success(i18n.t(`Successfully assigned ${entityIds.length} collections to channel`));
47
- onSuccess?.();
48
- onOpenChange(false);
49
- },
50
- onError: () => {
51
- toast.error(`Failed to assign ${entityIds.length} collections to channel`);
52
- },
53
- });
54
-
55
- const handleAssign = () => {
56
- if (!selectedChannelId) {
57
- toast.error('Please select a channel');
58
- return;
59
- }
60
-
61
- const input = {
62
- collectionIds: entityIds,
63
- channelId: selectedChannelId,
64
- };
65
-
66
- mutate({ input });
67
- };
68
-
69
- return (
70
- <Dialog open={open} onOpenChange={onOpenChange}>
71
- <DialogContent className="sm:max-w-[425px]">
72
- <DialogHeader>
73
- <DialogTitle>
74
- <Trans>Assign collections to channel</Trans>
75
- </DialogTitle>
76
- <DialogDescription>
77
- <Trans>Select a channel to assign {entityIds.length} collections to</Trans>
78
- </DialogDescription>
79
- </DialogHeader>
80
- <div className="grid gap-4 py-4">
81
- <div className="grid gap-2">
82
- <label className="text-sm font-medium">
83
- <Trans>Channel</Trans>
84
- </label>
85
- <Select value={selectedChannelId} onValueChange={setSelectedChannelId}>
86
- <SelectTrigger>
87
- <SelectValue placeholder={i18n.t('Select a channel')} />
88
- </SelectTrigger>
89
- <SelectContent>
90
- {availableChannels.map(channel => (
91
- <SelectItem key={channel.id} value={channel.id}>
92
- <ChannelCodeLabel code={channel.code} />
93
- </SelectItem>
94
- ))}
95
- </SelectContent>
96
- </Select>
97
- </div>
98
- </div>
99
- <DialogFooter>
100
- <Button variant="outline" onClick={() => onOpenChange(false)}>
101
- <Trans>Cancel</Trans>
102
- </Button>
103
- <Button onClick={handleAssign} disabled={!selectedChannelId || isPending}>
104
- <Trans>Assign</Trans>
105
- </Button>
106
- </DialogFooter>
107
- </DialogContent>
108
- </Dialog>
109
- );
110
- }