@vendure/dashboard 3.3.8 → 3.4.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/README.md +62 -0
- package/dist/plugin/api/api-extensions.d.ts +1 -0
- package/dist/plugin/api/api-extensions.js +38 -0
- package/dist/plugin/api/metrics.resolver.d.ts +8 -0
- package/dist/plugin/api/metrics.resolver.js +40 -0
- package/dist/plugin/config/metrics-strategies.d.ts +39 -0
- package/dist/plugin/config/metrics-strategies.js +74 -0
- package/dist/plugin/constants.d.ts +4 -3
- package/dist/plugin/constants.js +10 -277
- package/dist/plugin/dashboard.plugin.d.ts +95 -0
- package/dist/plugin/dashboard.plugin.js +168 -0
- package/dist/plugin/index.d.ts +2 -1
- package/dist/plugin/index.js +18 -1
- package/dist/plugin/package.json +3 -0
- package/dist/plugin/service/metrics.service.d.ts +15 -0
- package/dist/plugin/service/metrics.service.js +145 -0
- package/dist/plugin/types.d.ts +20 -37
- package/dist/plugin/types.js +13 -1
- package/dist/vite/constants.d.ts +5 -0
- package/dist/vite/constants.js +277 -0
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.js +1 -0
- package/dist/vite/types.d.ts +40 -0
- package/dist/vite/utils/config-loader.js +1 -0
- package/dist/{plugin → vite}/utils/plugin-discovery.js +1 -1
- package/dist/vite/utils/ui-config.d.ts +3 -0
- package/dist/vite/utils/ui-config.js +30 -0
- package/dist/vite/vite-plugin-ui-config.d.ts +123 -0
- package/dist/{plugin → vite}/vite-plugin-ui-config.js +3 -11
- package/dist/{plugin → vite}/vite-plugin-vendure-dashboard.js +1 -1
- package/index.html +1 -1
- package/package.json +16 -7
- package/src/app/app-providers.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +20 -35
- package/src/app/routes/_authenticated/_facets/facets.graphql.ts +40 -0
- package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +147 -0
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +380 -33
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +1 -1
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +1 -1
- package/src/app/routes/_authenticated/_system/job-queue.tsx +1 -0
- package/src/app/routes/_authenticated/index.tsx +2 -2
- package/src/app/routes/_authenticated.tsx +1 -1
- package/src/lib/components/data-input/rich-text-input.tsx +14 -8
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +17 -4
- package/src/lib/components/layout/app-layout.tsx +2 -7
- package/src/lib/components/layout/channel-switcher.tsx +166 -57
- package/src/lib/components/layout/dev-mode-indicator.tsx +18 -0
- package/src/lib/components/layout/language-dialog.tsx +2 -1
- package/src/lib/components/layout/manage-languages-dialog.tsx +77 -40
- package/src/lib/components/layout/nav-item-wrapper.tsx +107 -0
- package/src/lib/components/layout/nav-main.tsx +196 -107
- package/src/lib/components/login/login-form.tsx +80 -45
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +19 -4
- package/src/lib/components/shared/asset/asset-gallery.tsx +2 -2
- package/src/lib/components/shared/detail-page-button.tsx +42 -0
- package/src/lib/components/shared/history-timeline/history-entry-date.tsx +37 -0
- package/src/lib/components/shared/history-timeline/history-entry.tsx +135 -65
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +4 -4
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +7 -54
- package/src/lib/components/shared/translatable-form-field.tsx +16 -2
- package/src/lib/framework/defaults.ts +4 -10
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +4 -0
- package/src/lib/framework/extension-api/extension-api-types.ts +11 -2
- package/src/lib/framework/extension-api/logic/index.ts +1 -0
- package/src/lib/framework/extension-api/logic/login.ts +17 -0
- package/src/lib/framework/extension-api/logic/navigation.ts +1 -0
- package/src/lib/framework/extension-api/types/data-table.ts +12 -3
- package/src/lib/framework/extension-api/types/detail-forms.ts +13 -0
- package/src/lib/framework/extension-api/types/form-components.ts +11 -0
- package/src/lib/framework/extension-api/types/index.ts +1 -0
- package/src/lib/framework/extension-api/types/layout.ts +3 -6
- package/src/lib/framework/extension-api/types/login.ts +96 -0
- package/src/lib/framework/extension-api/types/navigation.ts +57 -0
- package/src/lib/framework/extension-api/types/widgets.ts +0 -4
- package/src/lib/framework/extension-api/use-login-extensions.ts +26 -0
- package/src/lib/framework/layout-engine/dev-mode-button.tsx +24 -0
- package/src/lib/framework/layout-engine/location-wrapper.tsx +5 -12
- package/src/lib/framework/registry/global-registry.ts +4 -0
- package/src/lib/framework/registry/registry-types.ts +2 -0
- package/src/lib/graphql/api.ts +25 -3
- package/src/lib/graphql/graphql-env.d.ts +28 -28
- package/src/lib/graphql/settings-store-operations.ts +17 -0
- package/src/lib/hooks/use-floating-bulk-actions.ts +82 -0
- package/src/lib/hooks/use-local-format.ts +20 -5
- package/src/lib/index.ts +2 -1
- package/src/lib/providers/channel-provider.tsx +13 -11
- package/src/lib/providers/user-settings.tsx +78 -3
- package/src/lib/virtual.d.ts +26 -2
- package/src/vite-env.d.ts +2 -0
- package/vite/utils/plugin-discovery.ts +1 -1
- package/vite/utils/ui-config.ts +30 -42
- package/vite/vite-plugin-ui-config.ts +119 -17
- package/vite/vite-plugin-vendure-dashboard.ts +1 -1
- package/dist/plugin/utils/ui-config.d.ts +0 -3
- package/dist/plugin/utils/ui-config.js +0 -34
- package/dist/plugin/vite-plugin-ui-config.d.ts +0 -15
- package/src/app/routes/_authenticated/_facets/components/add-facet-value-dialog.tsx +0 -146
- package/src/lib/components/shared/rich-text-editor.tsx +0 -0
- /package/dist/{plugin/utils/ast-utils.spec.d.ts → vite/types.js} +0 -0
- /package/dist/{plugin → vite}/utils/ast-utils.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/ast-utils.js +0 -0
- /package/dist/{plugin/utils/config-loader.d.ts → vite/utils/ast-utils.spec.d.ts} +0 -0
- /package/dist/{plugin → vite}/utils/ast-utils.spec.js +0 -0
- /package/dist/{plugin → vite}/utils/compiler.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/compiler.js +0 -0
- /package/dist/{plugin/utils/config-loader.js → vite/utils/config-loader.d.ts} +0 -0
- /package/dist/{plugin → vite}/utils/logger.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/logger.js +0 -0
- /package/dist/{plugin → vite}/utils/plugin-discovery.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/schema-generator.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/schema-generator.js +0 -0
- /package/dist/{plugin → vite}/utils/tsconfig-utils.d.ts +0 -0
- /package/dist/{plugin → vite}/utils/tsconfig-utils.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-admin-api-schema.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-admin-api-schema.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-config-loader.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-config-loader.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-config.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-config.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-dashboard-metadata.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-dashboard-metadata.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-gql-tada.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-gql-tada.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-tailwind-source.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-tailwind-source.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-theme.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-theme.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-transform-index.d.ts +0 -0
- /package/dist/{plugin → vite}/vite-plugin-transform-index.js +0 -0
- /package/dist/{plugin → vite}/vite-plugin-vendure-dashboard.d.ts +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AdminUiConfig } from '@vendure/core';
|
|
2
|
-
import { Plugin } from 'vite';
|
|
3
|
-
export type UiConfigPluginOptions = {
|
|
4
|
-
/**
|
|
5
|
-
* @description
|
|
6
|
-
* The admin UI config to be passed to the Vendure Dashboard.
|
|
7
|
-
*/
|
|
8
|
-
adminUiConfig?: Partial<AdminUiConfig>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* This Vite plugin scans the configured plugins for any dashboard extensions and dynamically
|
|
12
|
-
* generates an import statement for each one, wrapped up in a `runDashboardExtensions()`
|
|
13
|
-
* function which can then be imported and executed in the Dashboard app.
|
|
14
|
-
*/
|
|
15
|
-
export declare function uiConfigPlugin({ adminUiConfig }: UiConfigPluginOptions): Plugin;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { FormFieldWrapper } from '@/vdb/components/shared/form-field-wrapper.js';
|
|
2
|
-
import { Button } from '@/vdb/components/ui/button.js';
|
|
3
|
-
import {
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogFooter,
|
|
7
|
-
DialogHeader,
|
|
8
|
-
DialogTitle,
|
|
9
|
-
DialogTrigger,
|
|
10
|
-
} from '@/vdb/components/ui/dialog.js';
|
|
11
|
-
import { Form } from '@/vdb/components/ui/form.js';
|
|
12
|
-
import { Input } from '@/vdb/components/ui/input.js';
|
|
13
|
-
import { api } from '@/vdb/graphql/api.js';
|
|
14
|
-
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
15
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
16
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
17
|
-
import { useMutation } from '@tanstack/react-query';
|
|
18
|
-
import { Plus } from 'lucide-react';
|
|
19
|
-
import { useCallback, useState } from 'react';
|
|
20
|
-
import { useForm } from 'react-hook-form';
|
|
21
|
-
import { toast } from 'sonner';
|
|
22
|
-
import * as z from 'zod';
|
|
23
|
-
|
|
24
|
-
const createFacetValuesDocument = graphql(`
|
|
25
|
-
mutation CreateFacetValues($input: [CreateFacetValueInput!]!) {
|
|
26
|
-
createFacetValues(input: $input) {
|
|
27
|
-
id
|
|
28
|
-
name
|
|
29
|
-
code
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`);
|
|
33
|
-
|
|
34
|
-
const formSchema = z.object({
|
|
35
|
-
name: z.string().min(1, 'Name is required'),
|
|
36
|
-
code: z.string().min(1, 'Code is required'),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
type FormValues = z.infer<typeof formSchema>;
|
|
40
|
-
|
|
41
|
-
export function AddFacetValueDialog({
|
|
42
|
-
facetId,
|
|
43
|
-
onSuccess,
|
|
44
|
-
}: Readonly<{
|
|
45
|
-
facetId: string;
|
|
46
|
-
onSuccess?: () => void;
|
|
47
|
-
}>) {
|
|
48
|
-
const [open, setOpen] = useState(false);
|
|
49
|
-
const { i18n } = useLingui();
|
|
50
|
-
|
|
51
|
-
const form = useForm<FormValues>({
|
|
52
|
-
resolver: zodResolver(formSchema),
|
|
53
|
-
defaultValues: {
|
|
54
|
-
name: '',
|
|
55
|
-
code: '',
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const createFacetValueMutation = useMutation({
|
|
60
|
-
mutationFn: api.mutate(createFacetValuesDocument),
|
|
61
|
-
onSuccess: () => {
|
|
62
|
-
toast.success(i18n.t('Successfully created facet value'));
|
|
63
|
-
setOpen(false);
|
|
64
|
-
form.reset();
|
|
65
|
-
onSuccess?.();
|
|
66
|
-
},
|
|
67
|
-
onError: error => {
|
|
68
|
-
toast.error(i18n.t('Failed to create facet value'), {
|
|
69
|
-
description: error instanceof Error ? error.message : i18n.t('Unknown error'),
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const onSubmit = useCallback(
|
|
75
|
-
(values: FormValues) => {
|
|
76
|
-
createFacetValueMutation.mutate({
|
|
77
|
-
input: [
|
|
78
|
-
{
|
|
79
|
-
facetId,
|
|
80
|
-
code: values.code,
|
|
81
|
-
translations: [
|
|
82
|
-
{
|
|
83
|
-
languageCode: 'en',
|
|
84
|
-
name: values.name,
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
[createFacetValueMutation, facetId],
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<Dialog open={open} onOpenChange={setOpen}>
|
|
96
|
-
<DialogTrigger asChild>
|
|
97
|
-
<Button variant="outline">
|
|
98
|
-
<Plus className="mr-2 h-4 w-4" />
|
|
99
|
-
<Trans>Add facet value</Trans>
|
|
100
|
-
</Button>
|
|
101
|
-
</DialogTrigger>
|
|
102
|
-
<DialogContent>
|
|
103
|
-
<DialogHeader>
|
|
104
|
-
<DialogTitle>
|
|
105
|
-
<Trans>Add facet value</Trans>
|
|
106
|
-
</DialogTitle>
|
|
107
|
-
</DialogHeader>
|
|
108
|
-
<Form {...form}>
|
|
109
|
-
<form
|
|
110
|
-
onSubmit={e => {
|
|
111
|
-
e.stopPropagation();
|
|
112
|
-
form.handleSubmit(onSubmit)(e);
|
|
113
|
-
}}
|
|
114
|
-
className="space-y-4"
|
|
115
|
-
>
|
|
116
|
-
<FormFieldWrapper
|
|
117
|
-
control={form.control}
|
|
118
|
-
name="name"
|
|
119
|
-
label={<Trans>Name</Trans>}
|
|
120
|
-
render={({ field }) => <Input {...field} />}
|
|
121
|
-
/>
|
|
122
|
-
<FormFieldWrapper
|
|
123
|
-
control={form.control}
|
|
124
|
-
name="code"
|
|
125
|
-
label={<Trans>Code</Trans>}
|
|
126
|
-
render={({ field }) => <Input {...field} />}
|
|
127
|
-
/>
|
|
128
|
-
<DialogFooter>
|
|
129
|
-
<Button
|
|
130
|
-
type="submit"
|
|
131
|
-
disabled={
|
|
132
|
-
createFacetValueMutation.isPending ||
|
|
133
|
-
!form.formState.isValid ||
|
|
134
|
-
!form.watch('name').trim() ||
|
|
135
|
-
!form.watch('code').trim()
|
|
136
|
-
}
|
|
137
|
-
>
|
|
138
|
-
<Trans>Create facet value</Trans>
|
|
139
|
-
</Button>
|
|
140
|
-
</DialogFooter>
|
|
141
|
-
</form>
|
|
142
|
-
</Form>
|
|
143
|
-
</DialogContent>
|
|
144
|
-
</Dialog>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|