@deenruv/admin-dashboard 1.0.16 → 1.0.17-dev.15

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 (83) hide show
  1. package/dist/DeenruvAdminPanel.js +35 -46
  2. package/dist/access/access-context.js +10 -0
  3. package/dist/access/built-in-routes.js +300 -0
  4. package/dist/access/index.js +6 -0
  5. package/dist/access/navigation.js +33 -0
  6. package/dist/access/permission-access.js +9 -0
  7. package/dist/access/permission-routes.js +3 -0
  8. package/dist/access/types.js +1 -0
  9. package/dist/components/GlobalSearch.js +37 -62
  10. package/dist/components/Menu/ActiveAdmins.js +1 -1
  11. package/dist/components/Menu/ChannelSwitcher.js +1 -1
  12. package/dist/components/Menu/LanguagesDropdown.js +1 -1
  13. package/dist/components/Menu/Navigation.js +68 -229
  14. package/dist/components/Menu/NavigationFooter.js +7 -4
  15. package/dist/components/Menu/Notifications.js +1 -1
  16. package/dist/components/Menu/index.js +50 -16
  17. package/dist/components/storefrontAction/StorefrontAction.js +9 -0
  18. package/dist/components/storefrontAction/StorefrontAction.logic.js +27 -0
  19. package/dist/components/storefrontAction/index.js +2 -0
  20. package/dist/index.css +54 -44
  21. package/dist/locales/en/admins.json +62 -0
  22. package/dist/locales/en/collections.json +21 -0
  23. package/dist/locales/en/common.json +2 -0
  24. package/dist/locales/en/orders.json +8 -0
  25. package/dist/locales/en/products.json +29 -2
  26. package/dist/locales/en/promotions.json +4 -0
  27. package/dist/locales/pl/admins.json +62 -0
  28. package/dist/locales/pl/collections.json +21 -0
  29. package/dist/locales/pl/common.json +2 -0
  30. package/dist/locales/pl/orders.json +8 -0
  31. package/dist/locales/pl/products.json +29 -2
  32. package/dist/locales/pl/promotions.json +4 -0
  33. package/dist/pages/Root.js +31 -15
  34. package/dist/pages/admins/Detail.js +1 -1
  35. package/dist/pages/admins/List.js +8 -3
  36. package/dist/pages/admins/Provision.js +173 -0
  37. package/dist/pages/admins/Provision.logic.js +53 -0
  38. package/dist/pages/admins/index.js +1 -0
  39. package/dist/pages/assets/List.js +3 -3
  40. package/dist/pages/channels/Detail.js +1 -1
  41. package/dist/pages/collections/Detail.js +24 -6
  42. package/dist/pages/collections/List.js +87 -20
  43. package/dist/pages/collections/_components/CollectionDetailView.js +15 -2
  44. package/dist/pages/collections/_components/FiltersCard.js +51 -11
  45. package/dist/pages/collections/_components/collectionStorefrontAction/CollectionStorefrontAction.js +41 -0
  46. package/dist/pages/collections/_components/collectionStorefrontAction/CollectionStorefrontAction.logic.js +44 -0
  47. package/dist/pages/collections/_components/collectionStorefrontAction/index.js +2 -0
  48. package/dist/pages/countries/Detail.js +1 -1
  49. package/dist/pages/customers/_components/PersonalDataCard.js +2 -1
  50. package/dist/pages/extensions/Extensions.js +3 -7
  51. package/dist/pages/facets/Detail.js +1 -1
  52. package/dist/pages/orders/Detail.js +38 -5
  53. package/dist/pages/orders/List.js +1 -16
  54. package/dist/pages/orders/_components/CancelAndRefundDialog.js +1 -2
  55. package/dist/pages/orders/_components/OrderLineCustomFields.js +1 -1
  56. package/dist/pages/orders/_components/ProductsTable.js +1 -2
  57. package/dist/pages/orders/_components/RefundPaymentCard.js +1 -2
  58. package/dist/pages/payment-methods/Detail.js +1 -1
  59. package/dist/pages/product-variants/List.js +3 -3
  60. package/dist/pages/products/Detail.js +62 -5
  61. package/dist/pages/products/_components/AssetsCard.js +15 -2
  62. package/dist/pages/products/_components/OptionsCard.js +7 -5
  63. package/dist/pages/products/_components/PriceCard.js +21 -8
  64. package/dist/pages/products/_components/ProductDetailView.js +7 -3
  65. package/dist/pages/products/_components/Variant.js +53 -26
  66. package/dist/pages/products/_components/VariantsTab.js +1 -1
  67. package/dist/pages/products/_components/productStorefrontAction/ProductStorefrontAction.js +42 -0
  68. package/dist/pages/products/_components/productStorefrontAction/ProductStorefrontAction.logic.js +39 -0
  69. package/dist/pages/products/_components/productStorefrontAction/index.js +2 -0
  70. package/dist/pages/promotions/Detail.js +34 -3
  71. package/dist/pages/promotions/_components/EnabledCard.js +2 -2
  72. package/dist/pages/promotions/_components/PromotionDetailSidebar.js +2 -1
  73. package/dist/pages/roles/Detail.js +1 -1
  74. package/dist/pages/roles/_components/PermissionsTable.js +0 -1
  75. package/dist/pages/sellers/Detail.js +1 -1
  76. package/dist/pages/shipping-methods/Detail.js +10 -6
  77. package/dist/pages/shipping-methods/_components/CalculatorCard.js +27 -11
  78. package/dist/pages/shipping-methods/_components/CheckerCard.js +28 -12
  79. package/dist/pages/stock-locations/Detail.js +1 -1
  80. package/dist/pages/tax-rates/Detail.js +1 -1
  81. package/dist/pages/zones/Detail.js +1 -1
  82. package/dist/version.js +1 -1
  83. package/package.json +68 -68
