@crystaldesign/diva-seller 26.8.0-beta.9 → 26.9.0-beta.1
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 +336 -199
- package/build/types/seller/src/components/Articles/index.d.ts.map +1 -1
- package/build/types/seller/src/components/Basket/index.d.ts.map +1 -1
- package/build/types/seller/src/components/Catalogs/index.d.ts.map +1 -1
- package/build/types/seller/src/components/Collections/index.d.ts.map +1 -1
- package/build/types/seller/src/provider/SellerStateProvider.d.ts.map +1 -1
- package/build/types/seller/src/provider/hooks/useSellerStateData/index.d.ts.map +1 -1
- package/build/types/seller/src/services/ApiHandler.d.ts.map +1 -1
- package/build/types/seller/src/types.d.ts +4 -0
- package/build/types/seller/src/types.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/PriceOverView/Set/SetTable.d.ts.map +1 -1
- package/package.json +5 -5
package/build/esm/index.js
CHANGED
|
@@ -108,8 +108,8 @@ import Settings from '@mui/icons-material/Settings';
|
|
|
108
108
|
globalThis.process = { env:env };
|
|
109
109
|
})();
|
|
110
110
|
|
|
111
|
-
function ownKeys$
|
|
112
|
-
function _objectSpread$
|
|
111
|
+
function ownKeys$J(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
112
|
+
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
113
113
|
function useApiLogin(_ref) {
|
|
114
114
|
var jwt = _ref.jwt,
|
|
115
115
|
userRole = _ref.userRole,
|
|
@@ -128,7 +128,7 @@ function useApiLogin(_ref) {
|
|
|
128
128
|
useEffect(function () {
|
|
129
129
|
getSessionGuid(userRole, loginMode).then(function (sessionGuid) {
|
|
130
130
|
return setState({
|
|
131
|
-
sessionGuids: _objectSpread$
|
|
131
|
+
sessionGuids: _objectSpread$J(_objectSpread$J({}, state.sessionGuids), {}, _defineProperty({}, organizationId, sessionGuid)),
|
|
132
132
|
isLoading: false
|
|
133
133
|
});
|
|
134
134
|
});
|
|
@@ -206,8 +206,8 @@ var SellerContext = /*#__PURE__*/createContext({
|
|
|
206
206
|
});
|
|
207
207
|
|
|
208
208
|
var _excluded$d = ["internal"];
|
|
209
|
-
function ownKeys$
|
|
210
|
-
function _objectSpread$
|
|
209
|
+
function ownKeys$I(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
210
|
+
function _objectSpread$I(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$I(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$I(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
211
211
|
var GROUP_ID = 'SELLER';
|
|
212
212
|
function useBreadcrumbs(_ref) {
|
|
213
213
|
var updateBreadcrumbs = _ref.updateBreadcrumbs,
|
|
@@ -392,18 +392,20 @@ function breadcrumbPlanner(_ref6) {
|
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
if (state.currentCatalogCodex && (_state$catalogData = state.catalogData) !== null && _state$catalogData !== void 0 && _state$catalogData[0].hasPlanner) {
|
|
395
|
-
var _state$collections, _state$currentAccount3;
|
|
395
|
+
var _state$collections, _coll$enricherSeries, _state$currentAccount3;
|
|
396
396
|
var coll = (_state$collections = state.collections) === null || _state$collections === void 0 ? void 0 : _state$collections.find(function (c) {
|
|
397
397
|
return c.id == state.currentCollectionId;
|
|
398
398
|
});
|
|
399
|
-
var isIDMData = (coll
|
|
399
|
+
var isIDMData = !!(coll !== null && coll !== void 0 && (_coll$enricherSeries = coll.enricherSeries) !== null && _coll$enricherSeries !== void 0 && _coll$enricherSeries.some(function (s) {
|
|
400
|
+
return s.serieNo === state.currentCatalogCodex;
|
|
401
|
+
}));
|
|
400
402
|
return {
|
|
401
403
|
groupId: GROUP_ID,
|
|
402
404
|
level: 3,
|
|
403
405
|
name: 'navigation.planning',
|
|
404
406
|
component: {
|
|
405
407
|
type: 'DIVA_WEBPLANNER',
|
|
406
|
-
parameters: _objectSpread$
|
|
408
|
+
parameters: _objectSpread$I(_objectSpread$I(_objectSpread$I({
|
|
407
409
|
catalogCodex: state.currentCatalogCodex,
|
|
408
410
|
accountGuid: (_state$currentAccount3 = state.currentAccountId) !== null && _state$currentAccount3 !== void 0 ? _state$currentAccount3 : ''
|
|
409
411
|
}, state.currentDivaNr ? {
|
|
@@ -479,11 +481,11 @@ function breadcrumbCollection() {
|
|
|
479
481
|
};
|
|
480
482
|
}
|
|
481
483
|
|
|
482
|
-
function ownKeys$
|
|
483
|
-
function _objectSpread$
|
|
484
|
+
function ownKeys$H(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
485
|
+
function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$H(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$H(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
484
486
|
var reducer$1 = function reducer(state, action) {
|
|
485
487
|
if (action.type == 'update') {
|
|
486
|
-
var newState = _objectSpread$
|
|
488
|
+
var newState = _objectSpread$H({}, state);
|
|
487
489
|
action.payload.forEach(function (p) {
|
|
488
490
|
if (p.field == 'basketState') {
|
|
489
491
|
if (p.value) {
|
|
@@ -517,8 +519,11 @@ function updateBasketState(state, _ref) {
|
|
|
517
519
|
};
|
|
518
520
|
}
|
|
519
521
|
|
|
520
|
-
function ownKeys$
|
|
521
|
-
function _objectSpread$
|
|
522
|
+
function ownKeys$G(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
523
|
+
function _objectSpread$G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$G(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
524
|
+
function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
525
|
+
function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
|
|
526
|
+
function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
522
527
|
var LOG$b = getLogger('Seller', 'ApiHandler');
|
|
523
528
|
function apiLoadAnalyticScore(_x) {
|
|
524
529
|
return _apiLoadAnalyticScore.apply(this, arguments);
|
|
@@ -570,6 +575,11 @@ function _apiLoadAnalyticScore() {
|
|
|
570
575
|
function apiLoadCollections(_x2) {
|
|
571
576
|
return _apiLoadCollections.apply(this, arguments);
|
|
572
577
|
}
|
|
578
|
+
|
|
579
|
+
// Merge enricher collections into the API2 list by (normalized) name: a matching name combines both
|
|
580
|
+
// sources into a single collection (API2 identity kept, enricher series attached), so its catalog
|
|
581
|
+
// list later shows the legacy and the new catalogs together. Non-matching enricher collections are
|
|
582
|
+
// appended as their own entries.
|
|
573
583
|
function _apiLoadCollections() {
|
|
574
584
|
_apiLoadCollections = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
575
585
|
var serverUrl, enricherUrl, sessionGuid, settings, jwt, organizationId, language, newCollectionArray, _response$Accounts$ma, _response$Accounts, fullUrl, response, enricherCollections;
|
|
@@ -623,7 +633,7 @@ function _apiLoadCollections() {
|
|
|
623
633
|
return apiLoadCollectionsEnricher(enricherUrl, jwt, organizationId, language);
|
|
624
634
|
case 17:
|
|
625
635
|
enricherCollections = _context2.sent;
|
|
626
|
-
if (enricherCollections) newCollectionArray =
|
|
636
|
+
if (enricherCollections) newCollectionArray = mergeCollectionsByName(newCollectionArray, enricherCollections);
|
|
627
637
|
case 19:
|
|
628
638
|
return _context2.abrupt("return", newCollectionArray);
|
|
629
639
|
case 20:
|
|
@@ -634,6 +644,36 @@ function _apiLoadCollections() {
|
|
|
634
644
|
}));
|
|
635
645
|
return _apiLoadCollections.apply(this, arguments);
|
|
636
646
|
}
|
|
647
|
+
function mergeCollectionsByName(api2Collections, enricherCollections) {
|
|
648
|
+
var normalize = function normalize(name) {
|
|
649
|
+
return (name !== null && name !== void 0 ? name : '').trim().toLocaleLowerCase();
|
|
650
|
+
};
|
|
651
|
+
var merged = _toConsumableArray(api2Collections);
|
|
652
|
+
var byName = new Map(merged.map(function (c) {
|
|
653
|
+
return [normalize(c.accountName), c];
|
|
654
|
+
}));
|
|
655
|
+
var _iterator = _createForOfIteratorHelper$5(enricherCollections),
|
|
656
|
+
_step;
|
|
657
|
+
try {
|
|
658
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
659
|
+
var enricher = _step.value;
|
|
660
|
+
var key = normalize(enricher.accountName);
|
|
661
|
+
var existing = byName.get(key);
|
|
662
|
+
if (existing) {
|
|
663
|
+
var _existing$enricherSer, _enricher$enricherSer;
|
|
664
|
+
existing.enricherSeries = [].concat(_toConsumableArray((_existing$enricherSer = existing.enricherSeries) !== null && _existing$enricherSer !== void 0 ? _existing$enricherSer : []), _toConsumableArray((_enricher$enricherSer = enricher.enricherSeries) !== null && _enricher$enricherSer !== void 0 ? _enricher$enricherSer : []));
|
|
665
|
+
} else {
|
|
666
|
+
merged.push(enricher);
|
|
667
|
+
byName.set(key, enricher);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
} catch (err) {
|
|
671
|
+
_iterator.e(err);
|
|
672
|
+
} finally {
|
|
673
|
+
_iterator.f();
|
|
674
|
+
}
|
|
675
|
+
return merged;
|
|
676
|
+
}
|
|
637
677
|
function apiLoadCollectionsEnricher(_x3, _x4, _x5, _x6) {
|
|
638
678
|
return _apiLoadCollectionsEnricher.apply(this, arguments);
|
|
639
679
|
}
|
|
@@ -686,7 +726,7 @@ function _apiLoadCollectionsEnricher() {
|
|
|
686
726
|
}
|
|
687
727
|
}
|
|
688
728
|
}
|
|
689
|
-
return _objectSpread$
|
|
729
|
+
return _objectSpread$G(_objectSpread$G({}, data), {}, {
|
|
690
730
|
id: data._id,
|
|
691
731
|
accountLogo: (_data$image = data.image) === null || _data$image === void 0 ? void 0 : _data$image.url,
|
|
692
732
|
type: 'ENRICHER_PACKAGE',
|
|
@@ -1560,8 +1600,8 @@ var _excluded$c = ["collectionId"],
|
|
|
1560
1600
|
function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1561
1601
|
function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
|
|
1562
1602
|
function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1563
|
-
function ownKeys$
|
|
1564
|
-
function _objectSpread$
|
|
1603
|
+
function ownKeys$F(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1604
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1565
1605
|
var LOG$a = getLogger('Seller', 'SellerStateData');
|
|
1566
1606
|
function useSellerStateData(_ref) {
|
|
1567
1607
|
var sessionGuid = _ref.sessionGuid,
|
|
@@ -1700,7 +1740,7 @@ function useSellerStateData(_ref) {
|
|
|
1700
1740
|
}]
|
|
1701
1741
|
});
|
|
1702
1742
|
case 7:
|
|
1703
|
-
return _context.abrupt("return", processData(_objectSpread$
|
|
1743
|
+
return _context.abrupt("return", processData(_objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
1704
1744
|
data: collections
|
|
1705
1745
|
})));
|
|
1706
1746
|
case 10:
|
|
@@ -1720,13 +1760,13 @@ function useSellerStateData(_ref) {
|
|
|
1720
1760
|
}();
|
|
1721
1761
|
var loadCatalogs = /*#__PURE__*/function () {
|
|
1722
1762
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
1723
|
-
var collectionId, props, _collections,
|
|
1763
|
+
var collectionId, props, _collections, _state$collections, catalogs, collections, showAllCollections, relevantCollections, enricherCatalogs, api2Catalogs, _yield$apiLoadCatalog, newCatalogCodex;
|
|
1724
1764
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1725
1765
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1726
1766
|
case 0:
|
|
1727
1767
|
collectionId = _ref3.collectionId, props = _objectWithoutProperties(_ref3, _excluded$c);
|
|
1728
1768
|
if (!state.firstLoginApiUrl) {
|
|
1729
|
-
_context2.next =
|
|
1769
|
+
_context2.next = 34;
|
|
1730
1770
|
break;
|
|
1731
1771
|
}
|
|
1732
1772
|
catalogs = state.catalogs;
|
|
@@ -1740,22 +1780,20 @@ function useSellerStateData(_ref) {
|
|
|
1740
1780
|
case 7:
|
|
1741
1781
|
collections = _context2.sent.data;
|
|
1742
1782
|
case 8:
|
|
1743
|
-
|
|
1744
|
-
|
|
1783
|
+
// "Show all" (no collection filter) and the SUPPLIER context (whose model overview opens
|
|
1784
|
+
// directly, without an API2 collection list) treat every collection as relevant.
|
|
1785
|
+
showAllCollections = !collectionId || organization.parentType === 'SUPPLIER';
|
|
1786
|
+
relevantCollections = showAllCollections ? collections : collections.filter(function (c) {
|
|
1787
|
+
return c.id == collectionId;
|
|
1745
1788
|
});
|
|
1746
|
-
if (!(
|
|
1747
|
-
_context2.next =
|
|
1748
|
-
break;
|
|
1749
|
-
}
|
|
1750
|
-
if ((_relevantCollections$2 = relevantCollections[0].enricherSeries) !== null && _relevantCollections$2 !== void 0 && _relevantCollections$2.length) {
|
|
1751
|
-
_context2.next = 12;
|
|
1789
|
+
if (!(!catalogs || collectionId != state.currentCollectionId)) {
|
|
1790
|
+
_context2.next = 30;
|
|
1752
1791
|
break;
|
|
1753
1792
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
series = relevantCollections.flatMap(function (c) {
|
|
1793
|
+
// Enricher series -> catalogs (already loaded in-memory with the collections)
|
|
1794
|
+
enricherCatalogs = relevantCollections.flatMap(function (c) {
|
|
1757
1795
|
var _c$enricherSeries;
|
|
1758
|
-
return (_c$enricherSeries = c.enricherSeries)
|
|
1796
|
+
return ((_c$enricherSeries = c.enricherSeries) !== null && _c$enricherSeries !== void 0 ? _c$enricherSeries : []).map(function (data) {
|
|
1759
1797
|
return {
|
|
1760
1798
|
id: data.catalogId,
|
|
1761
1799
|
codex: data.serieNo,
|
|
@@ -1763,52 +1801,60 @@ function useSellerStateData(_ref) {
|
|
|
1763
1801
|
name: data.name,
|
|
1764
1802
|
catalogLogo: data.url,
|
|
1765
1803
|
supplierGuid: data.catalogId,
|
|
1766
|
-
collectionName:
|
|
1804
|
+
collectionName: c.accountName,
|
|
1805
|
+
collectionLogo: c.accountLogo,
|
|
1806
|
+
// enricher-only collections group under BRAND, like in the collection overview
|
|
1807
|
+
collectionType: c.type === 'ENRICHER_PACKAGE' ? 'BRAND' : c.type,
|
|
1767
1808
|
collectionId: c.id
|
|
1768
|
-
//description: data.ShortDesc ? data.ShortDesc : undefined,
|
|
1769
|
-
//collectionLogo: ,
|
|
1770
|
-
//mainCategory: data.RetailMainCategory ? data.RetailMainCategory : data.MainCategory ? data.MainCategory : undefined,
|
|
1771
|
-
//subCategory: data.RetailSubCategory ? data.RetailSubCategory : data.SubCategory ? data.SubCategory : undefined,
|
|
1772
|
-
//retailArticleNr: data.RetailArticleNr ? data.RetailArticleNr : undefined,
|
|
1773
|
-
//nArticles: 0,
|
|
1774
|
-
// brandLogo: data.BrandLogo ? data.BrandLogo : undefined,
|
|
1775
|
-
//supplierGuid: data.SupplierGUID ? data.SupplierGUID : undefined,
|
|
1776
|
-
//supplierILN: data.SupplierILN ? data.SupplierILN : undefined,
|
|
1777
|
-
//supplierLogo: data.SupplierLogo ? data.SupplierLogo : undefined,
|
|
1778
|
-
//supplierName: data.SupplierName ? data.SupplierName : undefined,
|
|
1779
|
-
//lastUpdate: data. ? DivaUtils.getDate(data.LastUpdate) : undefined,
|
|
1780
|
-
//validFrom: data.ValidFrom ? DivaUtils.getDate(data.ValidFrom) : undefined,
|
|
1781
|
-
//validTo: data.ValidTo ? DivaUtils.getDate(data.ValidTo) : undefined,
|
|
1782
|
-
//has3D: data.Planer == 3 ? true : false,
|
|
1783
1809
|
};
|
|
1784
1810
|
});
|
|
1785
|
-
});
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
field: 'catalogs',
|
|
1793
|
-
value: series
|
|
1794
|
-
}]
|
|
1795
|
-
});
|
|
1796
|
-
return _context2.abrupt("return", processData(_objectSpread$E(_objectSpread$E({}, props), {}, {
|
|
1797
|
-
data: series || []
|
|
1798
|
-
})));
|
|
1799
|
-
case 17:
|
|
1800
|
-
if (!(sessionGuid && (!catalogs || collectionId != state.currentCollectionId))) {
|
|
1801
|
-
_context2.next = 24;
|
|
1811
|
+
}); // API2 catalogs -> fetched when a relevant collection actually has an API2 source, and always
|
|
1812
|
+
// when showing all collections (API2 then returns its full catalog list itself)
|
|
1813
|
+
api2Catalogs = [];
|
|
1814
|
+
if (!(sessionGuid && (showAllCollections || relevantCollections.some(function (c) {
|
|
1815
|
+
return c.type !== 'ENRICHER_PACKAGE';
|
|
1816
|
+
})))) {
|
|
1817
|
+
_context2.next = 26;
|
|
1802
1818
|
break;
|
|
1803
1819
|
}
|
|
1804
|
-
_context2.next =
|
|
1820
|
+
_context2.next = 16;
|
|
1805
1821
|
return apiLoadCatalogs({
|
|
1806
1822
|
serverUrl: state.firstLoginApiUrl,
|
|
1807
1823
|
sessionGuid: sessionGuid,
|
|
1808
1824
|
collectionGuid: collectionId
|
|
1809
1825
|
});
|
|
1826
|
+
case 16:
|
|
1827
|
+
_context2.t1 = _yield$apiLoadCatalog = _context2.sent;
|
|
1828
|
+
_context2.t0 = _context2.t1 !== null;
|
|
1829
|
+
if (!_context2.t0) {
|
|
1830
|
+
_context2.next = 20;
|
|
1831
|
+
break;
|
|
1832
|
+
}
|
|
1833
|
+
_context2.t0 = _yield$apiLoadCatalog !== void 0;
|
|
1810
1834
|
case 20:
|
|
1811
|
-
|
|
1835
|
+
if (!_context2.t0) {
|
|
1836
|
+
_context2.next = 24;
|
|
1837
|
+
break;
|
|
1838
|
+
}
|
|
1839
|
+
_context2.t2 = _yield$apiLoadCatalog;
|
|
1840
|
+
_context2.next = 25;
|
|
1841
|
+
break;
|
|
1842
|
+
case 24:
|
|
1843
|
+
_context2.t2 = [];
|
|
1844
|
+
case 25:
|
|
1845
|
+
api2Catalogs = _context2.t2;
|
|
1846
|
+
case 26:
|
|
1847
|
+
// combine legacy and new catalogs for the (possibly merged) collection; API2 catalogs take
|
|
1848
|
+
// their display type from the owning collection (matched via accountId == collection id)
|
|
1849
|
+
catalogs = [].concat(_toConsumableArray(api2Catalogs.map(function (cat) {
|
|
1850
|
+
var _collections$find$typ, _collections$find;
|
|
1851
|
+
return _objectSpread$F(_objectSpread$F({}, cat), {}, {
|
|
1852
|
+
collectionType: (_collections$find$typ = (_collections$find = collections.find(function (col) {
|
|
1853
|
+
return col.id == cat.accountId;
|
|
1854
|
+
})) === null || _collections$find === void 0 ? void 0 : _collections$find.type) !== null && _collections$find$typ !== void 0 ? _collections$find$typ : 'BRAND'
|
|
1855
|
+
});
|
|
1856
|
+
})), _toConsumableArray(enricherCatalogs));
|
|
1857
|
+
|
|
1812
1858
|
// reset catalogCodex only if a different collection is loaded, not if "all" catalogs are shown
|
|
1813
1859
|
newCatalogCodex = state.currentCatalogCodex;
|
|
1814
1860
|
if (collectionId) {
|
|
@@ -1827,19 +1873,19 @@ function useSellerStateData(_ref) {
|
|
|
1827
1873
|
value: catalogs
|
|
1828
1874
|
}]
|
|
1829
1875
|
});
|
|
1830
|
-
case
|
|
1876
|
+
case 30:
|
|
1831
1877
|
updateAcountLogo((_state$collections = state.collections) === null || _state$collections === void 0 || (_state$collections = _state$collections.find(function (c) {
|
|
1832
1878
|
return c.id == collectionId;
|
|
1833
1879
|
})) === null || _state$collections === void 0 ? void 0 : _state$collections.accountLogo);
|
|
1834
|
-
return _context2.abrupt("return", processData(_objectSpread$
|
|
1880
|
+
return _context2.abrupt("return", processData(_objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
1835
1881
|
data: catalogs || []
|
|
1836
1882
|
})));
|
|
1837
|
-
case
|
|
1883
|
+
case 34:
|
|
1838
1884
|
return _context2.abrupt("return", {
|
|
1839
1885
|
data: [],
|
|
1840
1886
|
total: 0
|
|
1841
1887
|
});
|
|
1842
|
-
case
|
|
1888
|
+
case 35:
|
|
1843
1889
|
case "end":
|
|
1844
1890
|
return _context2.stop();
|
|
1845
1891
|
}
|
|
@@ -1942,10 +1988,11 @@ function useSellerStateData(_ref) {
|
|
|
1942
1988
|
return s.serieNo === c.catalogCodex;
|
|
1943
1989
|
});
|
|
1944
1990
|
if (!isIDMData) {
|
|
1945
|
-
_context4.next =
|
|
1991
|
+
_context4.next = 19;
|
|
1946
1992
|
break;
|
|
1947
1993
|
}
|
|
1948
|
-
_context4.
|
|
1994
|
+
_context4.prev = 3;
|
|
1995
|
+
_context4.next = 6;
|
|
1949
1996
|
return apiLoadCatalogInfoEnricher({
|
|
1950
1997
|
enricherId: isIDMData.accountId,
|
|
1951
1998
|
organizationId: organization === null || organization === void 0 ? void 0 : organization._id,
|
|
@@ -1954,7 +2001,7 @@ function useSellerStateData(_ref) {
|
|
|
1954
2001
|
language: c.language,
|
|
1955
2002
|
serieNo: isIDMData.serieNo
|
|
1956
2003
|
});
|
|
1957
|
-
case
|
|
2004
|
+
case 6:
|
|
1958
2005
|
cData = _context4.sent;
|
|
1959
2006
|
catalogData.push(cData);
|
|
1960
2007
|
dispatch({
|
|
@@ -1983,37 +2030,56 @@ function useSellerStateData(_ref) {
|
|
|
1983
2030
|
}]
|
|
1984
2031
|
});
|
|
1985
2032
|
updateAcountLogo(catalogData[0].accountLogo);
|
|
1986
|
-
_context4.next =
|
|
2033
|
+
_context4.next = 17;
|
|
2034
|
+
break;
|
|
2035
|
+
case 12:
|
|
2036
|
+
_context4.prev = 12;
|
|
2037
|
+
_context4.t0 = _context4["catch"](3);
|
|
2038
|
+
// the enricher data is inconsistent -> inform the user and return undefined so the caller
|
|
2039
|
+
// clears the loading state and navigates back to the default (collections) view
|
|
2040
|
+
LOG$a.error(new DivaError$1('Error on loading enricher CatalogData', {
|
|
2041
|
+
code: 'SELLER_0001',
|
|
2042
|
+
cause: _context4.t0
|
|
2043
|
+
}));
|
|
2044
|
+
openModal({
|
|
2045
|
+
title: t('modals.error_accured') + ': ' + (_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message),
|
|
2046
|
+
accept: true
|
|
2047
|
+
});
|
|
2048
|
+
return _context4.abrupt("return", {
|
|
2049
|
+
v: void 0
|
|
2050
|
+
});
|
|
2051
|
+
case 17:
|
|
2052
|
+
_context4.next = 50;
|
|
1987
2053
|
break;
|
|
1988
|
-
case
|
|
2054
|
+
case 19:
|
|
1989
2055
|
if (!((_c$accountSessionId = c.accountSessionId) !== null && _c$accountSessionId !== void 0)) {
|
|
1990
|
-
_context4.next =
|
|
2056
|
+
_context4.next = 23;
|
|
1991
2057
|
break;
|
|
1992
2058
|
}
|
|
1993
|
-
_context4.
|
|
1994
|
-
_context4.next =
|
|
2059
|
+
_context4.t1 = _c$accountSessionId;
|
|
2060
|
+
_context4.next = 31;
|
|
1995
2061
|
break;
|
|
1996
|
-
case
|
|
2062
|
+
case 23:
|
|
1997
2063
|
if (!c.accountId) {
|
|
1998
|
-
_context4.next =
|
|
2064
|
+
_context4.next = 29;
|
|
1999
2065
|
break;
|
|
2000
2066
|
}
|
|
2001
|
-
_context4.next =
|
|
2067
|
+
_context4.next = 26;
|
|
2002
2068
|
return checkAccountLogin({
|
|
2003
2069
|
accountId: c.accountId
|
|
2004
2070
|
});
|
|
2005
|
-
case
|
|
2006
|
-
_context4.
|
|
2007
|
-
_context4.next =
|
|
2071
|
+
case 26:
|
|
2072
|
+
_context4.t2 = _context4.sent;
|
|
2073
|
+
_context4.next = 30;
|
|
2008
2074
|
break;
|
|
2009
|
-
case
|
|
2010
|
-
_context4.
|
|
2011
|
-
case
|
|
2012
|
-
_context4.
|
|
2013
|
-
case
|
|
2014
|
-
currentAccountSessionId = _context4.
|
|
2075
|
+
case 29:
|
|
2076
|
+
_context4.t2 = sessionGuid;
|
|
2077
|
+
case 30:
|
|
2078
|
+
_context4.t1 = _context4.t2;
|
|
2079
|
+
case 31:
|
|
2080
|
+
currentAccountSessionId = _context4.t1;
|
|
2015
2081
|
if (currentAccountSessionId) {
|
|
2016
|
-
_context4.next =
|
|
2082
|
+
_context4.next = 35;
|
|
2017
2083
|
break;
|
|
2018
2084
|
}
|
|
2019
2085
|
LOG$a.error(new DivaError$1('AccountSessionId is undefined', {
|
|
@@ -2022,16 +2088,16 @@ function useSellerStateData(_ref) {
|
|
|
2022
2088
|
return _context4.abrupt("return", {
|
|
2023
2089
|
v: void 0
|
|
2024
2090
|
});
|
|
2025
|
-
case
|
|
2026
|
-
_context4.prev =
|
|
2027
|
-
_context4.next =
|
|
2091
|
+
case 35:
|
|
2092
|
+
_context4.prev = 35;
|
|
2093
|
+
_context4.next = 38;
|
|
2028
2094
|
return apiLoadCatalogInfo({
|
|
2029
2095
|
serverUrlAPI: state.firstLoginApiUrl,
|
|
2030
2096
|
catalogCodex: c.catalogCodex,
|
|
2031
2097
|
accountSessionId: currentAccountSessionId,
|
|
2032
2098
|
language: c.language
|
|
2033
2099
|
});
|
|
2034
|
-
case
|
|
2100
|
+
case 38:
|
|
2035
2101
|
_cData = _context4.sent;
|
|
2036
2102
|
catalogData.push(_cData);
|
|
2037
2103
|
dispatch({
|
|
@@ -2057,32 +2123,32 @@ function useSellerStateData(_ref) {
|
|
|
2057
2123
|
}]
|
|
2058
2124
|
});
|
|
2059
2125
|
updateAcountLogo(catalogData[0].accountLogo);
|
|
2060
|
-
_context4.next =
|
|
2126
|
+
_context4.next = 50;
|
|
2061
2127
|
break;
|
|
2062
|
-
case
|
|
2063
|
-
_context4.prev =
|
|
2064
|
-
_context4.
|
|
2065
|
-
if (!((_context4.
|
|
2066
|
-
_context4.next =
|
|
2128
|
+
case 44:
|
|
2129
|
+
_context4.prev = 44;
|
|
2130
|
+
_context4.t3 = _context4["catch"](35);
|
|
2131
|
+
if (!((_context4.t3 === null || _context4.t3 === void 0 ? void 0 : _context4.t3.message) == 'Es trat ein technischer Fehler auf, probieren Sie es später erneut nochmal und melden Sie sich neu an.')) {
|
|
2132
|
+
_context4.next = 49;
|
|
2067
2133
|
break;
|
|
2068
2134
|
}
|
|
2069
2135
|
LOG$a.error(new DivaError$1('Error on Loading CatalogData', {
|
|
2070
2136
|
code: 'SELLER_0001',
|
|
2071
|
-
cause: _context4.
|
|
2137
|
+
cause: _context4.t3
|
|
2072
2138
|
}));
|
|
2073
2139
|
return _context4.abrupt("return", {
|
|
2074
2140
|
v: void 0
|
|
2075
2141
|
});
|
|
2076
|
-
case
|
|
2142
|
+
case 49:
|
|
2077
2143
|
openModal({
|
|
2078
|
-
title: t('modals.error_accured') + ': ' + (_context4.
|
|
2144
|
+
title: t('modals.error_accured') + ': ' + (_context4.t3 === null || _context4.t3 === void 0 ? void 0 : _context4.t3.message),
|
|
2079
2145
|
accept: true
|
|
2080
2146
|
});
|
|
2081
|
-
case
|
|
2147
|
+
case 50:
|
|
2082
2148
|
case "end":
|
|
2083
2149
|
return _context4.stop();
|
|
2084
2150
|
}
|
|
2085
|
-
}, _loop, null, [[
|
|
2151
|
+
}, _loop, null, [[3, 12], [35, 44]]);
|
|
2086
2152
|
});
|
|
2087
2153
|
_iterator.s();
|
|
2088
2154
|
case 15:
|
|
@@ -2305,8 +2371,8 @@ function useSellerStateData(_ref) {
|
|
|
2305
2371
|
_context8.next = 22;
|
|
2306
2372
|
return apiLoadBasket({
|
|
2307
2373
|
divaNr: divaNr,
|
|
2308
|
-
apiConfig: _objectSpread$
|
|
2309
|
-
api2: _objectSpread$
|
|
2374
|
+
apiConfig: _objectSpread$F(_objectSpread$F({}, apiConfig), {}, {
|
|
2375
|
+
api2: _objectSpread$F(_objectSpread$F({}, apiConfig.api2), {}, {
|
|
2310
2376
|
"default": state.firstLoginApiUrl
|
|
2311
2377
|
})
|
|
2312
2378
|
}),
|
|
@@ -2575,7 +2641,7 @@ function useSellerStateData(_ref) {
|
|
|
2575
2641
|
};
|
|
2576
2642
|
var loadArticles = /*#__PURE__*/function () {
|
|
2577
2643
|
var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref16) {
|
|
2578
|
-
var catalogCodex, accountId, collectionId, props,
|
|
2644
|
+
var catalogCodex, accountId, collectionId, props, _collection$enricherS2, _state$catalogData2, articles, catalogs, collections, collection, isIDMData, accountSessionId, _catalogs, _catalog, catalog, _yield$loadCatalogInf, _state$currentCollect4;
|
|
2579
2645
|
return _regeneratorRuntime.wrap(function _callee9$(_context10) {
|
|
2580
2646
|
while (1) switch (_context10.prev = _context10.next) {
|
|
2581
2647
|
case 0:
|
|
@@ -2600,49 +2666,49 @@ function useSellerStateData(_ref) {
|
|
|
2600
2666
|
var _ref18, _state$currentCollect3;
|
|
2601
2667
|
return c.id == ((_ref18 = (_state$currentCollect3 = state.currentCollectionId) !== null && _state$currentCollect3 !== void 0 ? _state$currentCollect3 : collectionId) !== null && _ref18 !== void 0 ? _ref18 : accountId);
|
|
2602
2668
|
});
|
|
2603
|
-
|
|
2604
|
-
|
|
2669
|
+
isIDMData = collection === null || collection === void 0 || (_collection$enricherS2 = collection.enricherSeries) === null || _collection$enricherS2 === void 0 ? void 0 : _collection$enricherS2.find(function (s) {
|
|
2670
|
+
return s.serieNo === catalogCodex;
|
|
2671
|
+
});
|
|
2672
|
+
if (!(!state.currentAccountLoginId && !isIDMData)) {
|
|
2673
|
+
_context10.next = 22;
|
|
2605
2674
|
break;
|
|
2606
2675
|
}
|
|
2607
2676
|
if (!accountId) {
|
|
2608
|
-
_context10.next =
|
|
2677
|
+
_context10.next = 18;
|
|
2609
2678
|
break;
|
|
2610
2679
|
}
|
|
2611
|
-
_context10.next =
|
|
2680
|
+
_context10.next = 15;
|
|
2612
2681
|
return checkAccountLogin({
|
|
2613
2682
|
accountId: accountId
|
|
2614
2683
|
});
|
|
2615
|
-
case
|
|
2684
|
+
case 15:
|
|
2616
2685
|
_context10.t1 = _context10.sent;
|
|
2617
|
-
_context10.next =
|
|
2686
|
+
_context10.next = 19;
|
|
2618
2687
|
break;
|
|
2619
|
-
case 17:
|
|
2620
|
-
_context10.t1 = sessionGuid;
|
|
2621
2688
|
case 18:
|
|
2689
|
+
_context10.t1 = sessionGuid;
|
|
2690
|
+
case 19:
|
|
2622
2691
|
_context10.t0 = _context10.t1;
|
|
2623
|
-
_context10.next =
|
|
2692
|
+
_context10.next = 23;
|
|
2624
2693
|
break;
|
|
2625
|
-
case 21:
|
|
2626
|
-
_context10.t0 = state.currentAccountLoginId;
|
|
2627
2694
|
case 22:
|
|
2695
|
+
_context10.t0 = state.currentAccountLoginId;
|
|
2696
|
+
case 23:
|
|
2628
2697
|
accountSessionId = _context10.t0;
|
|
2629
2698
|
if (!(!state.catalogs || !((_state$catalogData2 = state.catalogData) !== null && _state$catalogData2 !== void 0 && _state$catalogData2.length))) {
|
|
2630
|
-
_context10.next =
|
|
2699
|
+
_context10.next = 28;
|
|
2631
2700
|
break;
|
|
2632
2701
|
}
|
|
2633
|
-
_context10.next =
|
|
2702
|
+
_context10.next = 27;
|
|
2634
2703
|
return loadCatalogInfo({
|
|
2635
2704
|
catalogCodex: catalogCodex,
|
|
2636
2705
|
accountId: accountId,
|
|
2637
2706
|
accountSessionId: accountSessionId,
|
|
2638
2707
|
language: 'en'
|
|
2639
2708
|
});
|
|
2640
|
-
case 26:
|
|
2641
|
-
catalogs = _context10.sent;
|
|
2642
2709
|
case 27:
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
});
|
|
2710
|
+
catalogs = _context10.sent;
|
|
2711
|
+
case 28:
|
|
2646
2712
|
if (!isIDMData) {
|
|
2647
2713
|
_context10.next = 50;
|
|
2648
2714
|
break;
|
|
@@ -2707,13 +2773,13 @@ function useSellerStateData(_ref) {
|
|
|
2707
2773
|
value: accountSessionId
|
|
2708
2774
|
}, {
|
|
2709
2775
|
field: 'currentCollectionId',
|
|
2710
|
-
value: collectionId
|
|
2776
|
+
value: collectionId !== null && collectionId !== void 0 ? collectionId : state.currentCollectionId
|
|
2711
2777
|
}, {
|
|
2712
2778
|
field: 'currentAccountId',
|
|
2713
2779
|
value: accountId
|
|
2714
2780
|
}]
|
|
2715
2781
|
});
|
|
2716
|
-
return _context10.abrupt("return", processData(_objectSpread$
|
|
2782
|
+
return _context10.abrupt("return", processData(_objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
2717
2783
|
data: articles || []
|
|
2718
2784
|
})));
|
|
2719
2785
|
case 50:
|
|
@@ -2747,7 +2813,7 @@ function useSellerStateData(_ref) {
|
|
|
2747
2813
|
}]
|
|
2748
2814
|
});
|
|
2749
2815
|
case 55:
|
|
2750
|
-
return _context10.abrupt("return", processData(_objectSpread$
|
|
2816
|
+
return _context10.abrupt("return", processData(_objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
2751
2817
|
data: articles || []
|
|
2752
2818
|
})));
|
|
2753
2819
|
case 58:
|
|
@@ -2902,8 +2968,8 @@ function useSellerStateData(_ref) {
|
|
|
2902
2968
|
}
|
|
2903
2969
|
|
|
2904
2970
|
var _excluded$b = ["state", "setFirstLoginApiUrl", "updateBasketState", "setPlannerParams", "setReturnTo", "setOriginProductId", "setProductCategories", "setManualCustomDataFields", "setCloseOnSave", "resetState", "resetForCache"];
|
|
2905
|
-
function ownKeys$
|
|
2906
|
-
function _objectSpread$
|
|
2971
|
+
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2972
|
+
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2907
2973
|
var LOG$9 = getLogger('Seller', 'SellerStateProvider');
|
|
2908
2974
|
var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
2909
2975
|
var children = _ref.children,
|
|
@@ -3296,22 +3362,38 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3296
3362
|
}();
|
|
3297
3363
|
var openPlanner = /*#__PURE__*/function () {
|
|
3298
3364
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
3299
|
-
var _state$collections;
|
|
3300
|
-
var catalogCodex, articleCodexes, forceReload, accountSessionGuid, accountId, retailArticleNr, setId, divaNr, productId, basketData, returnTo, productName, coll, isIDMData, params, internal, _state$basketState4, _params2, _internal2, orderSet, _params3, _basketData$OrderSets, _basketData$OrderSets2;
|
|
3365
|
+
var _state$collections, _coll$enricherSeries;
|
|
3366
|
+
var catalogCodex, articleCodexes, forceReload, accountSessionGuid, accountId, collectionId, retailArticleNr, setId, divaNr, productId, basketData, returnTo, productName, configuratorSessionId, collections, coll, isIDMData, params, internal, _state$basketState4, _params2, _internal2, orderSet, _params3, _internal3, _basketData$OrderSets, _basketData$OrderSets2;
|
|
3301
3367
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
3302
3368
|
while (1) switch (_context5.prev = _context5.next) {
|
|
3303
3369
|
case 0:
|
|
3304
|
-
catalogCodex = _ref5.catalogCodex, articleCodexes = _ref5.articleCodexes, forceReload = _ref5.forceReload, accountSessionGuid = _ref5.accountSessionGuid, accountId = _ref5.accountId, retailArticleNr = _ref5.retailArticleNr, setId = _ref5.setId, divaNr = _ref5.divaNr, productId = _ref5.productId, basketData = _ref5.basketData, returnTo = _ref5.returnTo, productName = _ref5.productName;
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3370
|
+
catalogCodex = _ref5.catalogCodex, articleCodexes = _ref5.articleCodexes, forceReload = _ref5.forceReload, accountSessionGuid = _ref5.accountSessionGuid, accountId = _ref5.accountId, collectionId = _ref5.collectionId, retailArticleNr = _ref5.retailArticleNr, setId = _ref5.setId, divaNr = _ref5.divaNr, productId = _ref5.productId, basketData = _ref5.basketData, returnTo = _ref5.returnTo, productName = _ref5.productName, configuratorSessionId = _ref5.configuratorSessionId;
|
|
3371
|
+
if (!((_state$collections = state.collections) !== null && _state$collections !== void 0)) {
|
|
3372
|
+
_context5.next = 5;
|
|
3373
|
+
break;
|
|
3374
|
+
}
|
|
3375
|
+
_context5.t0 = _state$collections;
|
|
3376
|
+
_context5.next = 8;
|
|
3377
|
+
break;
|
|
3378
|
+
case 5:
|
|
3379
|
+
_context5.next = 7;
|
|
3380
|
+
return stateFunctions.loadCollections({});
|
|
3381
|
+
case 7:
|
|
3382
|
+
_context5.t0 = _context5.sent.data;
|
|
3383
|
+
case 8:
|
|
3384
|
+
collections = _context5.t0;
|
|
3385
|
+
coll = collections.find(function (c) {
|
|
3386
|
+
var _ref7;
|
|
3387
|
+
return c.id == ((_ref7 = collectionId !== null && collectionId !== void 0 ? collectionId : state.currentCollectionId) !== null && _ref7 !== void 0 ? _ref7 : accountId);
|
|
3308
3388
|
});
|
|
3309
|
-
isIDMData = (coll
|
|
3389
|
+
isIDMData = !!(coll !== null && coll !== void 0 && (_coll$enricherSeries = coll.enricherSeries) !== null && _coll$enricherSeries !== void 0 && _coll$enricherSeries.some(function (s) {
|
|
3390
|
+
return s.serieNo === catalogCodex;
|
|
3391
|
+
}));
|
|
3310
3392
|
if (!(catalogCodex !== undefined && (accountSessionGuid && accountId || isIDMData || organization.parentType === 'SUPPLIER') && returnTo === 'SETPLANNER_OPEN_SELLER_BASKET' && basketData)) {
|
|
3311
|
-
_context5.next =
|
|
3393
|
+
_context5.next = 18;
|
|
3312
3394
|
break;
|
|
3313
3395
|
}
|
|
3314
|
-
params = _objectSpread$
|
|
3396
|
+
params = _objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E({
|
|
3315
3397
|
catalogCodex: catalogCodex
|
|
3316
3398
|
}, accountId ? {
|
|
3317
3399
|
accountId: accountId
|
|
@@ -3328,13 +3410,13 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3328
3410
|
} : {}), retailArticleNr ? {
|
|
3329
3411
|
retailArticleNr: retailArticleNr
|
|
3330
3412
|
} : {});
|
|
3331
|
-
internal = _objectSpread$
|
|
3413
|
+
internal = _objectSpread$E(_objectSpread$E({}, forceReload ? {
|
|
3332
3414
|
forceReload: forceReload
|
|
3333
3415
|
} : {}), {}, {
|
|
3334
3416
|
accountSessionGuid: accountSessionGuid,
|
|
3335
3417
|
basketData: basketData
|
|
3336
3418
|
});
|
|
3337
|
-
setPlannerParams(_objectSpread$
|
|
3419
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, params), {}, {
|
|
3338
3420
|
internal: internal
|
|
3339
3421
|
}));
|
|
3340
3422
|
openComponent({
|
|
@@ -3342,11 +3424,11 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3342
3424
|
parameters: params,
|
|
3343
3425
|
internal: internal
|
|
3344
3426
|
});
|
|
3345
|
-
_context5.next =
|
|
3427
|
+
_context5.next = 34;
|
|
3346
3428
|
break;
|
|
3347
|
-
case
|
|
3429
|
+
case 18:
|
|
3348
3430
|
if (!(catalogCodex !== undefined && (accountSessionGuid && accountId || isIDMData || organization.parentType === 'SUPPLIER') && returnTo || productId)) {
|
|
3349
|
-
_context5.next =
|
|
3431
|
+
_context5.next = 22;
|
|
3350
3432
|
break;
|
|
3351
3433
|
}
|
|
3352
3434
|
if ((_state$basketState4 = state.basketState) !== null && _state$basketState4 !== void 0 && _state$basketState4.basket && state.currentDivaNr) {
|
|
@@ -3366,7 +3448,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3366
3448
|
updateBasketState({
|
|
3367
3449
|
concat: true
|
|
3368
3450
|
});
|
|
3369
|
-
var _params = _objectSpread$
|
|
3451
|
+
var _params = _objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E({}, catalogCodex !== undefined ? {
|
|
3370
3452
|
catalogCodex: catalogCodex
|
|
3371
3453
|
} : {}), accountId ? {
|
|
3372
3454
|
accountId: accountId
|
|
@@ -3385,12 +3467,12 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3385
3467
|
} : {}), productId ? {
|
|
3386
3468
|
productId: productId
|
|
3387
3469
|
} : {});
|
|
3388
|
-
var _internal = _objectSpread$
|
|
3470
|
+
var _internal = _objectSpread$E(_objectSpread$E({}, forceReload ? {
|
|
3389
3471
|
forceReload: forceReload
|
|
3390
3472
|
} : {}), {}, {
|
|
3391
3473
|
accountSessionGuid: accountSessionGuid
|
|
3392
3474
|
});
|
|
3393
|
-
setPlannerParams(_objectSpread$
|
|
3475
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, _params), {}, {
|
|
3394
3476
|
internal: _internal
|
|
3395
3477
|
}));
|
|
3396
3478
|
openComponent({
|
|
@@ -3424,7 +3506,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3424
3506
|
});
|
|
3425
3507
|
}
|
|
3426
3508
|
} else {
|
|
3427
|
-
_params2 = _objectSpread$
|
|
3509
|
+
_params2 = _objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E({}, catalogCodex !== undefined ? {
|
|
3428
3510
|
catalogCodex: catalogCodex
|
|
3429
3511
|
} : {}), accountId ? {
|
|
3430
3512
|
accountId: accountId
|
|
@@ -3441,12 +3523,12 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3441
3523
|
} : {}), retailArticleNr ? {
|
|
3442
3524
|
retailArticleNr: retailArticleNr
|
|
3443
3525
|
} : {});
|
|
3444
|
-
_internal2 = _objectSpread$
|
|
3526
|
+
_internal2 = _objectSpread$E(_objectSpread$E({}, forceReload ? {
|
|
3445
3527
|
forceReload: forceReload
|
|
3446
3528
|
} : {}), {}, {
|
|
3447
3529
|
accountSessionGuid: accountSessionGuid
|
|
3448
3530
|
});
|
|
3449
|
-
setPlannerParams(_objectSpread$
|
|
3531
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, _params2), {}, {
|
|
3450
3532
|
internal: _internal2
|
|
3451
3533
|
}));
|
|
3452
3534
|
openComponent({
|
|
@@ -3455,54 +3537,55 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3455
3537
|
internal: _internal2
|
|
3456
3538
|
});
|
|
3457
3539
|
}
|
|
3458
|
-
_context5.next =
|
|
3540
|
+
_context5.next = 34;
|
|
3459
3541
|
break;
|
|
3460
|
-
case
|
|
3542
|
+
case 22:
|
|
3461
3543
|
if (!(divaNr && basketData && returnTo)) {
|
|
3462
|
-
_context5.next =
|
|
3544
|
+
_context5.next = 33;
|
|
3463
3545
|
break;
|
|
3464
3546
|
}
|
|
3465
3547
|
orderSet = basketData.OrderSets.find(function (s) {
|
|
3466
3548
|
return s.SetID == setId;
|
|
3467
3549
|
});
|
|
3468
3550
|
if (!(orderSet && orderSet.CatalogCodex != state.currentCatalogCodex)) {
|
|
3469
|
-
_context5.next =
|
|
3551
|
+
_context5.next = 27;
|
|
3470
3552
|
break;
|
|
3471
3553
|
}
|
|
3472
|
-
_context5.next =
|
|
3554
|
+
_context5.next = 27;
|
|
3473
3555
|
return stateFunctions.loadCatalogInfo({
|
|
3474
3556
|
catalogCodex: orderSet.CatalogCodex,
|
|
3475
3557
|
accountId: orderSet.AccountGUID,
|
|
3476
3558
|
accountSessionId: accountSessionGuid,
|
|
3477
3559
|
language: 'de'
|
|
3478
3560
|
});
|
|
3479
|
-
case
|
|
3561
|
+
case 27:
|
|
3480
3562
|
_params3 = {
|
|
3481
3563
|
setId: setId,
|
|
3482
3564
|
divaNr: divaNr,
|
|
3483
3565
|
returnTo: returnTo
|
|
3484
3566
|
};
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3567
|
+
_internal3 = _objectSpread$E(_objectSpread$E({
|
|
3568
|
+
basketData: basketData
|
|
3569
|
+
}, forceReload ? {
|
|
3570
|
+
forceReload: forceReload
|
|
3571
|
+
} : {}), configuratorSessionId ? {
|
|
3572
|
+
configuratorSessionId: configuratorSessionId
|
|
3573
|
+
} : {});
|
|
3574
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, _params3), {}, {
|
|
3575
|
+
internal: _internal3
|
|
3490
3576
|
}));
|
|
3491
3577
|
openComponent({
|
|
3492
3578
|
type: 'DIVA_WEBPLANNER',
|
|
3493
3579
|
parameters: _params3,
|
|
3494
|
-
internal:
|
|
3495
|
-
basketData: basketData,
|
|
3496
|
-
forceReload: forceReload
|
|
3497
|
-
}
|
|
3580
|
+
internal: _internal3
|
|
3498
3581
|
});
|
|
3499
|
-
_context5.next =
|
|
3582
|
+
_context5.next = 34;
|
|
3500
3583
|
break;
|
|
3501
|
-
case
|
|
3584
|
+
case 33:
|
|
3502
3585
|
LOG$9.error(new DivaError$1('openPlanner got called with non all required params', {
|
|
3503
3586
|
code: 'SELLER_0001'
|
|
3504
3587
|
}));
|
|
3505
|
-
case
|
|
3588
|
+
case 34:
|
|
3506
3589
|
if (DivaUtils$1.bridge) {
|
|
3507
3590
|
DivaUtils$1.bridge.sendMessage({
|
|
3508
3591
|
type: 'ABN',
|
|
@@ -3512,7 +3595,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3512
3595
|
catalogName: (_basketData$OrderSets2 = basketData === null || basketData === void 0 ? void 0 : basketData.OrderSets[0].CatalogName) !== null && _basketData$OrderSets2 !== void 0 ? _basketData$OrderSets2 : undefined
|
|
3513
3596
|
});
|
|
3514
3597
|
}
|
|
3515
|
-
case
|
|
3598
|
+
case 35:
|
|
3516
3599
|
case "end":
|
|
3517
3600
|
return _context5.stop();
|
|
3518
3601
|
}
|
|
@@ -3530,7 +3613,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3530
3613
|
step: null,
|
|
3531
3614
|
assignNewDivaNr: false
|
|
3532
3615
|
});
|
|
3533
|
-
var params = _objectSpread$
|
|
3616
|
+
var params = _objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E({}, catalogCodex !== undefined ? {
|
|
3534
3617
|
catalogCodex: catalogCodex
|
|
3535
3618
|
} : {}), accountId ? {
|
|
3536
3619
|
accountId: accountId
|
|
@@ -3547,12 +3630,12 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3547
3630
|
} : {}), retailArticleNr ? {
|
|
3548
3631
|
retailArticleNr: retailArticleNr
|
|
3549
3632
|
} : {});
|
|
3550
|
-
var internal = _objectSpread$
|
|
3633
|
+
var internal = _objectSpread$E(_objectSpread$E({}, forceReload ? {
|
|
3551
3634
|
forceReload: forceReload
|
|
3552
3635
|
} : {}), {}, {
|
|
3553
3636
|
accountSessionGuid: accountSessionGuid
|
|
3554
3637
|
});
|
|
3555
|
-
setPlannerParams(_objectSpread$
|
|
3638
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, params), {}, {
|
|
3556
3639
|
internal: internal
|
|
3557
3640
|
}));
|
|
3558
3641
|
openComponent({
|
|
@@ -3601,7 +3684,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3601
3684
|
case 'toPlanner':
|
|
3602
3685
|
{
|
|
3603
3686
|
if (plannerParams) {
|
|
3604
|
-
var params = _objectSpread$
|
|
3687
|
+
var params = _objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E(_objectSpread$E({}, plannerParams.catalogCodex !== undefined ? {
|
|
3605
3688
|
catalogCodex: plannerParams.catalogCodex
|
|
3606
3689
|
} : {}), plannerParams.accountId ? {
|
|
3607
3690
|
accountId: plannerParams.accountId
|
|
@@ -3616,12 +3699,12 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3616
3699
|
} : {}), plannerParams.retailArticleNr ? {
|
|
3617
3700
|
retailArticleNr: plannerParams.retailArticleNr
|
|
3618
3701
|
} : {});
|
|
3619
|
-
var internal = _objectSpread$
|
|
3702
|
+
var internal = _objectSpread$E(_objectSpread$E({}, plannerParams.forceReload ? {
|
|
3620
3703
|
forceReload: plannerParams.forceReload
|
|
3621
3704
|
} : {}), {}, {
|
|
3622
3705
|
accountSessionGuid: plannerParams.accountSessionGuid
|
|
3623
3706
|
});
|
|
3624
|
-
setPlannerParams(_objectSpread$
|
|
3707
|
+
setPlannerParams(_objectSpread$E(_objectSpread$E({}, params), {}, {
|
|
3625
3708
|
internal: internal
|
|
3626
3709
|
}));
|
|
3627
3710
|
openComponent({
|
|
@@ -3640,7 +3723,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3640
3723
|
});
|
|
3641
3724
|
};
|
|
3642
3725
|
var fetchBasket = /*#__PURE__*/function () {
|
|
3643
|
-
var
|
|
3726
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(divaNr) {
|
|
3644
3727
|
var response;
|
|
3645
3728
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
3646
3729
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -3648,8 +3731,8 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3648
3731
|
_context6.next = 2;
|
|
3649
3732
|
return apiLoadBasket({
|
|
3650
3733
|
divaNr: divaNr,
|
|
3651
|
-
apiConfig: _objectSpread$
|
|
3652
|
-
api2: _objectSpread$
|
|
3734
|
+
apiConfig: _objectSpread$E(_objectSpread$E({}, apiConfig), {}, {
|
|
3735
|
+
api2: _objectSpread$E(_objectSpread$E({}, apiConfig.api2), {}, {
|
|
3653
3736
|
"default": state.firstLoginApiUrl
|
|
3654
3737
|
})
|
|
3655
3738
|
}),
|
|
@@ -3669,11 +3752,11 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3669
3752
|
}, _callee6);
|
|
3670
3753
|
}));
|
|
3671
3754
|
return function fetchBasket(_x13) {
|
|
3672
|
-
return
|
|
3755
|
+
return _ref8.apply(this, arguments);
|
|
3673
3756
|
};
|
|
3674
3757
|
}();
|
|
3675
3758
|
var loadUniqueDivaNr = /*#__PURE__*/function () {
|
|
3676
|
-
var
|
|
3759
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
3677
3760
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
3678
3761
|
while (1) switch (_context7.prev = _context7.next) {
|
|
3679
3762
|
case 0:
|
|
@@ -3688,11 +3771,11 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3688
3771
|
}, _callee7);
|
|
3689
3772
|
}));
|
|
3690
3773
|
return function loadUniqueDivaNr() {
|
|
3691
|
-
return
|
|
3774
|
+
return _ref9.apply(this, arguments);
|
|
3692
3775
|
};
|
|
3693
3776
|
}();
|
|
3694
3777
|
var loadManualCustomDataFields = /*#__PURE__*/function () {
|
|
3695
|
-
var
|
|
3778
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
3696
3779
|
var data;
|
|
3697
3780
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
3698
3781
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -3711,7 +3794,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3711
3794
|
}, _callee8);
|
|
3712
3795
|
}));
|
|
3713
3796
|
return function loadManualCustomDataFields() {
|
|
3714
|
-
return
|
|
3797
|
+
return _ref10.apply(this, arguments);
|
|
3715
3798
|
};
|
|
3716
3799
|
}();
|
|
3717
3800
|
var contextData = {
|
|
@@ -3743,7 +3826,7 @@ var SellerStateProvider = function SellerStateProvider(_ref) {
|
|
|
3743
3826
|
manualCustomDataFields: state.manualCustomDataFields,
|
|
3744
3827
|
closeOnSave: state.closeOnSave
|
|
3745
3828
|
},
|
|
3746
|
-
actions: _objectSpread$
|
|
3829
|
+
actions: _objectSpread$E(_objectSpread$E({}, stateFunctions), {}, {
|
|
3747
3830
|
openComponent: openComponent,
|
|
3748
3831
|
openModal: openModal,
|
|
3749
3832
|
openPlanner: openPlanner,
|
|
@@ -3786,8 +3869,8 @@ var Root = styled('span')({
|
|
|
3786
3869
|
border: '1px solid black'
|
|
3787
3870
|
});
|
|
3788
3871
|
|
|
3789
|
-
function ownKeys$
|
|
3790
|
-
function _objectSpread$
|
|
3872
|
+
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3873
|
+
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3791
3874
|
function Title(_ref) {
|
|
3792
3875
|
var text = _ref.text,
|
|
3793
3876
|
children = _ref.children,
|
|
@@ -3799,7 +3882,7 @@ function Title(_ref) {
|
|
|
3799
3882
|
style: {
|
|
3800
3883
|
flexGrow: 1
|
|
3801
3884
|
},
|
|
3802
|
-
children: [text, help && /*#__PURE__*/jsx(HelpButton, _objectSpread$
|
|
3885
|
+
children: [text, help && /*#__PURE__*/jsx(HelpButton, _objectSpread$D({}, help))]
|
|
3803
3886
|
}), children]
|
|
3804
3887
|
});
|
|
3805
3888
|
}
|
|
@@ -3816,8 +3899,8 @@ function getImageOrFallbackUrl(url) {
|
|
|
3816
3899
|
return url || 'https://cdn.diva-portal.com/static/images/image_placeholder-landscape-short.png';
|
|
3817
3900
|
}
|
|
3818
3901
|
|
|
3819
|
-
function ownKeys$
|
|
3820
|
-
function _objectSpread$
|
|
3902
|
+
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3903
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3821
3904
|
var LOG$8 = getLogger('SellerCatalogs', 'Catalogs');
|
|
3822
3905
|
function Catalogs(_ref) {
|
|
3823
3906
|
var _configurationData$an, _configurationData$ca5, _configurationData$an3, _configurationData$an4;
|
|
@@ -3947,7 +4030,7 @@ function Catalogs(_ref) {
|
|
|
3947
4030
|
if (configurationData !== null && configurationData !== void 0 && (_configurationData$ca = configurationData.catalogs) !== null && _configurationData$ca !== void 0 && _configurationData$ca.onOpen) {
|
|
3948
4031
|
action = configurationData === null || configurationData === void 0 || (_configurationData$ca2 = configurationData.catalogs) === null || _configurationData$ca2 === void 0 ? void 0 : _configurationData$ca2.onOpen;
|
|
3949
4032
|
if (!action.url) {
|
|
3950
|
-
action = _objectSpread$
|
|
4033
|
+
action = _objectSpread$C({}, action);
|
|
3951
4034
|
parameters = {};
|
|
3952
4035
|
Object.entries(action.parameters || {}).forEach(function (_ref4) {
|
|
3953
4036
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
@@ -3963,7 +4046,7 @@ function Catalogs(_ref) {
|
|
|
3963
4046
|
} else {
|
|
3964
4047
|
openComponent({
|
|
3965
4048
|
type: 'SELLER',
|
|
3966
|
-
parameters: _objectSpread$
|
|
4049
|
+
parameters: _objectSpread$C(_objectSpread$C({
|
|
3967
4050
|
module: 'Info',
|
|
3968
4051
|
catalogCodex: item.codex
|
|
3969
4052
|
}, item.accountId ? {
|
|
@@ -4070,6 +4153,29 @@ function Catalogs(_ref) {
|
|
|
4070
4153
|
});
|
|
4071
4154
|
};
|
|
4072
4155
|
var renderGroup = function renderGroup(row) {
|
|
4156
|
+
// top grouping level: collection type header, like in the collection overview
|
|
4157
|
+
if ((row === null || row === void 0 ? void 0 : row.groupByID) === 'collectionType') {
|
|
4158
|
+
return /*#__PURE__*/jsx(Card, {
|
|
4159
|
+
elevation: 0,
|
|
4160
|
+
style: {
|
|
4161
|
+
margin: 10,
|
|
4162
|
+
display: 'flex',
|
|
4163
|
+
alignItems: 'stretch'
|
|
4164
|
+
},
|
|
4165
|
+
children: /*#__PURE__*/jsx(CardActionArea, {
|
|
4166
|
+
children: /*#__PURE__*/jsxs(Typography$1, {
|
|
4167
|
+
style: {
|
|
4168
|
+
textAlign: 'center'
|
|
4169
|
+
},
|
|
4170
|
+
variant: "subtitle1",
|
|
4171
|
+
color: "textSecondary",
|
|
4172
|
+
children: [t("data.".concat(row.values['collectionType']), {
|
|
4173
|
+
defaultValue: row.values['collectionType']
|
|
4174
|
+
}), " (", row.subRows.length, ")"]
|
|
4175
|
+
})
|
|
4176
|
+
})
|
|
4177
|
+
});
|
|
4178
|
+
}
|
|
4073
4179
|
return /*#__PURE__*/jsx(Card, {
|
|
4074
4180
|
style: {
|
|
4075
4181
|
height: 160,
|
|
@@ -4173,7 +4279,20 @@ function Catalogs(_ref) {
|
|
|
4173
4279
|
id: 'name'
|
|
4174
4280
|
}];
|
|
4175
4281
|
if (organization.parentType !== 'SUPPLIER') {
|
|
4176
|
-
|
|
4282
|
+
// mirror the collection overview: group by collection type first, then by collection
|
|
4283
|
+
newOptions.columns.unshift({
|
|
4284
|
+
label: t('collections.header.type'),
|
|
4285
|
+
accessor: 'collectionType',
|
|
4286
|
+
format: 'data.'
|
|
4287
|
+
});
|
|
4288
|
+
newOptions.groupBy = ['collectionType', 'collectionName'];
|
|
4289
|
+
newOptions.sortBy = [{
|
|
4290
|
+
id: 'collectionType'
|
|
4291
|
+
}, {
|
|
4292
|
+
id: 'collectionName'
|
|
4293
|
+
}, {
|
|
4294
|
+
id: 'name'
|
|
4295
|
+
}];
|
|
4177
4296
|
newOptions.expanded = true;
|
|
4178
4297
|
}
|
|
4179
4298
|
}
|
|
@@ -4225,6 +4344,8 @@ function Catalogs(_ref) {
|
|
|
4225
4344
|
});
|
|
4226
4345
|
}
|
|
4227
4346
|
|
|
4347
|
+
function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4348
|
+
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4228
4349
|
var LOG$7 = getLogger('SellerCollections', 'Collections');
|
|
4229
4350
|
function Collections() {
|
|
4230
4351
|
var _configurationData$an, _configurationData$an2, _configurationData$an3;
|
|
@@ -4403,6 +4524,16 @@ function Collections() {
|
|
|
4403
4524
|
})
|
|
4404
4525
|
});
|
|
4405
4526
|
};
|
|
4527
|
+
|
|
4528
|
+
// Show enricher-only collections within the legacy "Kollektionen" (BRAND) group; the stored type
|
|
4529
|
+
// stays ENRICHER_PACKAGE so catalog loading still discriminates the source correctly.
|
|
4530
|
+
var groupedData = useMemo(function () {
|
|
4531
|
+
return data.map(function (c) {
|
|
4532
|
+
return c.type === 'ENRICHER_PACKAGE' ? _objectSpread$B(_objectSpread$B({}, c), {}, {
|
|
4533
|
+
type: 'BRAND'
|
|
4534
|
+
}) : c;
|
|
4535
|
+
});
|
|
4536
|
+
}, [data]);
|
|
4406
4537
|
var options = useMemo(function () {
|
|
4407
4538
|
return {
|
|
4408
4539
|
columns: [{
|
|
@@ -4431,10 +4562,10 @@ function Collections() {
|
|
|
4431
4562
|
defaultView: 'Gallery',
|
|
4432
4563
|
apiInterface: {
|
|
4433
4564
|
loading: isLoading,
|
|
4434
|
-
data:
|
|
4565
|
+
data: groupedData
|
|
4435
4566
|
}
|
|
4436
4567
|
};
|
|
4437
|
-
}, [t,
|
|
4568
|
+
}, [t, groupedData, isLoading]);
|
|
4438
4569
|
return /*#__PURE__*/jsx(Grid, {
|
|
4439
4570
|
customElement: /*#__PURE__*/jsx(Title, {
|
|
4440
4571
|
text: t('collections.title')
|
|
@@ -4561,6 +4692,7 @@ function Articles(_ref) {
|
|
|
4561
4692
|
forceReload: '1',
|
|
4562
4693
|
accountSessionGuid: currentAccountLoginId,
|
|
4563
4694
|
accountId: accountId,
|
|
4695
|
+
collectionId: collectionId,
|
|
4564
4696
|
retailArticleNr: item.retailArticleNr,
|
|
4565
4697
|
returnTo: ['toProductsGallery', 'toAssortmentManager'].includes(returnTo !== null && returnTo !== void 0 ? returnTo : '') ? 'OPEN_SELLER_PRODUCTCREATOR' : returnTo || (configurationData === null || configurationData === void 0 ? void 0 : configurationData.defaultWebPlannerReturnTo) || 'OPEN_SELLER_BASKET'
|
|
4566
4698
|
});
|
|
@@ -5145,7 +5277,10 @@ function SetTable(_ref) {
|
|
|
5145
5277
|
// 3. Have a valid VKPrice.Price
|
|
5146
5278
|
// These order lines are filtered so that only meaningful positions are displayed in the order overview.
|
|
5147
5279
|
// It is not necessary to display an articles with his partlistarticles
|
|
5280
|
+
// Order lines with PosInvisibility (1 = gar nicht sichtbar; 2 = nur in EDI-Bestellung sichtbar) are hidden here as well.
|
|
5148
5281
|
orderLines.filter(function (ol) {
|
|
5282
|
+
return !ol.PosInvisibility;
|
|
5283
|
+
}).filter(function (ol) {
|
|
5149
5284
|
var _ol$VKPrice;
|
|
5150
5285
|
return !ol.HasPartlistArticle || !ol.IsPartlistArticle && !ol.RelatedToBasketID || !!((_ol$VKPrice = ol.VKPrice) !== null && _ol$VKPrice !== void 0 && _ol$VKPrice.Price);
|
|
5151
5286
|
}).map(function (orderline) {
|
|
@@ -7931,6 +8066,7 @@ function Basket(_ref) {
|
|
|
7931
8066
|
useEffect(function () {
|
|
7932
8067
|
// Wait for the seller session to be established before loading the basket.
|
|
7933
8068
|
if (!sessionGuid) return;
|
|
8069
|
+
if (checkBasket === '1') DivaUtils$1.businessMetrics.setConfiguratorSessionId();
|
|
7934
8070
|
openBasket(statusRef, divaNr, checkBasket, basket, assignNewDivaNr).then(function () {
|
|
7935
8071
|
var _getBasketStatusArr;
|
|
7936
8072
|
LOG$5.successTransaction('ON_OPEN_MODULE_BASKET', {
|
|
@@ -8034,7 +8170,8 @@ function Basket(_ref) {
|
|
|
8034
8170
|
//if its a basket with a setplanner then dont load specific set but open all of them
|
|
8035
8171
|
divaNr: currentBasket.DivaNr,
|
|
8036
8172
|
returnTo: returnToParam,
|
|
8037
|
-
basketData: currentBasket
|
|
8173
|
+
basketData: currentBasket,
|
|
8174
|
+
configuratorSessionId: DivaUtils$1.businessMetrics.getConfiguratorSessionId()
|
|
8038
8175
|
});
|
|
8039
8176
|
};
|
|
8040
8177
|
var deletePlanning = function deletePlanning(setId) {
|
|
@@ -8119,7 +8256,7 @@ function Basket(_ref) {
|
|
|
8119
8256
|
return _context.abrupt("continue", 27);
|
|
8120
8257
|
case 22:
|
|
8121
8258
|
// hqr exists === 3d catalog
|
|
8122
|
-
d3dp = JSON.parse(
|
|
8259
|
+
d3dp = JSON.parse(DivaUtils$1.decodeBase64(currentBasket.Diva3DProject));
|
|
8123
8260
|
d3dp = _objectSpread$s(_objectSpread$s({}, d3dp), {}, {
|
|
8124
8261
|
SCE: _objectSpread$s(_objectSpread$s({}, d3dp.SCE), {}, {
|
|
8125
8262
|
ROO: [_objectSpread$s(_objectSpread$s({}, d3dp.SCE.ROO), {}, {
|