@crystaldesign/diva-backoffice 25.8.0-beta.19 → 25.8.0-beta.2
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/build/esm/index.js +72 -220
- package/build/types/backoffice/src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useCatalogContext.d.ts +4 -4
- package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useCatalogContext.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts.map +1 -1
- package/package.json +9 -9
package/build/esm/index.js
CHANGED
@@ -7894,20 +7894,6 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
7894
7894
|
hidden: function hidden(data) {
|
7895
7895
|
return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
|
7896
7896
|
}
|
7897
|
-
}, {
|
7898
|
-
name: 'privacyPolicyUrl',
|
7899
|
-
label: t('backoffice.form.organizationdetails.items.privacyPolicyUrl'),
|
7900
|
-
type: 'input',
|
7901
|
-
hidden: function hidden(data) {
|
7902
|
-
return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
|
7903
|
-
}
|
7904
|
-
}, {
|
7905
|
-
name: 'termsAndConditionsUrl',
|
7906
|
-
label: t('backoffice.form.organizationdetails.items.termsAndConditionsUrl'),
|
7907
|
-
type: 'input',
|
7908
|
-
hidden: function hidden(data) {
|
7909
|
-
return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
|
7910
|
-
}
|
7911
7897
|
}, {
|
7912
7898
|
name: ['defaultCatalog', 'catalogId'],
|
7913
7899
|
accountName: ['defaultCatalog', 'accountId'],
|
@@ -8823,14 +8809,6 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
8823
8809
|
}, {
|
8824
8810
|
name: 'mediaItemRefVideo',
|
8825
8811
|
hidden: true
|
8826
|
-
}, {
|
8827
|
-
name: 'loop',
|
8828
|
-
type: 'checkbox',
|
8829
|
-
label: t('backoffice.form.contentItem.loop'),
|
8830
|
-
doTranslate: false,
|
8831
|
-
hidden: function hidden(d) {
|
8832
|
-
return (d === null || d === void 0 ? void 0 : d.type) !== 'Video';
|
8833
|
-
}
|
8834
8812
|
}]
|
8835
8813
|
});
|
8836
8814
|
translationItems.push({
|
@@ -8889,12 +8867,6 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
8889
8867
|
label: t('backoffice.form.api2servers.items.url'),
|
8890
8868
|
doTranslate: true
|
8891
8869
|
});
|
8892
|
-
translationItems.push({
|
8893
|
-
name: [].concat(_toConsumableArray(p), ['loop']),
|
8894
|
-
type: 'checkbox',
|
8895
|
-
label: t('backoffice.form.contentItem.loop'),
|
8896
|
-
doTranslate: false
|
8897
|
-
});
|
8898
8870
|
break;
|
8899
8871
|
case 'Wrapper':
|
8900
8872
|
translationItems.push({
|
@@ -9130,12 +9102,6 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
9130
9102
|
label: t('backoffice.form.api2servers.items.url'),
|
9131
9103
|
doTranslate: true
|
9132
9104
|
});
|
9133
|
-
translationItems.push({
|
9134
|
-
name: [].concat(_toConsumableArray(p), ['loop']),
|
9135
|
-
type: 'checkbox',
|
9136
|
-
label: t('backoffice.form.contentItem.loop'),
|
9137
|
-
doTranslate: false
|
9138
|
-
});
|
9139
9105
|
break;
|
9140
9106
|
case 'Wrapper':
|
9141
9107
|
translationItems.push({
|
@@ -17509,29 +17475,14 @@ function useSelectSimpleData (_ref) {
|
|
17509
17475
|
});
|
17510
17476
|
return selected.value;
|
17511
17477
|
}, [selected]);
|
17512
|
-
var setLoadedOptions = function setLoadedOptions(options) {
|
17513
|
-
var _options$;
|
17514
|
-
setOptions(options);
|
17515
|
-
if (value && options) {
|
17516
|
-
LOG$a.debug('value changed', toJS(value), toJS(options));
|
17517
|
-
var _selected = findByValue(value, options, selectMapping);
|
17518
|
-
var selectedValues = Array.isArray(_selected) ? _selected.map(function (item) {
|
17519
|
-
return item.value;
|
17520
|
-
}) : _selected === null || _selected === void 0 ? void 0 : _selected.value;
|
17521
|
-
onSelectionChanged(selectedValues, _selected);
|
17522
|
-
} else if (options !== null && options !== void 0 && (_options$ = options[0]) !== null && _options$ !== void 0 && _options$.value && autoSelectFirst) {
|
17523
|
-
onSelectionChanged(options[0].value, options[0]);
|
17524
|
-
}
|
17525
|
-
};
|
17526
17478
|
useEffect(function () {
|
17527
17479
|
if (configuredOptions) {
|
17528
17480
|
if (apiHandler.canReadList) LOG$a.warn('If options are provided, apiInterface will not be used');
|
17529
|
-
|
17481
|
+
setOptions(configuredOptions);
|
17530
17482
|
setLoading(false);
|
17531
17483
|
return;
|
17532
17484
|
}
|
17533
|
-
if (
|
17534
|
-
setLoadedOptions(sharedState.options);
|
17485
|
+
if (options) {
|
17535
17486
|
setLoading(false);
|
17536
17487
|
return;
|
17537
17488
|
}
|
@@ -17543,11 +17494,25 @@ function useSelectSimpleData (_ref) {
|
|
17543
17494
|
var options = data.data.map(function (item) {
|
17544
17495
|
return parseDataEntry(item, selectMapping);
|
17545
17496
|
});
|
17546
|
-
|
17497
|
+
setOptions(options);
|
17547
17498
|
})["finally"](function () {
|
17548
17499
|
setLoading(false);
|
17549
17500
|
});
|
17550
17501
|
}, []);
|
17502
|
+
useEffect(function () {
|
17503
|
+
var _options$;
|
17504
|
+
// set the selected option only after the options are loaded
|
17505
|
+
if (value && options) {
|
17506
|
+
LOG$a.debug('value changed', value);
|
17507
|
+
var _selected = findByValue(value, options, selectMapping);
|
17508
|
+
var selectedValues = Array.isArray(_selected) ? _selected.map(function (item) {
|
17509
|
+
return item.value;
|
17510
|
+
}) : _selected === null || _selected === void 0 ? void 0 : _selected.value;
|
17511
|
+
onSelectionChanged(selectedValues, _selected);
|
17512
|
+
} else if (options !== null && options !== void 0 && (_options$ = options[0]) !== null && _options$ !== void 0 && _options$.value && autoSelectFirst) {
|
17513
|
+
onSelectionChanged(options[0].value, options[0]);
|
17514
|
+
}
|
17515
|
+
}, [value, options]);
|
17551
17516
|
var onSelectionChanged = function onSelectionChanged(value, option) {
|
17552
17517
|
setSelected(option);
|
17553
17518
|
onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
|
@@ -31630,7 +31595,7 @@ var TableGroups = observer(function () {
|
|
31630
31595
|
selectedPackage = _useModule.selectedPackage;
|
31631
31596
|
useTools({
|
31632
31597
|
packageId: packageId,
|
31633
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
31598
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
31634
31599
|
});
|
31635
31600
|
var applicationData = useMemo(function () {
|
31636
31601
|
return {
|
@@ -31773,7 +31738,7 @@ function PublishCustomCell (_ref) {
|
|
31773
31738
|
var disabled = !data.basedCatalogId && !data.basedPackageId || !data.name;
|
31774
31739
|
var _onChange = /*#__PURE__*/function () {
|
31775
31740
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(publish) {
|
31776
|
-
var loadingTimeout, response
|
31741
|
+
var loadingTimeout, response;
|
31777
31742
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31778
31743
|
while (1) switch (_context.prev = _context.next) {
|
31779
31744
|
case 0:
|
@@ -31810,7 +31775,7 @@ function PublishCustomCell (_ref) {
|
|
31810
31775
|
break;
|
31811
31776
|
}
|
31812
31777
|
modalState.showWarningModal(t("backoffice.idmEnricher.packages.label.warning.".concat(publish ? 'publishing' : 'unpublishing')));
|
31813
|
-
_context.next =
|
31778
|
+
_context.next = 22;
|
31814
31779
|
break;
|
31815
31780
|
case 17:
|
31816
31781
|
if (!(response.status == 200)) {
|
@@ -31818,46 +31783,30 @@ function PublishCustomCell (_ref) {
|
|
31818
31783
|
break;
|
31819
31784
|
}
|
31820
31785
|
modalState.closeModal();
|
31821
|
-
_context.next =
|
31786
|
+
_context.next = 22;
|
31822
31787
|
break;
|
31823
31788
|
case 21:
|
31824
|
-
|
31825
|
-
|
31826
|
-
return response.json();
|
31827
|
-
case 24:
|
31828
|
-
json = _context.sent;
|
31829
|
-
errorText = json.error;
|
31830
|
-
_context.next = 33;
|
31831
|
-
break;
|
31832
|
-
case 28:
|
31833
|
-
_context.prev = 28;
|
31834
|
-
_context.t0 = _context["catch"](21);
|
31835
|
-
_context.next = 32;
|
31836
|
-
return response.text();
|
31837
|
-
case 32:
|
31838
|
-
errorText = _context.sent;
|
31839
|
-
case 33:
|
31840
|
-
throw new Error((_errorText = errorText) !== null && _errorText !== void 0 ? _errorText : "Server error (".concat(response.status, ")"));
|
31841
|
-
case 34:
|
31789
|
+
throw new Error("Server errror: ".concat(response.statusText, " (").concat(response.status, ")"));
|
31790
|
+
case 22:
|
31842
31791
|
context === null || context === void 0 || context.reset({
|
31843
31792
|
context: context,
|
31844
31793
|
api: api
|
31845
31794
|
});
|
31846
|
-
_context.next =
|
31795
|
+
_context.next = 28;
|
31847
31796
|
break;
|
31848
|
-
case
|
31849
|
-
_context.prev =
|
31850
|
-
_context.
|
31851
|
-
modalState.showErrorModal("Error on ".concat(publish ? 'publish' : 'unpublish', ": ").concat(_context.
|
31852
|
-
case
|
31853
|
-
_context.prev =
|
31797
|
+
case 25:
|
31798
|
+
_context.prev = 25;
|
31799
|
+
_context.t0 = _context["catch"](2);
|
31800
|
+
modalState.showErrorModal("Error on ".concat(publish ? 'publish' : 'unpublish', ": ").concat(_context.t0 instanceof Error ? _context.t0.message : String(_context.t0)));
|
31801
|
+
case 28:
|
31802
|
+
_context.prev = 28;
|
31854
31803
|
isLoading(false);
|
31855
|
-
return _context.finish(
|
31856
|
-
case
|
31804
|
+
return _context.finish(28);
|
31805
|
+
case 31:
|
31857
31806
|
case "end":
|
31858
31807
|
return _context.stop();
|
31859
31808
|
}
|
31860
|
-
}, _callee, null, [[2,
|
31809
|
+
}, _callee, null, [[2, 25, 28, 31]]);
|
31861
31810
|
}));
|
31862
31811
|
return function onChange(_x) {
|
31863
31812
|
return _ref2.apply(this, arguments);
|
@@ -32218,11 +32167,8 @@ var TablePackages = observer(function () {
|
|
32218
32167
|
closeModal = modalState.closeModal,
|
32219
32168
|
contextHolder = modalState.contextHolder;
|
32220
32169
|
var _useEnricherContext = useEnricherContext([]),
|
32221
|
-
setSelectedPackage = _useEnricherContext.setSelectedPackage
|
32222
|
-
|
32223
|
-
useTools({
|
32224
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
|
32225
|
-
});
|
32170
|
+
setSelectedPackage = _useEnricherContext.setSelectedPackage;
|
32171
|
+
useTools({});
|
32226
32172
|
var organizationId = root.dataStore.organizationId;
|
32227
32173
|
var apiConfig = root.configurationStore.apiConfig;
|
32228
32174
|
var applicationData = useMemo(function () {
|
@@ -32477,7 +32423,7 @@ var TableProperties = observer(function () {
|
|
32477
32423
|
selectedPackage = _useModule.selectedPackage;
|
32478
32424
|
useTools({
|
32479
32425
|
packageId: packageId,
|
32480
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
32426
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
32481
32427
|
});
|
32482
32428
|
var applicationData = useMemo(function () {
|
32483
32429
|
return {
|
@@ -33267,7 +33213,7 @@ var RenamingTable = observer(function (_ref) {
|
|
33267
33213
|
selectedSerie = _useModule.selectedSerie;
|
33268
33214
|
useTools({
|
33269
33215
|
packageId: packageId,
|
33270
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
33216
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
33271
33217
|
});
|
33272
33218
|
var baseConfiguration = useMemo(function () {
|
33273
33219
|
return getConfig((selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds) || ['DE'], t);
|
@@ -33831,7 +33777,7 @@ var ExclusivityTable = observer(function (_ref) {
|
|
33831
33777
|
selectedSerie = _useModule.selectedSerie;
|
33832
33778
|
useTools({
|
33833
33779
|
packageId: packageId,
|
33834
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
33780
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
33835
33781
|
});
|
33836
33782
|
var apiInterface = useMemo(function () {
|
33837
33783
|
var patchId = '${_id}';
|
@@ -33929,7 +33875,7 @@ var TableTabGroups = observer(function () {
|
|
33929
33875
|
selectedPackage = _useModule.selectedPackage;
|
33930
33876
|
useTools({
|
33931
33877
|
packageId: packageId,
|
33932
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
33878
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
33933
33879
|
});
|
33934
33880
|
var applicationData = useMemo(function () {
|
33935
33881
|
return {
|
@@ -34033,7 +33979,7 @@ var TablePartlistPos = observer(function () {
|
|
34033
33979
|
selectedPackage = _useModule.selectedPackage;
|
34034
33980
|
useTools({
|
34035
33981
|
packageId: packageId,
|
34036
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
33982
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
34037
33983
|
});
|
34038
33984
|
var posInvisibility = useMemo(function () {
|
34039
33985
|
return [{
|
@@ -35220,7 +35166,7 @@ var TablePriceList = observer(function () {
|
|
35220
35166
|
setSelectedNodeId = _React$useState4[1];
|
35221
35167
|
useTools({
|
35222
35168
|
packageId: packageId,
|
35223
|
-
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.
|
35169
|
+
isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
|
35224
35170
|
});
|
35225
35171
|
var setNodeDataValue = useCallback(function (data) {
|
35226
35172
|
spreadsheetRef.current.setNodeDataValue(selectedNodeId, data);
|
@@ -35927,34 +35873,24 @@ var useCatalogContext = function useCatalogContext() {
|
|
35927
35873
|
root.contextStore.clearContext('catalog');
|
35928
35874
|
}
|
35929
35875
|
|
35930
|
-
//
|
35876
|
+
// Only update if catalog changed
|
35877
|
+
// initally ony the id is set so we need to update it again if we get the full catalog form the selector, so only checking for id is not enough
|
35931
35878
|
var currentCatalog = getContext().selectedCatalog;
|
35932
|
-
|
35933
|
-
|
35934
|
-
if (!catalogChanged && !catalogDataOnlyChanged) {
|
35935
|
-
// No changes detected
|
35936
|
-
return;
|
35937
|
-
}
|
35938
|
-
if (!catalogChanged && catalogDataOnlyChanged) {
|
35939
|
-
// Only the data changed, so we only need to update the context of the catalog
|
35940
|
-
root.contextStore.updateContext('catalog', {
|
35941
|
-
selectedCatalog: newCatalog,
|
35942
|
-
catalogId: newCatalog._id
|
35943
|
-
});
|
35944
|
-
return;
|
35879
|
+
if (currentCatalog._id === newCatalog._id && currentCatalog.name === newCatalog.name && JSON.stringify(currentCatalog.isoLanguageIds) === JSON.stringify(newCatalog.isoLanguageIds)) {
|
35880
|
+
return; // No changes detected
|
35945
35881
|
}
|
35946
|
-
if (catalogChanged) {
|
35947
|
-
// The catalog changed, so we need to rest the full context
|
35948
|
-
root.contextStore.updateContext('catalog', {
|
35949
|
-
selectedCatalog: newCatalog,
|
35950
|
-
catalogId: newCatalog._id,
|
35951
|
-
selectedSerie: undefined,
|
35952
|
-
selectedItem: undefined,
|
35953
|
-
selectedFeature: undefined,
|
35954
|
-
seriesSelectorState: createDefaultSelectState('seriesSelectorState'),
|
35955
|
-
featureSelectorState: createDefaultSelectState('featureSelectorState')
|
35956
|
-
});
|
35957
35882
|
|
35883
|
+
// Update any field catalog changed
|
35884
|
+
root.contextStore.updateContext('catalog', {
|
35885
|
+
selectedCatalog: newCatalog,
|
35886
|
+
catalogId: newCatalog._id,
|
35887
|
+
selectedSerie: undefined,
|
35888
|
+
selectedItem: undefined,
|
35889
|
+
selectedFeature: undefined,
|
35890
|
+
seriesSelectorState: createDefaultSelectState('seriesSelectorState'),
|
35891
|
+
featureSelectorState: createDefaultSelectState('featureSelectorState')
|
35892
|
+
});
|
35893
|
+
if (currentCatalog._id !== newCatalog._id) {
|
35958
35894
|
// Update URL only if the id changed
|
35959
35895
|
navigate(path + newCatalog._id + (modules.length ? '/' + modules.join('/') : '') + (searchParams ? '?' + searchParams.toString() : ''));
|
35960
35896
|
}
|
@@ -36783,22 +36719,27 @@ var CatalogSelector$1 = observer(CatalogSelector);
|
|
36783
36719
|
var SeriesSelector = function SeriesSelector(_ref) {
|
36784
36720
|
var modules = _ref.modules;
|
36785
36721
|
var _useTranslation = useTranslation(),
|
36786
|
-
t = _useTranslation.t
|
36787
|
-
|
36788
|
-
|
36789
|
-
|
36790
|
-
|
36791
|
-
selectedSerie =
|
36792
|
-
|
36793
|
-
|
36722
|
+
t = _useTranslation.t,
|
36723
|
+
i18n = _useTranslation.i18n;
|
36724
|
+
var _useCatalogContext = useCatalogContext(modules),
|
36725
|
+
catalogId = _useCatalogContext.catalogId,
|
36726
|
+
idmService = _useCatalogContext.idmService,
|
36727
|
+
selectedSerie = _useCatalogContext.selectedSerie,
|
36728
|
+
setSelectedSerie = _useCatalogContext.setSelectedSerie,
|
36729
|
+
seriesSelectorState = _useCatalogContext.seriesSelectorState;
|
36794
36730
|
return /*#__PURE__*/jsx(SimpleSelect, {
|
36795
36731
|
sharedState: seriesSelectorState,
|
36796
|
-
apiInterface:
|
36797
|
-
|
36732
|
+
apiInterface: {
|
36733
|
+
read: idmService + '/v3.0/catalogs/' + catalogId + "/series?fields=seriesName[".concat(i18n.language.toLocaleUpperCase(), "];_id;serieNo;pricefeaturegroups;pricefeaturegroupsDisplayTexts;pricefeaturegroupsKeys;pricefeaturegroupsKeysDisplayTexts")
|
36734
|
+
},
|
36735
|
+
selectMapping: {
|
36736
|
+
label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "}"),
|
36737
|
+
value: '${_id}'
|
36738
|
+
},
|
36798
36739
|
autoSelectFirst: true,
|
36799
36740
|
title: t('backoffice.menu.items.label.IDMCatalogEditorTableSeries'),
|
36800
36741
|
value: selectedSerie,
|
36801
|
-
onChange:
|
36742
|
+
onChange: setSelectedSerie,
|
36802
36743
|
search: true,
|
36803
36744
|
style: {
|
36804
36745
|
width: 200
|
@@ -36807,95 +36748,6 @@ var SeriesSelector = function SeriesSelector(_ref) {
|
|
36807
36748
|
}, catalogId);
|
36808
36749
|
};
|
36809
36750
|
var SeriesSelector$1 = observer(SeriesSelector);
|
36810
|
-
var useSeriesSelector = function useSeriesSelector(modules) {
|
36811
|
-
var _useTranslation2 = useTranslation(),
|
36812
|
-
i18n = _useTranslation2.i18n;
|
36813
|
-
var root = useStore();
|
36814
|
-
var _useCatalogContext = useCatalogContext(modules),
|
36815
|
-
catalogId = _useCatalogContext.catalogId,
|
36816
|
-
idmService = _useCatalogContext.idmService,
|
36817
|
-
selectedSerie = _useCatalogContext.selectedSerie,
|
36818
|
-
setSelectedSerie = _useCatalogContext.setSelectedSerie,
|
36819
|
-
seriesSelectorState = _useCatalogContext.seriesSelectorState;
|
36820
|
-
var _useState = useState(selectedSerie),
|
36821
|
-
_useState2 = _slicedToArray(_useState, 2),
|
36822
|
-
selected = _useState2[0],
|
36823
|
-
setSelected = _useState2[1];
|
36824
|
-
var apiInterface = {
|
36825
|
-
read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id")
|
36826
|
-
};
|
36827
|
-
var selectMapping = {
|
36828
|
-
label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "}"),
|
36829
|
-
value: '${_id}'
|
36830
|
-
};
|
36831
|
-
var fetchSerie = /*#__PURE__*/function () {
|
36832
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(newSerie) {
|
36833
|
-
var _seriesSelectorState$, _seriesSelectorState$2;
|
36834
|
-
var isLoaded, api, serie, option;
|
36835
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
36836
|
-
while (1) switch (_context.prev = _context.next) {
|
36837
|
-
case 0:
|
36838
|
-
if (newSerie) {
|
36839
|
-
_context.next = 2;
|
36840
|
-
break;
|
36841
|
-
}
|
36842
|
-
return _context.abrupt("return");
|
36843
|
-
case 2:
|
36844
|
-
// if the extend series data is already loaded, use it
|
36845
|
-
isLoaded = !!((_seriesSelectorState$ = seriesSelectorState.options) !== null && _seriesSelectorState$ !== void 0 && (_seriesSelectorState$ = _seriesSelectorState$.find(function (option) {
|
36846
|
-
return option.value === (newSerie === null || newSerie === void 0 ? void 0 : newSerie._id);
|
36847
|
-
})) !== null && _seriesSelectorState$ !== void 0 && (_seriesSelectorState$ = _seriesSelectorState$.data) !== null && _seriesSelectorState$ !== void 0 && _seriesSelectorState$.serieNo);
|
36848
|
-
if (!isLoaded) {
|
36849
|
-
_context.next = 6;
|
36850
|
-
break;
|
36851
|
-
}
|
36852
|
-
setSelectedSerie(newSerie);
|
36853
|
-
return _context.abrupt("return");
|
36854
|
-
case 6:
|
36855
|
-
//fetching of pricefeatruegroups is slow, so we can't fetch it in the list, but only for the selected serie
|
36856
|
-
seriesSelectorState.setLoading(true);
|
36857
|
-
api = new _default$d({
|
36858
|
-
type: 'SelectSimple',
|
36859
|
-
apiInterface: {
|
36860
|
-
read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series/").concat(newSerie._id, "?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id;serieNo;pricefeaturegroups;pricefeaturegroupsDisplayTexts;pricefeaturegroupsKeys;pricefeaturegroupsKeysDisplayTexts")
|
36861
|
-
}
|
36862
|
-
}, root);
|
36863
|
-
_context.next = 10;
|
36864
|
-
return api.read();
|
36865
|
-
case 10:
|
36866
|
-
serie = _context.sent;
|
36867
|
-
//save the extended series data in the options, without triggering state change
|
36868
|
-
option = (_seriesSelectorState$2 = seriesSelectorState.options) === null || _seriesSelectorState$2 === void 0 ? void 0 : _seriesSelectorState$2.find(function (option) {
|
36869
|
-
return option.value === newSerie._id;
|
36870
|
-
});
|
36871
|
-
if (option) {
|
36872
|
-
option.data = serie;
|
36873
|
-
}
|
36874
|
-
setSelectedSerie(serie);
|
36875
|
-
seriesSelectorState.setLoading(false);
|
36876
|
-
case 15:
|
36877
|
-
case "end":
|
36878
|
-
return _context.stop();
|
36879
|
-
}
|
36880
|
-
}, _callee);
|
36881
|
-
}));
|
36882
|
-
return function fetchSerie(_x) {
|
36883
|
-
return _ref2.apply(this, arguments);
|
36884
|
-
};
|
36885
|
-
}();
|
36886
|
-
var onChange = function onChange(value) {
|
36887
|
-
setSelected(value);
|
36888
|
-
fetchSerie(value);
|
36889
|
-
};
|
36890
|
-
return {
|
36891
|
-
catalogId: catalogId,
|
36892
|
-
seriesSelectorState: seriesSelectorState,
|
36893
|
-
apiInterface: apiInterface,
|
36894
|
-
selectMapping: selectMapping,
|
36895
|
-
selectedSerie: selected,
|
36896
|
-
onChange: onChange
|
36897
|
-
};
|
36898
|
-
};
|
36899
36751
|
|
36900
36752
|
function useModule (currentModules) {
|
36901
36753
|
var root = useStore();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SeriesSelector.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"SeriesSelector.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;uCAMW;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE;;;AA8B1D,wBAAwC"}
|
@@ -8,12 +8,12 @@ export declare const useCatalogContext: (currentModules?: string[]) => {
|
|
8
8
|
selectedCatalog: any;
|
9
9
|
idmService: string;
|
10
10
|
organizationId: string;
|
11
|
-
catalogSelectorState
|
11
|
+
catalogSelectorState?: SharedSelectState;
|
12
12
|
selectedSerie?: any;
|
13
|
-
seriesSelectorState
|
13
|
+
seriesSelectorState?: SharedSelectState;
|
14
14
|
selectedItem?: any;
|
15
|
-
itemSelectorState
|
15
|
+
itemSelectorState?: SharedSelectState;
|
16
16
|
selectedFeature?: any;
|
17
|
-
featureSelectorState
|
17
|
+
featureSelectorState?: SharedSelectState;
|
18
18
|
};
|
19
19
|
//# sourceMappingURL=useCatalogContext.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCatalogContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useCatalogContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAiBjG,eAAO,MAAM,iBAAiB,oBAAoB,MAAM,EAAE;8BAqD9C,GAAG,GAAG,SAAS;4BAOhB,GAAG,GAAG,SAAS;kCAOZ,GAAG,GAAG,SAAS;kCAOf,GAAG,GAAG,MAAM,YAAW,MAAM,EAAE,SAAyB,MAAM,UAAiB,OAAO;eAvFvF,MAAM;qBACA,GAAG;gBACR,MAAM;oBACF,MAAM;
|
1
|
+
{"version":3,"file":"useCatalogContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useCatalogContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAiBjG,eAAO,MAAM,iBAAiB,oBAAoB,MAAM,EAAE;8BAqD9C,GAAG,GAAG,SAAS;4BAOhB,GAAG,GAAG,SAAS;kCAOZ,GAAG,GAAG,SAAS;kCAOf,GAAG,GAAG,MAAM,YAAW,MAAM,EAAE,SAAyB,MAAM,UAAiB,OAAO;eAvFvF,MAAM;qBACA,GAAG;gBACR,MAAM;oBACF,MAAM;2BACC,iBAAiB;oBACxB,GAAG;0BACG,iBAAiB;mBACxB,GAAG;wBACE,iBAAiB;sBACnB,GAAG;2BACE,iBAAiB;CAsIzC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PublishCustomCell.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,GACX,EAAE,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,iBAAiB,CAAA;CAAE,CAAC,
|
1
|
+
{"version":3,"file":"PublishCustomCell.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,GACX,EAAE,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,iBAAiB,CAAA;CAAE,CAAC,0BAyEhG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSelectSimpleData.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/SelectSimple/useSelectSimpleData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAiB,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"useSelectSimpleData.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/SelectSimple/useSelectSimpleData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAiB,MAAM,SAAS,CAAC;AAMvE,MAAM,CAAC,OAAO,WAAW,EACvB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EACf,WAAW,GACZ,EAAE,qBAAqB;;;;sBAsEa,GAAG,UAAU,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;;EAiB9E"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@crystaldesign/diva-backoffice",
|
3
|
-
"version": "25.8.0-beta.
|
3
|
+
"version": "25.8.0-beta.2",
|
4
4
|
"license": "COMMERCIAL",
|
5
5
|
"devDependencies": {
|
6
6
|
"@testing-library/jest-dom": "^6.5.0",
|
@@ -15,13 +15,13 @@
|
|
15
15
|
"dependencies": {
|
16
16
|
"@ant-design/icons": "5.4.0",
|
17
17
|
"@babel/runtime": "7.24.7",
|
18
|
-
"@crystaldesign/content-box": "25.8.0-beta.
|
19
|
-
"@crystaldesign/content-item": "25.8.0-beta.
|
20
|
-
"@crystaldesign/diva-core": "25.8.0-beta.
|
21
|
-
"@crystaldesign/diva-utils": "25.8.0-beta.
|
22
|
-
"@crystaldesign/media-upload": "25.8.0-beta.
|
23
|
-
"@crystaldesign/rtf-editor": "25.8.0-beta.
|
24
|
-
"@crystaldesign/spreadsheet": "25.8.0-beta.
|
18
|
+
"@crystaldesign/content-box": "25.8.0-beta.2",
|
19
|
+
"@crystaldesign/content-item": "25.8.0-beta.2",
|
20
|
+
"@crystaldesign/diva-core": "25.8.0-beta.2",
|
21
|
+
"@crystaldesign/diva-utils": "25.8.0-beta.2",
|
22
|
+
"@crystaldesign/media-upload": "25.8.0-beta.2",
|
23
|
+
"@crystaldesign/rtf-editor": "25.8.0-beta.2",
|
24
|
+
"@crystaldesign/spreadsheet": "25.8.0-beta.2",
|
25
25
|
"@google/model-viewer": "3.5.0",
|
26
26
|
"ag-charts-community": "^10.1.0",
|
27
27
|
"ag-charts-react": "^10.1.0",
|
@@ -51,5 +51,5 @@
|
|
51
51
|
},
|
52
52
|
"module": "build/esm/index.js",
|
53
53
|
"types": "./build/types/backoffice/src/index.d.ts",
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "4333eeff9a165c43b2421ffe3abb4852c6014f08"
|
55
55
|
}
|