@@ -1,9 +1,38 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useParams } from 'react-router';
3
- import { useTranslation, useValidators, createDeenruvForm, DetailView, useMutation } from '@deenruv/react-ui-devkit';
3
+ import { useTranslation, useValidators, createDeenruvForm, DetailView, useMutation, useSettings, } from '@deenruv/react-ui-devkit';
4
4
  import { $, Permission, scalars, typedGql } from '@deenruv/admin-types';
5
5
  import { PromotionDetailView } from "./_components/PromotionDetailView";
6
6
  import { PromotionDetailSidebar } from "./_components/PromotionDetailSidebar";
7
+ const DEFAULT_PROMOTION_LANGUAGE_CODE = 'en';
8
+ const ensureDefaultPromotionTranslation = (translations, defaultLanguageCode) => {
9
+ const sourceTranslation = translations.find((translation) => !!translation.name?.trim()) ?? translations[0];
10
+ if (!sourceTranslation?.name?.trim())
11
+ return translations;
12
+ let hasDefaultLanguage = false;
13
+ const normalizedTranslations = translations.map((translation) => {
14
+ if (translation.languageCode !== defaultLanguageCode)
15
+ return translation;
16
+ hasDefaultLanguage = true;
17
+ if (translation.name?.trim())
18
+ return translation;
19
+ return {
20
+ ...translation,
21
+ name: sourceTranslation.name,
22
+ description: translation.description ?? sourceTranslation.description ?? '',
23
+ };
24
+ });
25
+ if (hasDefaultLanguage)
26
+ return normalizedTranslations;
27
+ return [
28
+ ...normalizedTranslations,
29
+ {
30
+ languageCode: defaultLanguageCode,
31
+ name: sourceTranslation.name,
32
+ description: sourceTranslation.description ?? '',
33
+ },
34
+ ];
35
+ };
7
36
  const EditPromotionMutation = typedGql('mutation', { scalars })({
8
37
  updatePromotion: [{ input: $('input', 'UpdatePromotionInput!') }, { '...on Promotion': { id: true } }],
9
38
  });
@@ -20,6 +49,7 @@ export const PromotionsDetailPage = () => {
20
49
  const [create] = useMutation(CreatePromotionMutation);
21
50
  const [remove] = useMutation(DeletePromotionMutation);
22
51
  const { translationsValidator, configurableOperationArrayValidator } = useValidators();
52
+ const defaultLanguageCode = useSettings((state) => state.selectedChannel?.defaultLanguageCode ?? DEFAULT_PROMOTION_LANGUAGE_CODE);
23
53
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "promotions-detail-view", main: {
24
54
  name: 'promotion',
25
55
  label: 'Promotion',
@@ -50,9 +80,10 @@ export const PromotionsDetailPage = () => {
50
80
  throw new Error('Fill required fields.');
51
81
  const conditions = data.conditions;
52
82
  const actions = data.actions;
83
+ const translations = data.translations;
53
84
  const input = {
54
- translations: data.translations,
55
- enabled: data.enabled || false,
85
+ translations: id ? translations : ensureDefaultPromotionTranslation(translations, defaultLanguageCode),
86
+ enabled: typeof data.enabled === 'boolean' ? data.enabled : true,
56
87
  actions,
57
88
  conditions: conditions?.map((el) => ({
58
89
  ...el,
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useTranslation, Label, Switch, CustomCard, CardIcons } from '@deenruv/react-ui-devkit';
3
3
  export const EnabledCard = ({ onEnabledChange, enabledValue }) => {
4
- const { t } = useTranslation('products');
5
- return (_jsx(CustomCard, { title: t('details.basicInfo'), icon: _jsx(CardIcons.default, {}), color: "teal", children: _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Switch, { id: "product-enabled", checked: enabledValue, onCheckedChange: onEnabledChange }), _jsx(Label, { htmlFor: "product-enabled", children: t('enabled') })] }) }));
4
+ const { t } = useTranslation('promotions');
5
+ return (_jsx(CustomCard, { title: t('enabled.header'), icon: _jsx(CardIcons.default, {}), color: "teal", children: _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Switch, { id: "promotion-enabled", checked: enabledValue ?? false, onCheckedChange: onEnabledChange }), _jsx(Label, { htmlFor: "promotion-enabled", children: t('enabled.label') })] }) }));
6
6
  };
