@vendure/dashboard 3.3.6-master-202507110238 → 3.3.6-master-202507120238

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.
@@ -199,13 +199,13 @@ export async function compileFile({ inputRootDir, inputPath, outputDir, transfor
199
199
  // Attempt to resolve using path aliases
200
200
  let resolved = false;
201
201
  for (const [alias, patterns] of Object.entries(tsConfigInfo.paths)) {
202
- const aliasPrefix = alias.replace('*', '');
202
+ const aliasPrefix = alias.replace(/\*/g, '');
203
203
  const aliasSuffix = alias.endsWith('*') ? '*' : '';
204
204
  if (importPath.startsWith(aliasPrefix) &&
205
205
  (aliasSuffix === '*' || importPath === aliasPrefix)) {
206
206
  const remainingImportPath = importPath.slice(aliasPrefix.length);
207
207
  for (const pattern of patterns) {
208
- const patternPrefix = pattern.replace('*', '');
208
+ const patternPrefix = pattern.replace(/\*/g, '');
209
209
  const patternSuffix = pattern.endsWith('*') ? '*' : '';
210
210
  // Ensure suffix match consistency (* vs exact)
211
211
  if (aliasSuffix !== patternSuffix)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.3.6-master-202507110238",
4
+ "version": "3.3.6-master-202507120238",
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.6-master-202507110238",
90
- "@vendure/core": "^3.3.6-master-202507110238",
89
+ "@vendure/common": "^3.3.6-master-202507120238",
90
+ "@vendure/core": "^3.3.6-master-202507120238",
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": "48140d95d510219816f76bd5d53af779e67011f3"
133
+ "gitHead": "8564bf5f2b06727ce0145bf616275949f07f981a"
134
134
  }
@@ -32,7 +32,6 @@ interface CustomerAddressSelectorProps {
32
32
  }
33
33
 
34
34
  export function CustomerAddressSelector({ customerId, onSelect }: Readonly<CustomerAddressSelectorProps>) {
35
- const { i18n } = useLingui();
36
35
  const [open, setOpen] = useState(false);
37
36
 
38
37
  const { data, isLoading } = useQuery<CustomerAddressesQuery>({
@@ -18,7 +18,11 @@ import {
18
18
  transitionPaymentToStateDocument,
19
19
  } from '../orders.graphql.js';
20
20
  import { SettleRefundDialog } from './settle-refund-dialog.js';
21
- import { getTypeForState, StateTransitionControl } from './state-transition-control.js';
21
+ import {
22
+ getTypeForState,
23
+ StateTransitionAction,
24
+ StateTransitionControl,
25
+ } from './state-transition-control.js';
22
26
 
23
27
  type PaymentDetailsProps = {
24
28
  payment: ResultOf<typeof paymentWithRefundsFragment>;
@@ -131,7 +135,7 @@ export function PaymentDetails({ payment, currencyCode, onSuccess }: Readonly<Pa
131
135
  };
132
136
 
133
137
  const getPaymentActions = () => {
134
- const actions = [];
138
+ const actions: StateTransitionAction[] = [];
135
139
 
136
140
  if (payment.nextStates?.includes('Settled')) {
137
141
  actions.push({
@@ -9,9 +9,9 @@ import { Trans } from '@/vdb/lib/trans.js';
9
9
  import { cn } from '@/vdb/lib/utils.js';
10
10
  import { EllipsisVertical, CircleDashed, CircleCheck, CircleX } from 'lucide-react';
11
11
 
12
- type StateType = 'default' | 'destructive' | 'success';
12
+ export type StateType = 'default' | 'destructive' | 'success';
13
13
 
14
- type StateTransitionAction = {
14
+ export type StateTransitionAction = {
15
15
  label: string;
16
16
  onClick: () => void;
17
17
  disabled?: boolean;
@@ -249,7 +249,6 @@ function DraftOrderPage() {
249
249
  const { mutate: removeCouponCodeForDraftOrder } = useMutation({
250
250
  mutationFn: api.mutate(removeCouponCodeFromDraftOrderDocument),
251
251
  onSuccess: (result: ResultOf<typeof removeCouponCodeFromDraftOrderDocument>) => {
252
- const order = result.removeCouponCodeFromDraftOrder;
253
252
  toast.success(i18n.t('Coupon code removed from order'));
254
253
  refreshEntity();
255
254
  },
@@ -37,7 +37,7 @@ export function OptionValueInput({
37
37
  groupIndex,
38
38
  disabled = false,
39
39
  }: Readonly<OptionValueInputProps>) {
40
- const { control, watch } = useFormContext<FormValues>();
40
+ const { control } = useFormContext<FormValues>();
41
41
  const { fields, append, remove } = useFieldArray({
42
42
  control,
43
43
  name: `optionGroups.${groupIndex}.values`,
@@ -28,13 +28,6 @@ export function ZoneCountriesTable({ zoneId, canAddCountries = false }: Readonly
28
28
  },
29
29
  });
30
30
 
31
- const { mutate: removeCountryFromZone } = useMutation({
32
- mutationFn: api.mutate(removeCountryFromZoneMutation),
33
- onSuccess: () => {
34
- refetch();
35
- },
36
- });
37
-
38
31
  const [page, setPage] = useState(1);
39
32
  const [pageSize, setPageSize] = useState(10);
40
33
 
@@ -14,7 +14,7 @@ export function ContentLanguageSelector({ value, onChange, className }: ContentL
14
14
  const serverConfig = useServerConfig();
15
15
  const { formatLanguageName } = useLocalFormat();
16
16
  const {
17
- settings: { contentLanguage, displayLanguage },
17
+ settings: { contentLanguage },
18
18
  setContentLanguage,
19
19
  } = useUserSettings();
20
20
 
@@ -29,12 +29,6 @@ export function AssetPreview({ asset, assets, customFields = [] }: Readonly<Asse
29
29
  const imageRef = useRef<HTMLImageElement>(null);
30
30
  const containerRef = useRef<HTMLDivElement>(null);
31
31
 
32
- const form = useForm({
33
- defaultValues: {
34
- name: asset.name,
35
- tags: asset.tags?.map(t => t.value) || [],
36
- },
37
- });
38
32
  const activeAsset = assets?.[assetIndex] ?? asset;
39
33
 
40
34
  useEffect(() => {
@@ -32,7 +32,7 @@ interface OptionValueInputProps {
32
32
  }
33
33
 
34
34
  export function OptionValueInput({ groupIndex, disabled = false }: Readonly<OptionValueInputProps>) {
35
- const { control, watch } = useFormContext<FormValues>();
35
+ const { control } = useFormContext<FormValues>();
36
36
  const { fields, append, remove } = useFieldArray({
37
37
  control,
38
38
  name: `optionGroups.${groupIndex}.values`,
@@ -59,7 +59,7 @@ export function ProductVariantSelector({ onProductVariantSelect }: Readonly<Prod
59
59
  const [open, setOpen] = useState(false);
60
60
  const debouncedSearch = useDebounce(search, 500);
61
61
 
62
- const { data, isLoading } = useQuery({
62
+ const { data } = useQuery({
63
63
  queryKey: ['productVariants', debouncedSearch],
64
64
  staleTime: 1000 * 60 * 5,
65
65
  enabled: debouncedSearch.length > 0,
@@ -77,7 +77,7 @@ function Calendar({
77
77
  }, [yearRange]),
78
78
  );
79
79
 
80
- const { onNextClick, onPrevClick, startMonth, endMonth } = props;
80
+ const { onPrevClick, startMonth, endMonth } = props;
81
81
 
82
82
  const columnsDisplayed = navView === 'years' ? 1 : numberOfMonths;
83
83
 
@@ -19,7 +19,7 @@ export function MetricsWidget() {
19
19
  const { activeChannel } = useChannel();
20
20
  const [dataType, setDataType] = useState<DATA_TYPES>(DATA_TYPES.OrderTotal);
21
21
 
22
- const { data, error } = useQuery({
22
+ const { data } = useQuery({
23
23
  queryKey: ['dashboard-order-metrics', dataType],
24
24
  queryFn: () => {
25
25
  return api.query(orderChartDataQuery, {
@@ -37,8 +37,6 @@ function PercentageChange({ value }: PercentageChangeProps) {
37
37
 
38
38
  export function OrdersSummaryWidget() {
39
39
  const [range, setRange] = useState<Range>(Range.Today);
40
- const { formatCurrency } = useLocalFormat();
41
- const { activeChannel } = useChannel();
42
40
 
43
41
  const variables = useMemo(() => {
44
42
  const now = new Date();
@@ -10,14 +10,13 @@ import { usePage } from './use-page.js';
10
10
 
11
11
  export function useExtendedListQuery<T extends DocumentNode>(listQuery: T) {
12
12
  const { pageId } = usePage();
13
- const { blockId } = usePageBlock();
13
+ const { blockId } = usePageBlock() ?? {};
14
14
  const { i18n } = useLingui();
15
15
  const listQueryExtensions = pageId && blockId ? getListQueryDocuments(pageId, blockId) : [];
16
16
  const hasShownError = useRef(false);
17
17
 
18
18
  const extendedListQuery = useMemo(() => {
19
19
  let result: T = listQuery;
20
- let error: Error | null = null;
21
20
 
22
21
  try {
23
22
  result = listQueryExtensions.reduce(
@@ -25,40 +24,43 @@ export function useExtendedListQuery<T extends DocumentNode>(listQuery: T) {
25
24
  listQuery,
26
25
  ) as T;
27
26
  } catch (err) {
28
- error = err instanceof Error ? err : new Error(String(err));
27
+ const error = err instanceof Error ? err : new Error(String(err));
29
28
  // Continue with the original query instead of the extended one
30
29
  result = listQuery;
31
- }
32
30
 
33
- // Store error for useEffect to handle
34
- if (error && !hasShownError.current) {
35
- hasShownError.current = true;
31
+ // Store error for useEffect to handle
32
+ if (error && !hasShownError.current) {
33
+ hasShownError.current = true;
36
34
 
37
- // Provide a helpful error message based on the error type
38
- let errorMessage = i18n.t('Failed to extend query document');
39
- if (error.message.includes('Extension query must have at least one top-level field')) {
40
- errorMessage = i18n.t('Query extension is invalid: must have at least one top-level field');
41
- } else if (error.message.includes('The query extension must extend the')) {
42
- errorMessage = i18n.t('Query extension mismatch: ') + error.message;
43
- } else if (error.message.includes('Syntax Error')) {
44
- errorMessage = i18n.t('Query extension contains invalid GraphQL syntax');
45
- } else {
46
- errorMessage = i18n.t('Query extension error: ') + error.message;
47
- }
35
+ // Provide a helpful error message based on the error type
36
+ let errorMessageText = i18n.t('Failed to extend query document');
37
+ if (error.message.includes('Extension query must have at least one top-level field')) {
38
+ errorMessageText = i18n.t(
39
+ 'Query extension is invalid: must have at least one top-level field',
40
+ );
41
+ } else if (error.message.includes('The query extension must extend the')) {
42
+ errorMessageText = i18n.t('Query extension mismatch: ') + error.message;
43
+ } else if (error.message.includes('Syntax Error')) {
44
+ errorMessageText = i18n.t('Query extension contains invalid GraphQL syntax');
45
+ } else {
46
+ errorMessageText = i18n.t('Query extension error: ') + error.message;
47
+ }
48
48
 
49
- // Log the error and continue with the original query
50
- // eslint-disable-next-line no-console
51
- console.warn(`${errorMessage}. Continuing with original query.`, {
52
- pageId,
53
- blockId,
54
- extensionsCount: listQueryExtensions.length,
55
- error: error.message,
56
- });
49
+ // Log the error and continue with the original query
50
+ // eslint-disable-next-line no-console
51
+ console.warn(`${errorMessageText}. Continuing with original query.`, {
52
+ pageId,
53
+ blockId,
54
+ extensionsCount: listQueryExtensions.length,
55
+ error: error.message,
56
+ });
57
57
 
58
- // Show a user-friendly toast notification
59
- toast.error(i18n.t('Query extension error'), {
60
- description: errorMessage + '. ' + i18n.t('The page will continue with the default query.'),
61
- });
58
+ // Show a user-friendly toast notification
59
+ toast.error(i18n.t('Query extension error'), {
60
+ description:
61
+ errorMessageText + '. ' + i18n.t('The page will continue with the default query.'),
62
+ });
63
+ }
62
64
  }
63
65
 
64
66
  return result;
@@ -372,7 +372,7 @@ export async function compileFile({
372
372
  // Attempt to resolve using path aliases
373
373
  let resolved = false;
374
374
  for (const [alias, patterns] of Object.entries(tsConfigInfo.paths)) {
375
- const aliasPrefix = alias.replace('*', '');
375
+ const aliasPrefix = alias.replace(/\*/g, '');
376
376
  const aliasSuffix = alias.endsWith('*') ? '*' : '';
377
377
 
378
378
  if (
@@ -381,7 +381,7 @@ export async function compileFile({
381
381
  ) {
382
382
  const remainingImportPath = importPath.slice(aliasPrefix.length);
383
383
  for (const pattern of patterns) {
384
- const patternPrefix = pattern.replace('*', '');
384
+ const patternPrefix = pattern.replace(/\*/g, '');
385
385
  const patternSuffix = pattern.endsWith('*') ? '*' : '';
386
386
  // Ensure suffix match consistency (* vs exact)
387
387
  if (aliasSuffix !== patternSuffix) continue;