@@ -6,6 +6,7 @@ import { useEffect } from 'react';
6
6
  export const PromotionDetailSidebar = () => {
7
7
  const { id, form } = useDetailView('promotions-detail-view', 'CreatePromotionInput', 'enabled');
8
8
  const { base } = form;
9
+ const enabledValue = base.watch('enabled');
9
10
  // Always call useQuery unconditionally to preserve hook order.
10
11
  // Pass a placeholder id when none exists; the result will simply be ignored.
11
12
  const { data } = useQuery(PromotionQuery, { initialVariables: { id: id ?? '' } });
@@ -14,5 +15,5 @@ export const PromotionDetailSidebar = () => {
14
15
  base.setField('enabled', data.promotion.enabled);
15
16
  }
16
17
  }, [data, id]);
17
- return (_jsx("div", { className: "flex w-full flex-col gap-4", children: _jsx(EnabledCard, { enabledValue: base.watch('enabled'), onEnabledChange: (e) => base.setField('enabled', e) }) }));
18
+ return (_jsx("div", { className: "flex w-full flex-col gap-4", children: _jsx(EnabledCard, { enabledValue: id ? enabledValue : (enabledValue ?? true), onEnabledChange: (e) => base.setField('enabled', e) }) }));
18
19
  };
@@ -42,7 +42,7 @@ export const RolesDetailPage = () => {
42
42
  if (!id) {
43
43
  throw new Error('Could not find the id.');
44
44
  }
45
- return remove({ input: { id } });
45
+ return remove({ id });
46
46
  }, [remove, id]);
47
47
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "roles-detail-view", main: {
48
48
  name: 'role',
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from 'react';
3
3
  import { useTranslation, cn, Table, TableBody, TableCell, TableRow, useServer } from '@deenruv/react-ui-devkit';
4
4
  import { CircleCheckBig } from 'lucide-react';
5
- import permissionsJson from "../../../locales/en/permissions.json";
6
5
  export const PermissionsTable = ({ currentPermissions, onPermissionsChange }) => {
7
6
  const { t } = useTranslation('permissions');
8
7
  const [groupedPermissions, setGroupedPermissions] = useState();
@@ -31,7 +31,7 @@ export const SellersDetailPage = () => {
31
31
  if (!id) {
32
32
  throw new Error('Could not find the id.');
33
33
  }
34
- return remove({ input: { id } });
34
+ return remove({ id });
35
35
  }, [remove, id]);
36
36
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "sellers-detail-view", main: {
37
37
  name: 'seller',
@@ -3,6 +3,10 @@ import { useCallback } from 'react';
3
3
  import { useParams } from 'react-router';
4
4
  import { useTranslation, DetailView, createDeenruvForm, getMutation, useMutation } from '@deenruv/react-ui-devkit';
5
5
  import { ShippingMethodDetailView } from "./_components/ShippingMethodDetailView.js";
6
+ const isMissingConfigArgValue = (value) => value == null || value.trim() === '';
7
+ const hasMissingConfigArgs = (operation) => {
8
+ return !!operation?.arguments?.some((argument) => isMissingConfigArgValue(argument.value));
9
+ };
6
10
  const CreateShippingMethodMutation = getMutation('createShippingMethod');
7
11
  const EditShippingMethodMutation = getMutation('updateShippingMethod');
8
12
  const DeleteShippingMethodMutation = getMutation('deleteShippingMethod');
@@ -44,7 +48,7 @@ export const ShippingMethodsDetailPage = () => {
44
48
  if (!id) {
45
49
  throw new Error('Could not find the id.');
46
50
  }
47
- return remove({ input: { id } });
51
+ return remove({ id });
48
52
  }, [remove, id]);
49
53
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "shippingMethods-detail-view", main: {
50
54
  name: 'shippingMethod',
@@ -63,11 +67,11 @@ export const ShippingMethodsDetailPage = () => {
63
67
  checker: {
64
68
  validate: (v) => {
65
69
  const hasCode = !!v?.code;
66
- const hasArguments = v?.arguments.filter((a) => a.value).length;
70
+ const hasInvalidArguments = hasMissingConfigArgs(v);
67
71
  const errors = [];
68
72
  if (!hasCode)
69
73
  errors.push(t('validation.checkerCodeRequired'));
70
- if (!hasArguments)
74
+ if (hasInvalidArguments)
71
75
  errors.push(t('validation.checkerArgsRequired'));
72
76
  return errors;
73
77
  },
@@ -75,12 +79,12 @@ export const ShippingMethodsDetailPage = () => {
75
79
  calculator: {
76
80
  validate: (v) => {
77
81
  const hasCode = !!v?.code;
78
- const hasInvalidArguments = v?.arguments.filter((a) => !a.value || a.value === 'false').length; // args have 'false' value by default
82
+ const hasInvalidArguments = hasMissingConfigArgs(v);
79
83
  const errors = [];
80
84
  if (!hasCode)
81
- errors.push(t('validation.checkerCodeRequired'));
85
+ errors.push(t('validation.calculatorCodeRequired'));
82
86
  if (hasInvalidArguments)
83
- errors.push(t('validation.checkerArgsRequired'));
87
+ errors.push(t('validation.calculatorArgsRequired'));
84
88
  return errors;
85
89
  },
86
90
  },
@@ -1,7 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from 'react';
3
- import { Button, Label, apiClient, ErrorMessage, generateInputComponents, usePluginStore, CustomFieldsProvider, CardIcons, CustomCard, SimpleSelect, useTranslation, PaymentMethodHandlerSelector, } from '@deenruv/react-ui-devkit';
3
+ import { Button, apiClient, ErrorMessage, generateInputComponents, usePluginStore, InputFieldComponent, CardIcons, CustomCard, SimpleSelect, useTranslation, PaymentMethodHandlerSelector, } from '@deenruv/react-ui-devkit';
4
4
  import { X } from 'lucide-react';
5
+ const decodeConfigArgValue = (value) => {
6
+ try {
7
+ const result = JSON.parse(value);
8
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
9
+ return JSON.stringify(result);
10
+ }
11
+ return result;
12
+ }
13
+ catch {
14
+ return value;
15
+ }
16
+ };
17
+ const encodeConfigArgValue = (value) => {
18
+ return Array.isArray(value) ? JSON.stringify(value) : (value ?? '').toString();
19
+ };
20
+ const createInitialArguments = (args) => {
21
+ return args.map((arg) => ({
22
+ name: arg.name,
23
+ value: encodeConfigArgValue(arg.defaultValue),
24
+ }));
25
+ };
5
26
  export const CalculatorCard = ({ currentCalculatorValue, onCalculatorValueChange, errors, }) => {
6
27
  const { t } = useTranslation('shippingMethods');
7
28
  const [calculators, setCalculators] = useState([]);
@@ -22,21 +43,16 @@ export const CalculatorCard = ({ currentCalculatorValue, onCalculatorValueChange
22
43
  }, [fetchOptions]);
23
44
  const handleCalculatorValueChange = useCallback((code, args) => {
24
45
  const correspondingCalculator = calculators.find((h) => h.code === code);
25
- console.log('args', args);
26
46
  if (correspondingCalculator)
27
47
  onCalculatorValueChange({
28
48
  code: correspondingCalculator.code,
29
- arguments: args ||
30
- correspondingCalculator.args.map((a) => ({
31
- name: a.name,
32
- value: 'false',
33
- })),
49
+ arguments: args ?? createInitialArguments(correspondingCalculator.args),
34
50
  });
35
51
  }, [calculators, onCalculatorValueChange]);
36
52
  const clearInput = useCallback(() => {
37
53
  onCalculatorValueChange(undefined);
38
54
  }, [onCalculatorValueChange]);
39
- return (_jsx(CustomCard, { title: t('details.calculator.title'), icon: _jsx(CardIcons.calc, {}), color: "indigo", children: _jsxs("div", { className: "flex basis-full flex-col gap-3 md:basis-1/2", children: [_jsxs("div", { className: "flex items-end gap-1", children: [_jsx(SimpleSelect, { label: t('details.calculator.type'), value: currentCalculatorValue ? currentCalculatorValue.code : '', onValueChange: handleCalculatorValueChange, options: allCalculatorsOptions }), currentCalculatorValue?.code && (_jsx(Button, { variant: 'secondary', className: "p-2", onClick: clearInput, children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex gap-3", children: currentCalculatorValue?.arguments.map((e, i) => {
55
+ return (_jsx(CustomCard, { title: t('details.calculator.title'), icon: _jsx(CardIcons.calc, {}), color: "indigo", children: _jsxs("div", { className: "flex basis-full flex-col gap-3 md:basis-1/2", children: [_jsxs("div", { className: "flex items-end gap-1", children: [_jsx(SimpleSelect, { label: t('details.calculator.type'), value: currentCalculatorValue ? currentCalculatorValue.code : '', onValueChange: handleCalculatorValueChange, options: allCalculatorsOptions }), currentCalculatorValue?.code && (_jsx(Button, { variant: 'secondary', className: "p-2", onClick: clearInput, children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex gap-3", children: currentCalculatorValue?.arguments.map((e) => {
40
56
  const calculator = calculators?.find((ch) => ch.code === currentCalculatorValue.code);
41
57
  const argument = calculator?.args.find((a) => a.name === e.name);
42
58
  if (!argument)
@@ -48,7 +64,7 @@ export const CalculatorCard = ({ currentCalculatorValue, onCalculatorValueChange
48
64
  description: [{ languageCode: 'en', value: argument.description || '' }],
49
65
  },
50
66
  ], getInputComponent).map((field) => {
51
- const value = e.value;
67
+ const value = decodeConfigArgValue(e.value);
52
68
  const setValue = (data) => {
53
69
  try {
54
70
  onCalculatorValueChange({
@@ -58,7 +74,7 @@ export const CalculatorCard = ({ currentCalculatorValue, onCalculatorValueChange
58
74
  if (a.name === field.name) {
59
75
  return {
60
76
  name: a.name,
61
- value: JSON.stringify(data),
77
+ value: encodeConfigArgValue(data),
62
78
  };
63
79
  }
64
80
  }
@@ -73,7 +89,7 @@ export const CalculatorCard = ({ currentCalculatorValue, onCalculatorValueChange
73
89
  console.error('Error setting value');
74
90
  }
75
91
  };
76
- return (_jsx(CustomFieldsProvider, { field: field, value: value, setValue: setValue, additionalData: {}, children: _jsxs("div", { children: [_jsx("div", { children: _jsx(Label, { children: field.name }) }), field.component] }, field.name) }, field.name));
92
+ return (_jsx(InputFieldComponent, { field: field, value: value, setValue: setValue, additionalData: {} }, field.name));
77
93
  });
78
94
  }) }), _jsx(ErrorMessage, { errors: errors })] }) }));
79
95
  };
@@ -1,7 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from 'react';
3
- import { Button, Label, apiClient, ErrorMessage, generateInputComponents, usePluginStore, CustomFieldsProvider, CustomCard, CardIcons, SimpleSelect, useTranslation, PaymentMethodHandlerSelector, } from '@deenruv/react-ui-devkit';
3
+ import { Button, apiClient, ErrorMessage, generateInputComponents, usePluginStore, InputFieldComponent, CustomCard, CardIcons, SimpleSelect, useTranslation, PaymentMethodHandlerSelector, } from '@deenruv/react-ui-devkit';
4
4
  import { X } from 'lucide-react';
5
+ const decodeConfigArgValue = (value) => {
6
+ try {
7
+ const result = JSON.parse(value);
8
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
9
+ return JSON.stringify(result);
10
+ }
11
+ return result;
12
+ }
13
+ catch {
14
+ return value;
15
+ }
16
+ };
17
+ const encodeConfigArgValue = (value) => {
18
+ return Array.isArray(value) ? JSON.stringify(value) : (value ?? '').toString();
19
+ };
20
+ const createInitialArguments = (args) => {
21
+ return args.map((arg) => ({
22
+ name: arg.name,
23
+ value: encodeConfigArgValue(arg.defaultValue),
24
+ }));
25
+ };
5
26
  export const CheckerCard = ({ currentCheckerValue, onCheckerValueChange, errors }) => {
6
27
  const { t } = useTranslation('shippingMethods');
7
28
  const [checkers, setCheckers] = useState([]);
@@ -25,20 +46,15 @@ export const CheckerCard = ({ currentCheckerValue, onCheckerValueChange, errors
25
46
  if (correspondingChecker)
26
47
  onCheckerValueChange({
27
48
  code: correspondingChecker.code,
28
- arguments: args ||
29
- correspondingChecker.args.map((a) => ({
30
- name: a.name,
31
- value: 'false',
32
- })),
49
+ arguments: args ?? createInitialArguments(correspondingChecker.args),
33
50
  });
34
51
  }, [checkers, onCheckerValueChange]);
35
52
  const clearInput = useCallback(() => {
36
- console.log('CLICK');
37
53
  onCheckerValueChange(undefined);
38
54
  }, [onCheckerValueChange]);
39
- return (_jsx(CustomCard, { title: t('details.options.title'), icon: _jsx(CardIcons.check, {}), color: "teal", upperRight: _jsx(ErrorMessage, { errors: errors }), children: _jsxs("div", { className: "flex basis-full flex-col gap-3 md:basis-1/2", children: [_jsxs("div", { className: "flex items-end gap-1", children: [_jsx(SimpleSelect, { label: t('details.options.checker'), value: currentCheckerValue ? currentCheckerValue.code : '', onValueChange: handleCheckerValueChange, options: allCheckersOptions }), currentCheckerValue?.code && (_jsx(Button, { variant: 'secondary', className: "p-2", onClick: clearInput, children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex", children: currentCheckerValue?.arguments.map((e, i) => {
55
+ return (_jsx(CustomCard, { title: t('details.options.title'), icon: _jsx(CardIcons.check, {}), color: "teal", upperRight: _jsx(ErrorMessage, { errors: errors }), children: _jsxs("div", { className: "flex basis-full flex-col gap-3 md:basis-1/2", children: [_jsxs("div", { className: "flex items-end gap-1", children: [_jsx(SimpleSelect, { label: t('details.options.checker'), value: currentCheckerValue ? currentCheckerValue.code : '', onValueChange: handleCheckerValueChange, options: allCheckersOptions }), currentCheckerValue?.code && (_jsx(Button, { variant: 'secondary', className: "p-2", onClick: clearInput, children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex", children: currentCheckerValue?.arguments.map((e) => {
40
56
  const checker = checkers?.find((ch) => ch.code === currentCheckerValue.code);
41
- const argument = checker?.args.find((a) => a.name === a.name);
57
+ const argument = checker?.args.find((a) => a.name === e.name);
42
58
  if (!argument)
43
59
  return null;
44
60
  return generateInputComponents([
@@ -48,7 +64,7 @@ export const CheckerCard = ({ currentCheckerValue, onCheckerValueChange, errors
48
64
  description: [{ languageCode: 'en', value: argument.description || '' }],
49
65
  },
50
66
  ], getInputComponent).map((field) => {
51
- const value = e.value;
67
+ const value = decodeConfigArgValue(e.value);
52
68
  const setValue = (data) => {
53
69
  try {
54
70
  onCheckerValueChange({
@@ -56,7 +72,7 @@ export const CheckerCard = ({ currentCheckerValue, onCheckerValueChange, errors
56
72
  arguments: currentCheckerValue.arguments.map((a) => {
57
73
  try {
58
74
  if (a.name === field.name) {
59
- return { name: field.name, value: JSON.stringify(data) };
75
+ return { name: field.name, value: encodeConfigArgValue(data) };
60
76
  }
61
77
  }
62
78
  catch {
@@ -70,7 +86,7 @@ export const CheckerCard = ({ currentCheckerValue, onCheckerValueChange, errors
70
86
  console.error('Error setting value');
71
87
  }
72
88
  };
73
- return (_jsx(CustomFieldsProvider, { field: field, value: value, setValue: setValue, additionalData: {}, children: _jsxs("div", { children: [_jsx("div", { children: _jsx(Label, { children: field.name }) }), field.component] }, field.name) }, field.name));
89
+ return (_jsx(InputFieldComponent, { field: field, value: value, setValue: setValue, additionalData: {} }, field.name));
74
90
  });
75
91
  }) })] }) }));
76
92
  };
@@ -25,7 +25,7 @@ const DeleteStockLocationMutation = typedGql('mutation', { scalars })({
25
25
  {
26
26
  input: $('input', 'DeleteStockLocationInput!'),
27
27
  },
28
- { message: true },
28
+ { message: true, result: true },
29
29
  ],
30
30
  });
31
31
  export const StockLocationsDetailPage = () => {
@@ -37,7 +37,7 @@ export const TaxRatesDetailPage = () => {
37
37
  if (!id) {
38
38
  throw new Error('Could not find the id.');
39
39
  }
40
- return remove({ input: { id } });
40
+ return remove({ id });
41
41
  }, [remove, id]);
42
42
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "taxRates-detail-view", main: {
43
43
  name: 'taxRate',
@@ -67,7 +67,7 @@ export const ZonesDetailPage = () => {
67
67
  if (!id) {
68
68
  throw new Error('Could not find the id.');
69
69
  }
70
- return remove({ input: { id } });
70
+ return remove({ id });
71
71
  }, [remove, id]);
72
72
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "zones-detail-view", main: {
73
73
  name: 'zone',
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const ADMIN_DASHBOARD_VERSION = '1.0.16';
1
+ export const ADMIN_DASHBOARD_VERSION = '1.0.17-dev.15';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deenruv/admin-dashboard",
3
- "version": "1.0.16",
3
+ "version": "1.0.17-dev.15",
4
4
  "main": "dist/index.js",
5
5
  "style": "dist/index.css",
6
6
  "types": "dist/index.d.ts",
@@ -13,96 +13,96 @@
13
13
  "@dnd-kit/modifiers": "^9.0.0",
14
14
  "@dnd-kit/sortable": "^10.0.0",
15
15
  "@dnd-kit/utilities": "^3.2.2",
16
- "@hookform/resolvers": "^5.2.2",
17
- "@radix-ui/react-accordion": "^1.2.12",
18
- "@radix-ui/react-alert-dialog": "^1.1.15",
19
- "@radix-ui/react-aspect-ratio": "^1.1.8",
20
- "@radix-ui/react-checkbox": "^1.3.3",
21
- "@radix-ui/react-dialog": "^1.1.15",
22
- "@radix-ui/react-dropdown-menu": "^2.1.16",
23
- "@radix-ui/react-hover-card": "^1.1.15",
16
+ "@hookform/resolvers": "^5.4.0",
17
+ "@radix-ui/react-accordion": "^1.2.14",
18
+ "@radix-ui/react-alert-dialog": "^1.1.17",
19
+ "@radix-ui/react-aspect-ratio": "^1.1.10",
20
+ "@radix-ui/react-checkbox": "^1.3.5",
21
+ "@radix-ui/react-dialog": "^1.1.17",
22
+ "@radix-ui/react-dropdown-menu": "^2.1.18",
23
+ "@radix-ui/react-hover-card": "^1.1.17",
24
24
  "@radix-ui/react-icons": "^1.3.2",
25
- "@radix-ui/react-label": "^2.1.8",
26
- "@radix-ui/react-popover": "^1.1.15",
27
- "@radix-ui/react-radio-group": "^1.3.8",
28
- "@radix-ui/react-scroll-area": "^1.2.10",
29
- "@radix-ui/react-select": "^2.2.6",
30
- "@radix-ui/react-separator": "^1.1.8",
31
- "@radix-ui/react-slot": "^1.2.4",
32
- "@radix-ui/react-switch": "^1.2.6",
33
- "@radix-ui/react-tabs": "^1.1.13",
34
- "@radix-ui/react-toast": "^1.2.15",
35
- "@radix-ui/react-toggle": "^1.1.10",
36
- "@radix-ui/react-toggle-group": "^1.1.11",
37
- "@radix-ui/react-tooltip": "^1.2.8",
25
+ "@radix-ui/react-label": "^2.1.10",
26
+ "@radix-ui/react-popover": "^1.1.17",
27
+ "@radix-ui/react-radio-group": "^1.4.1",
28
+ "@radix-ui/react-scroll-area": "^1.2.12",
29
+ "@radix-ui/react-select": "^2.3.1",
30
+ "@radix-ui/react-separator": "^1.1.10",
31
+ "@radix-ui/react-slot": "^1.3.0",
32
+ "@radix-ui/react-switch": "^1.3.1",
33
+ "@radix-ui/react-tabs": "^1.1.15",
34
+ "@radix-ui/react-toast": "^1.2.17",
35
+ "@radix-ui/react-toggle": "^1.1.12",
36
+ "@radix-ui/react-toggle-group": "^1.1.13",
37
+ "@radix-ui/react-tooltip": "^1.2.10",
38
38
  "@tanstack/react-table": "^8.21.3",
39
- "@tiptap/extension-document": "^3.19.0",
40
- "@tiptap/extension-heading": "^3.19.0",
41
- "@tiptap/extension-paragraph": "^3.19.0",
42
- "@tiptap/extension-text": "^3.19.0",
43
- "@tiptap/pm": "^3.19.0",
44
- "@tiptap/react": "^3.19.0",
45
- "@tiptap/starter-kit": "^3.19.0",
39
+ "@tiptap/extension-document": "^3.27.1",
40
+ "@tiptap/extension-heading": "^3.27.1",
41
+ "@tiptap/extension-paragraph": "^3.27.1",
42
+ "@tiptap/extension-text": "^3.27.1",
43
+ "@tiptap/pm": "^3.27.1",
44
+ "@tiptap/react": "^3.27.1",
45
+ "@tiptap/starter-kit": "^3.27.1",
46
46
  "class-variance-authority": "^0.7.1",
47
47
  "clsx": "^2.1.1",
48
48
  "cmdk": "^1.1.1",
49
49
  "compression": "^1.8.1",
50
- "date-fns": "^4.1.0",
50
+ "date-fns": "^4.4.0",
51
51
  "express": "^5.2.1",
52
- "framer-motion": "^12.34.0",
53
- "i18next": "^25.8.4",
54
- "i18next-browser-languagedetector": "^8.2.0",
52
+ "framer-motion": "^12.40.0",
53
+ "i18next": "^26.3.1",
54
+ "i18next-browser-languagedetector": "^8.2.1",
55
55
  "localforage": "^1.10.0",
56
- "lucide-react": "^0.563.0",
57
- "match-sorter": "^8.2.0",
56
+ "lucide-react": "^1.21.0",
57
+ "match-sorter": "^8.3.0",
58
58
  "next-themes": "^0.4.6",
59
- "react": "^19.2.4",
59
+ "react": "^19.2.7",
60
60
  "react-color": "^2.19.3",
61
- "react-day-picker": "^9.13.1",
62
- "react-dom": "^19.2.4",
63
- "react-hook-form": "^7.71.1",
64
- "react-i18next": "^16.5.4",
65
- "react-is": "^19.2.4",
66
- "react-resizable-panels": "^3.0.6",
67
- "react-router": "^7.13.0",
68
- "recharts": "^3.7.0",
69
- "rimraf": "^6.1.2",
61
+ "react-day-picker": "^10.0.1",
62
+ "react-dom": "^19.2.7",
63
+ "react-hook-form": "^7.80.0",
64
+ "react-i18next": "^17.0.8",
65
+ "react-is": "^19.2.7",
66
+ "react-resizable-panels": "^4.11.2",
67
+ "react-router": "^8.0.1",
68
+ "recharts": "^3.8.1",
69
+ "rimraf": "^6.1.3",
70
70
  "sirv": "^3.0.2",
71
71
  "socket.io-client": "^4.8.3",
72
72
  "sonner": "^2.0.7",
73
73
  "sort-by": "^1.2.0",
74
- "tailwind-merge": "^3.4.0",
75
- "ts-patch": "^3.3.0",
76
- "typescript-transform-paths": "^3.5.6",
77
- "use-debounce": "^10.1.0",
78
- "uuid": "^13.0.0",
74
+ "tailwind-merge": "^3.6.0",
75
+ "ts-patch": "^4.0.1",
76
+ "typescript-transform-paths": "^4.0.0",
77
+ "use-debounce": "^10.1.1",
78
+ "uuid": "^14.0.1",
79
79
  "vaul": "^1.1.2",
80
80
  "yup": "^1.7.1",
81
- "zod": "^4.3.6",
82
- "zustand": "^5.0.11",
83
- "@deenruv/admin-dashboard": "1.0.16",
84
- "@deenruv/admin-types": "1.0.16",
85
- "@deenruv/deenruv-examples-plugin": "1.0.16",
86
- "@deenruv/react-ui-devkit": "1.0.16"
81
+ "zod": "^4.4.3",
82
+ "zustand": "^5.0.14",
83
+ "@deenruv/admin-dashboard": "1.0.17-dev.15",
84
+ "@deenruv/admin-types": "1.0.17-dev.15",
85
+ "@deenruv/deenruv-examples-plugin": "1.0.17-dev.15",
86
+ "@deenruv/react-ui-devkit": "1.0.17-dev.15"
87
87
  },
88
88
  "devDependencies": {
89
- "@tailwindcss/typography": "^0.5.19",
89
+ "@tailwindcss/typography": "^0.5.20",
90
90
  "@types/express": "^5.0.6",
91
- "@types/react": "^19.2.13",
91
+ "@types/react": "^19.2.17",
92
92
  "@types/react-color": "^3.0.13",
93
93
  "@types/react-dom": "^19.2.3",
94
94
  "@types/uuid": "^11.0.0",
95
- "@vitejs/plugin-react-swc": "^4.2.3",
96
- "eslint": "^9.30.1",
97
- "graphql-zeus": "^7.1.9",
98
- "i18next-resources-for-ts": "^2.0.0",
99
- "tailwindcss": "^4.1.18",
100
- "tsx": "^4.21.0",
95
+ "@vitejs/plugin-react-swc": "^4.3.1",
96
+ "eslint": "^9.39.4",
97
+ "graphql-zeus": "^7.2.1",
98
+ "i18next-resources-for-ts": "^2.1.0",
99
+ "tailwindcss": "^4.3.1",
100
+ "tsx": "^4.22.4",
101
101
  "tw-animate-css": "^1.4.0",
102
- "typescript": "~5.9.3",
103
- "vite": "^7.3.1",
104
- "vite-plugin-i18next-loader": "^3.1.3",
105
- "vite-tsconfig-paths": "^6.1.0"
102
+ "typescript": "~6.0.3",
103
+ "vite": "^8.0.16",
104
+ "vite-plugin-i18next-loader": "^4.0.1",
105
+ "vite-tsconfig-paths": "^6.1.1"
106
106
  },
107
107
  "scripts": {
108
108
  "watch": "tspc --watch",