@crystaldesign/diva-seller 24.12.0-beta.24 → 24.12.0-beta.26
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 +269 -603
- package/build/types/seller/src/components/HQMedia/RenderJobDetail/useRenderjobDetail.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/components/BasedataForms/CustomBaseForm.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/components/Buttons.d.ts +1 -3
- package/build/types/seller/src/components/ProductCreator/components/Buttons.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/hooks/useProductState.d.ts +1 -2
- package/build/types/seller/src/components/ProductCreator/hooks/useProductState.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/index.d.ts +1 -3
- package/build/types/seller/src/components/ProductCreator/index.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/tabs/RenderJobTableLegacy/RenderJobForm.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/tabs/RenderJobTableLegacy/useRenderjobs.d.ts.map +1 -1
- package/build/types/seller/src/components/ProductCreator/types.d.ts +1 -1
- package/build/types/seller/src/components/ProductCreator/types.d.ts.map +1 -1
- package/build/types/seller/src/components/Seller/index.d.ts +0 -1
- package/build/types/seller/src/components/Seller/index.d.ts.map +1 -1
- package/build/types/seller/src/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 +29 -3
- package/build/types/seller/src/types.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/CheckOut/useProduct.d.ts +1 -0
- package/build/types/seller/src/ui/Basket/CheckOut/useProduct.d.ts.map +1 -1
- package/package.json +5 -5
package/build/esm/index.js
CHANGED
|
@@ -984,24 +984,18 @@ function apiLoadBasket(_x8) {
|
|
|
984
984
|
}
|
|
985
985
|
function _apiLoadBasket() {
|
|
986
986
|
_apiLoadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref8) {
|
|
987
|
-
var divaNr, apiConfig, customProductId, jwt, fullUrl, _divaNr$split, _divaNr$split2,
|
|
987
|
+
var divaNr, apiConfig, customProductId, jwt, fullUrl, _divaNr$split, _divaNr$split2, onlyDivaNr, version, response, basket, key, value, _response, result, _basket;
|
|
988
988
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
989
989
|
while (1) switch (_context8.prev = _context8.next) {
|
|
990
990
|
case 0:
|
|
991
991
|
divaNr = _ref8.divaNr, apiConfig = _ref8.apiConfig, customProductId = _ref8.customProductId, jwt = _ref8.jwt;
|
|
992
992
|
if (!divaNr) {
|
|
993
|
-
_context8.next =
|
|
993
|
+
_context8.next = 11;
|
|
994
994
|
break;
|
|
995
995
|
}
|
|
996
|
-
|
|
997
|
-
if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
|
|
998
|
-
_divaNr$split = divaNr.split('_'), _divaNr$split2 = _slicedToArray(_divaNr$split, 2), DivaNrAndDoc = _divaNr$split2[0], variantId = _divaNr$split2[1];
|
|
999
|
-
_DivaNrAndDoc$split = DivaNrAndDoc.split('-'), _DivaNrAndDoc$split2 = _slicedToArray(_DivaNrAndDoc$split, 3), _onlyDivaNr = _DivaNrAndDoc$split2[1], _version = _DivaNrAndDoc$split2[2];
|
|
1000
|
-
fullUrl = apiConfig.basketService + '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + ('&variantId=' + Number(variantId));
|
|
1001
|
-
}
|
|
1002
|
-
_divaNr$split3 = divaNr.split('-'), _divaNr$split4 = _slicedToArray(_divaNr$split3, 3), onlyDivaNr = _divaNr$split4[1], version = _divaNr$split4[2];
|
|
996
|
+
_divaNr$split = divaNr.split('-'), _divaNr$split2 = _slicedToArray(_divaNr$split, 3), onlyDivaNr = _divaNr$split2[1], version = _divaNr$split2[2];
|
|
1003
997
|
fullUrl = apiConfig.basketService + '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '');
|
|
1004
|
-
_context8.next =
|
|
998
|
+
_context8.next = 6;
|
|
1005
999
|
return fetch(fullUrl, {
|
|
1006
1000
|
headers: {
|
|
1007
1001
|
Authorization: 'Bearer ' + jwt
|
|
@@ -1009,7 +1003,7 @@ function _apiLoadBasket() {
|
|
|
1009
1003
|
}).then(function (res) {
|
|
1010
1004
|
return res.json();
|
|
1011
1005
|
});
|
|
1012
|
-
case
|
|
1006
|
+
case 6:
|
|
1013
1007
|
response = _context8.sent;
|
|
1014
1008
|
basket = new BasketData(response.basket);
|
|
1015
1009
|
return _context8.abrupt("return", {
|
|
@@ -1017,15 +1011,15 @@ function _apiLoadBasket() {
|
|
|
1017
1011
|
newestDocumentVersion: Number(response.newestDocumentVersion),
|
|
1018
1012
|
sourceOrganization: response.sourceOrganization
|
|
1019
1013
|
});
|
|
1020
|
-
case
|
|
1014
|
+
case 11:
|
|
1021
1015
|
if (!customProductId) {
|
|
1022
|
-
_context8.next =
|
|
1016
|
+
_context8.next = 25;
|
|
1023
1017
|
break;
|
|
1024
1018
|
}
|
|
1025
1019
|
key = 'customData.SAP_MARA_MATNR.value';
|
|
1026
1020
|
value = customProductId;
|
|
1027
1021
|
fullUrl = apiConfig.catalogService + "/v1/products/basket?key=".concat(key, "&value=").concat(value, "&repair=true");
|
|
1028
|
-
_context8.next =
|
|
1022
|
+
_context8.next = 17;
|
|
1029
1023
|
return fetch(fullUrl, {
|
|
1030
1024
|
method: 'POST',
|
|
1031
1025
|
headers: {
|
|
@@ -1034,11 +1028,11 @@ function _apiLoadBasket() {
|
|
|
1034
1028
|
},
|
|
1035
1029
|
body: JSON.stringify({})
|
|
1036
1030
|
});
|
|
1037
|
-
case
|
|
1031
|
+
case 17:
|
|
1038
1032
|
_response = _context8.sent;
|
|
1039
|
-
_context8.next =
|
|
1033
|
+
_context8.next = 20;
|
|
1040
1034
|
return _response.json();
|
|
1041
|
-
case
|
|
1035
|
+
case 20:
|
|
1042
1036
|
result = _context8.sent;
|
|
1043
1037
|
_basket = new BasketData(result.basket);
|
|
1044
1038
|
return _context8.abrupt("return", {
|
|
@@ -1046,9 +1040,9 @@ function _apiLoadBasket() {
|
|
|
1046
1040
|
newestDocumentVersion: Number(result.newestDocumentVersion),
|
|
1047
1041
|
sourceOrganization: result.sourceOrganization
|
|
1048
1042
|
});
|
|
1049
|
-
case
|
|
1043
|
+
case 25:
|
|
1050
1044
|
throw new Error('apiLoadBasket was called without any information to load basket');
|
|
1051
|
-
case
|
|
1045
|
+
case 26:
|
|
1052
1046
|
case "end":
|
|
1053
1047
|
return _context8.stop();
|
|
1054
1048
|
}
|
|
@@ -6399,6 +6393,8 @@ var hqIcon = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%2
|
|
|
6399
6393
|
|
|
6400
6394
|
var arIcon = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7%209.43L12.1%2013.02M7%209.43L12.1%206L17.2%209.43M7%209.43V14.58L12.1%2018.17M12.1%2013.02L17.2%209.43M12.1%2013.02V18.17M17.2%209.43V14.58L12.1%2018.17%22%20stroke%3D%22%234F4F4F%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
6401
6395
|
|
|
6396
|
+
var masterIcon = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7%209.43L12.1%2013.02M7%209.43L12.1%206L17.2%209.43M7%209.43V14.58L12.1%2018.17M12.1%2013.02L17.2%209.43M12.1%2013.02V18.17M17.2%209.43V14.58L12.1%2018.17%22%20stroke%3D%22%234F4F4F%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
6397
|
+
|
|
6402
6398
|
var ambienteIcon = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3%2017.04L11.57%2013.98L20.14%2017.04M11.57%2013.99V6%22%20stroke%3D%22%237B7B7B%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M17.4702%2011.8608L11.5702%2013.6708M17.4702%2011.8608V15.9708M17.4702%2011.8608L11.5702%209.80078L5.67017%2011.8608M11.5602%2013.6708L5.66016%2011.8608V15.9708M11.5702%2013.6808V17.8108%22%20stroke%3D%22%234F4F4F%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
6403
6399
|
|
|
6404
6400
|
function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(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; } } }; }
|
|
@@ -6428,6 +6424,14 @@ function useRenderjobDetail (_ref) {
|
|
|
6428
6424
|
job: 'HQ',
|
|
6429
6425
|
viewPoint: 'start'
|
|
6430
6426
|
}
|
|
6427
|
+
}, {
|
|
6428
|
+
id: 'master',
|
|
6429
|
+
name: 'renderjob.detail.package.master.name',
|
|
6430
|
+
icon: masterIcon,
|
|
6431
|
+
description: 'renderjob.detail.package.master.description',
|
|
6432
|
+
settings: {
|
|
6433
|
+
job: 'MASTER'
|
|
6434
|
+
}
|
|
6431
6435
|
}, {
|
|
6432
6436
|
id: 'ar',
|
|
6433
6437
|
name: 'renderjob.detail.package.ar.name',
|
|
@@ -7946,9 +7950,9 @@ function useProduct(basket) {
|
|
|
7946
7950
|
currentProduct = _useState2[0],
|
|
7947
7951
|
setCurrentProduct = _useState2[1];
|
|
7948
7952
|
var _useState3 = useState(false),
|
|
7949
|
-
_useState4 = _slicedToArray(_useState3, 2)
|
|
7950
|
-
|
|
7951
|
-
setSaved = _useState4[1];
|
|
7953
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
7954
|
+
_useState4[0];
|
|
7955
|
+
var setSaved = _useState4[1];
|
|
7952
7956
|
var _useDivaCore = useDivaCore(),
|
|
7953
7957
|
productHandler = _useDivaCore.handler.productHandler;
|
|
7954
7958
|
var loadProduct = /*#__PURE__*/function () {
|
|
@@ -7985,9 +7989,8 @@ function useProduct(basket) {
|
|
|
7985
7989
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7986
7990
|
case 0:
|
|
7987
7991
|
_context2.next = 2;
|
|
7988
|
-
return productHandler.
|
|
7989
|
-
products: [currentProduct]
|
|
7990
|
-
basket: !saved ? new BasketData(basket) : undefined
|
|
7992
|
+
return productHandler.saveProducts({
|
|
7993
|
+
products: [currentProduct]
|
|
7991
7994
|
});
|
|
7992
7995
|
case 2:
|
|
7993
7996
|
myproduct = _context2.sent;
|
|
@@ -8245,7 +8248,7 @@ function CheckOut(_ref) {
|
|
|
8245
8248
|
baseData: currentProduct,
|
|
8246
8249
|
basketData: basket,
|
|
8247
8250
|
onSave: function onSave() {
|
|
8248
|
-
return productHandler.
|
|
8251
|
+
return productHandler.saveProducts({
|
|
8249
8252
|
products: [currentProduct]
|
|
8250
8253
|
});
|
|
8251
8254
|
},
|
|
@@ -11947,7 +11950,6 @@ function ClassificationDataForm (_ref) {
|
|
|
11947
11950
|
settings = _ref.settings;
|
|
11948
11951
|
var _useTranslation = useTranslation(),
|
|
11949
11952
|
t = _useTranslation.t;
|
|
11950
|
-
_useTranslation.i18n;
|
|
11951
11953
|
var getOptField = function getOptField(optMap, className, value) {
|
|
11952
11954
|
if (value) {
|
|
11953
11955
|
var optField = optFields.find(function (opt) {
|
|
@@ -12065,11 +12067,9 @@ function ClassField(_ref2) {
|
|
|
12065
12067
|
function Buttons (_ref) {
|
|
12066
12068
|
var editBasketDisabled = _ref.editBasketDisabled,
|
|
12067
12069
|
onOpenPlanner = _ref.onOpenPlanner,
|
|
12068
|
-
onAddBasket = _ref.onAddBasket,
|
|
12069
12070
|
onSave = _ref.onSave,
|
|
12070
12071
|
onCancel = _ref.onCancel,
|
|
12071
|
-
saveDisabled = _ref.saveDisabled
|
|
12072
|
-
allowAdd = _ref.allowAdd;
|
|
12072
|
+
saveDisabled = _ref.saveDisabled;
|
|
12073
12073
|
var _useTranslation = useTranslation(),
|
|
12074
12074
|
t = _useTranslation.t;
|
|
12075
12075
|
var _React$useState = React.useState(null),
|
|
@@ -12097,7 +12097,7 @@ function Buttons (_ref) {
|
|
|
12097
12097
|
color: "primary",
|
|
12098
12098
|
disabled: editBasketDisabled,
|
|
12099
12099
|
onClick: function onClick(e) {
|
|
12100
|
-
return
|
|
12100
|
+
return onOpenPlanner();
|
|
12101
12101
|
},
|
|
12102
12102
|
children: t('productcreator.edit')
|
|
12103
12103
|
}), /*#__PURE__*/jsx(Button, {
|
|
@@ -12141,7 +12141,6 @@ function Buttons (_ref) {
|
|
|
12141
12141
|
}), /*#__PURE__*/jsx(MenuItem, {
|
|
12142
12142
|
disabled: editBasketDisabled,
|
|
12143
12143
|
onClick: function onClick() {
|
|
12144
|
-
onAddBasket();
|
|
12145
12144
|
handleClose();
|
|
12146
12145
|
},
|
|
12147
12146
|
children: t('productcreator.add')
|
|
@@ -13214,7 +13213,7 @@ function useClassification () {
|
|
|
13214
13213
|
}
|
|
13215
13214
|
|
|
13216
13215
|
var _excluded$2 = ["isNew"],
|
|
13217
|
-
_excluded2 = ["isNew", "baseChanged"],
|
|
13216
|
+
_excluded2 = ["isNew", "baseChanged", "catalogData"],
|
|
13218
13217
|
_excluded3 = ["shortDescription"];
|
|
13219
13218
|
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(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; } } }; }
|
|
13220
13219
|
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(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$1(r, a) : void 0; } }
|
|
@@ -13222,7 +13221,7 @@ function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.lengt
|
|
|
13222
13221
|
function ownKeys$5(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; }
|
|
13223
13222
|
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13224
13223
|
var LOG$3 = getLogger('Seller', 'ProductState');
|
|
13225
|
-
function useProductState (basket, divaNr
|
|
13224
|
+
function useProductState (basket, divaNr) {
|
|
13226
13225
|
var _useSellerState = useSellerState(),
|
|
13227
13226
|
_useSellerState$state = _useSellerState.state,
|
|
13228
13227
|
catalogData = _useSellerState$state.catalogData,
|
|
@@ -13233,12 +13232,10 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13233
13232
|
productCategories = _useSellerState$state.productCategories,
|
|
13234
13233
|
originProductId = _useSellerState$state.originProductId,
|
|
13235
13234
|
_useSellerState$actio = _useSellerState.actions,
|
|
13236
|
-
openBasket = _useSellerState$actio.openBasket
|
|
13237
|
-
|
|
13238
|
-
updateBasketState = _useSellerState$actio.updateBasketState,
|
|
13239
|
-
|
|
13240
|
-
_useSellerState$actio.saveBasket;
|
|
13241
|
-
var resetBasketState = _useSellerState$actio.resetBasketState,
|
|
13235
|
+
openBasket = _useSellerState$actio.openBasket;
|
|
13236
|
+
_useSellerState$actio.fetchBasket;
|
|
13237
|
+
var updateBasketState = _useSellerState$actio.updateBasketState,
|
|
13238
|
+
resetBasketState = _useSellerState$actio.resetBasketState,
|
|
13242
13239
|
clearOriginProductId = _useSellerState$actio.clearOriginProductId;
|
|
13243
13240
|
var _useDivaCore = useDivaCore(),
|
|
13244
13241
|
_useDivaCore$state = _useDivaCore.state,
|
|
@@ -13440,118 +13437,27 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13440
13437
|
subCategory: currentCategories.subCategory
|
|
13441
13438
|
}));
|
|
13442
13439
|
}, [updateCategoriesInternal, state]);
|
|
13443
|
-
var
|
|
13444
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
13445
|
-
var _state$
|
|
13440
|
+
var save = /*#__PURE__*/function () {
|
|
13441
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
13442
|
+
var _state$classification, data, params, _productHandler$close, _productHandler$close2, _productHandler$close3, savedProducts;
|
|
13446
13443
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
13447
13444
|
while (1) switch (_context2.prev = _context2.next) {
|
|
13448
13445
|
case 0:
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
baskets = [];
|
|
13452
|
-
_context2.next = 5;
|
|
13453
|
-
return fetchBasket(divaNr);
|
|
13454
|
-
case 5:
|
|
13455
|
-
newBasket = _context2.sent;
|
|
13456
|
-
if (state !== null && state !== void 0 && (_state$baseData$artic = state.baseData.articles) !== null && _state$baseData$artic !== void 0 && _state$baseData$artic.some(function (art) {
|
|
13457
|
-
return art.catalogCodex == newBasket.OrderSets[0].CatalogCodex;
|
|
13458
|
-
})) {
|
|
13459
|
-
_context2.next = 9;
|
|
13446
|
+
if (state) {
|
|
13447
|
+
_context2.next = 2;
|
|
13460
13448
|
break;
|
|
13461
13449
|
}
|
|
13462
|
-
openModal({
|
|
13463
|
-
title: 'Planung nicht gültig',
|
|
13464
|
-
text: "Die Planung mit der Nummer ".concat(divaNr, " kann nicht zu diesen Produkt hinzugef\xFCgt werden."),
|
|
13465
|
-
accept: true
|
|
13466
|
-
});
|
|
13467
13450
|
return _context2.abrupt("return");
|
|
13468
|
-
case
|
|
13469
|
-
|
|
13470
|
-
//if there are no variants the current basedata must become a varinat as well
|
|
13471
|
-
if (state !== null && state !== void 0 && (_state$variantData = state.variantData) !== null && _state$variantData !== void 0 && _state$variantData.length) {
|
|
13472
|
-
_context2.next = 20;
|
|
13473
|
-
break;
|
|
13474
|
-
}
|
|
13475
|
-
if (!((_currentBasketState$b = currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket) !== null && _currentBasketState$b !== void 0)) {
|
|
13476
|
-
_context2.next = 15;
|
|
13477
|
-
break;
|
|
13478
|
-
}
|
|
13479
|
-
_context2.t0 = _currentBasketState$b;
|
|
13480
|
-
_context2.next = 18;
|
|
13481
|
-
break;
|
|
13482
|
-
case 15:
|
|
13483
|
-
_context2.next = 17;
|
|
13484
|
-
return fetchBasket(state === null || state === void 0 ? void 0 : state.baseData.divaNr);
|
|
13485
|
-
case 17:
|
|
13486
|
-
_context2.t0 = _context2.sent;
|
|
13487
|
-
case 18:
|
|
13488
|
-
newBasket = _context2.t0;
|
|
13489
|
-
baskets.unshift(newBasket);
|
|
13490
|
-
case 20:
|
|
13491
|
-
dispatch({
|
|
13492
|
-
type: 'addBasket',
|
|
13493
|
-
data: baskets
|
|
13494
|
-
});
|
|
13495
|
-
openModal({
|
|
13496
|
-
title: 'Planung hinzugefügt',
|
|
13497
|
-
text: "Die Planung mit der Nummer ".concat(divaNr, " wurde als variante hinzugef\xFCgt."),
|
|
13498
|
-
accept: true
|
|
13499
|
-
});
|
|
13500
|
-
_context2.next = 28;
|
|
13501
|
-
break;
|
|
13502
|
-
case 24:
|
|
13503
|
-
_context2.prev = 24;
|
|
13504
|
-
_context2.t1 = _context2["catch"](1);
|
|
13505
|
-
LOG$3.error(new DivaError("Basket with divaNr ".concat(divaNr, " not found"), {
|
|
13506
|
-
code: 'SELLER_0002',
|
|
13507
|
-
cause: _context2.t1
|
|
13508
|
-
}));
|
|
13451
|
+
case 2:
|
|
13452
|
+
_context2.prev = 2;
|
|
13509
13453
|
openModal({
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13454
|
+
progress: 0.05,
|
|
13455
|
+
title: t('productcreator.savebasket'),
|
|
13456
|
+
dontRenderForm: true
|
|
13513
13457
|
});
|
|
13514
|
-
|
|
13515
|
-
case "end":
|
|
13516
|
-
return _context2.stop();
|
|
13517
|
-
}
|
|
13518
|
-
}, _callee2, null, [[1, 24]]);
|
|
13519
|
-
}));
|
|
13520
|
-
return function (_x) {
|
|
13521
|
-
return _ref.apply(this, arguments);
|
|
13522
|
-
};
|
|
13523
|
-
}(), [dispatch, state, openModal, fetchBasket]);
|
|
13524
|
-
var save = /*#__PURE__*/function () {
|
|
13525
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
13526
|
-
var _state$variantData2, _state$classification, isNewBasket, _currentBasketState$b2, data, params, _productHandler$close, _productHandler$close2, _productHandler$close3, savedProducts, _currentBasketState$b3;
|
|
13527
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
13528
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
13529
|
-
case 0:
|
|
13530
|
-
if (state) {
|
|
13531
|
-
_context3.next = 2;
|
|
13532
|
-
break;
|
|
13533
|
-
}
|
|
13534
|
-
return _context3.abrupt("return");
|
|
13535
|
-
case 2:
|
|
13536
|
-
_context3.prev = 2;
|
|
13537
|
-
isNewBasket = (currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket) && !(currentBasketState !== null && currentBasketState !== void 0 && currentBasketState.saved);
|
|
13538
|
-
if (isNewBasket) {
|
|
13539
|
-
currentBasketState === null || currentBasketState === void 0 || (_currentBasketState$b2 = currentBasketState.basket) === null || _currentBasketState$b2 === void 0 || _currentBasketState$b2.saveNow();
|
|
13540
|
-
openModal({
|
|
13541
|
-
progress: 0.05,
|
|
13542
|
-
title: t('productcreator.savebasket'),
|
|
13543
|
-
dontRenderForm: true
|
|
13544
|
-
});
|
|
13545
|
-
}
|
|
13546
|
-
if (currentBasketState !== null && currentBasketState !== void 0 && currentBasketState.basket) {
|
|
13547
|
-
_context3.next = 7;
|
|
13548
|
-
break;
|
|
13549
|
-
}
|
|
13550
|
-
throw Error('Basket is undefined');
|
|
13551
|
-
case 7:
|
|
13552
|
-
(_state$variantData2 = state.variantData) === null || _state$variantData2 === void 0 ? void 0 : _state$variantData2.length;
|
|
13553
|
-
_context3.next = 10;
|
|
13458
|
+
_context2.next = 6;
|
|
13554
13459
|
return productHandler.prepareData({
|
|
13460
|
+
basket: basket,
|
|
13555
13461
|
baseData: state.baseData,
|
|
13556
13462
|
classificationData: state.classificationData,
|
|
13557
13463
|
variantData: state.variantData,
|
|
@@ -13569,150 +13475,122 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13569
13475
|
optMap: state.optClassMap,
|
|
13570
13476
|
originProductId: originProductId
|
|
13571
13477
|
});
|
|
13572
|
-
case
|
|
13573
|
-
data =
|
|
13478
|
+
case 6:
|
|
13479
|
+
data = _context2.sent;
|
|
13574
13480
|
setIsNew(false);
|
|
13575
13481
|
if (!(originProductId || sendProductsToExternalService)) {
|
|
13576
|
-
|
|
13482
|
+
_context2.next = 34;
|
|
13577
13483
|
break;
|
|
13578
13484
|
}
|
|
13579
13485
|
params = {
|
|
13580
|
-
basket: currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket,
|
|
13581
13486
|
products: data.products,
|
|
13582
13487
|
removedProductIds: data.removedProducts,
|
|
13583
13488
|
parentProductId: originProductId ? originProductId : undefined
|
|
13584
13489
|
};
|
|
13585
13490
|
if (!(clientArticleHandler !== null && clientArticleHandler !== void 0 && clientArticleHandler.clientArticleService)) {
|
|
13586
|
-
|
|
13491
|
+
_context2.next = 29;
|
|
13587
13492
|
break;
|
|
13588
13493
|
}
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
return clientArticleHandler.
|
|
13592
|
-
case
|
|
13494
|
+
_context2.prev = 11;
|
|
13495
|
+
_context2.next = 14;
|
|
13496
|
+
return clientArticleHandler.saveProductsSMArticles(params, clientArticleHandler.clientArticleService, organization._id);
|
|
13497
|
+
case 14:
|
|
13593
13498
|
(_productHandler$close = productHandler.closeModal) === null || _productHandler$close === void 0 || _productHandler$close.call(productHandler);
|
|
13594
|
-
|
|
13499
|
+
_context2.next = 17;
|
|
13595
13500
|
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket, []);
|
|
13596
|
-
case
|
|
13501
|
+
case 17:
|
|
13597
13502
|
if (originProductId) clearOriginProductId();
|
|
13598
|
-
return
|
|
13599
|
-
case
|
|
13600
|
-
|
|
13601
|
-
|
|
13503
|
+
return _context2.abrupt("return", true);
|
|
13504
|
+
case 21:
|
|
13505
|
+
_context2.prev = 21;
|
|
13506
|
+
_context2.t0 = _context2["catch"](11);
|
|
13602
13507
|
(_productHandler$close2 = productHandler.closeModal) === null || _productHandler$close2 === void 0 || _productHandler$close2.call(productHandler);
|
|
13603
|
-
|
|
13508
|
+
_context2.next = 26;
|
|
13604
13509
|
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket);
|
|
13605
|
-
case
|
|
13606
|
-
throw new Error(
|
|
13607
|
-
case
|
|
13608
|
-
|
|
13510
|
+
case 26:
|
|
13511
|
+
throw new Error(_context2.t0.message);
|
|
13512
|
+
case 27:
|
|
13513
|
+
_context2.next = 34;
|
|
13609
13514
|
break;
|
|
13610
|
-
case
|
|
13515
|
+
case 29:
|
|
13611
13516
|
(_productHandler$close3 = productHandler.closeModal) === null || _productHandler$close3 === void 0 || _productHandler$close3.call(productHandler);
|
|
13612
13517
|
if (originProductId) clearOriginProductId();
|
|
13613
13518
|
LOG$3.error(new DivaError("Articles cannot be saved - ClientArticleService or JWT not set"));
|
|
13614
13519
|
setError(t('modal.general_error') + ' ' + t('modal.errorcode') + ':' + DivaUtils.getCurrentTraceId() + ' ' + DivaUtils.formatDate(new Date(), true, undefined, true));
|
|
13615
|
-
return
|
|
13616
|
-
case
|
|
13617
|
-
|
|
13618
|
-
return productHandler.
|
|
13619
|
-
basket: isNewBasket ? currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket : undefined,
|
|
13520
|
+
return _context2.abrupt("return", false);
|
|
13521
|
+
case 34:
|
|
13522
|
+
_context2.next = 36;
|
|
13523
|
+
return productHandler.saveProducts(_objectSpread$5(_objectSpread$5({}, data), {}, {
|
|
13620
13524
|
awaitPDF: undefined
|
|
13621
13525
|
}));
|
|
13622
|
-
case
|
|
13623
|
-
savedProducts =
|
|
13624
|
-
|
|
13625
|
-
updateBasketState({
|
|
13626
|
-
saved: true
|
|
13627
|
-
});
|
|
13628
|
-
currentBasketState === null || currentBasketState === void 0 || (_currentBasketState$b3 = currentBasketState.basket) === null || _currentBasketState$b3 === void 0 || _currentBasketState$b3.setDocumentVersion((currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket.getDocumentVersion()) + 1);
|
|
13629
|
-
}
|
|
13630
|
-
_context3.next = 44;
|
|
13526
|
+
case 36:
|
|
13527
|
+
savedProducts = _context2.sent;
|
|
13528
|
+
_context2.next = 39;
|
|
13631
13529
|
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket, savedProducts);
|
|
13632
|
-
case
|
|
13633
|
-
return
|
|
13634
|
-
case
|
|
13635
|
-
|
|
13636
|
-
|
|
13530
|
+
case 39:
|
|
13531
|
+
return _context2.abrupt("return", true);
|
|
13532
|
+
case 42:
|
|
13533
|
+
_context2.prev = 42;
|
|
13534
|
+
_context2.t1 = _context2["catch"](2);
|
|
13637
13535
|
LOG$3.error(new DivaError("Error saving product", {
|
|
13638
13536
|
code: 'PROD_0002',
|
|
13639
|
-
cause:
|
|
13537
|
+
cause: _context2.t1
|
|
13640
13538
|
}));
|
|
13641
|
-
if (Number(
|
|
13539
|
+
if (Number(_context2.t1.message) === 413) {
|
|
13642
13540
|
setError(t('modal.error_payload_to_big'));
|
|
13643
13541
|
} else {
|
|
13644
13542
|
setError(t('modal.general_error') + ' ' + t('modal.errorcode') + ':' + DivaUtils.getCurrentTraceId() + ' ' + DivaUtils.formatDate(new Date(), true, undefined, true));
|
|
13645
13543
|
}
|
|
13646
|
-
if (!
|
|
13647
|
-
|
|
13544
|
+
if (!_context2.t1.message.includes('PRODSM_0001')) {
|
|
13545
|
+
_context2.next = 51;
|
|
13648
13546
|
break;
|
|
13649
13547
|
}
|
|
13650
13548
|
openModal({
|
|
13651
13549
|
title: t('productcreator.errorsavingsmarticle', 'Error saving SM-Article'),
|
|
13652
|
-
text:
|
|
13550
|
+
text: _context2.t1.message,
|
|
13653
13551
|
accept: true
|
|
13654
13552
|
});
|
|
13655
|
-
return
|
|
13656
|
-
case
|
|
13553
|
+
return _context2.abrupt("return", false);
|
|
13554
|
+
case 51:
|
|
13657
13555
|
openModal({
|
|
13658
13556
|
title: t('errorcodes._source.labels.error.SELLER_0002'),
|
|
13659
13557
|
text: t('grid.error'),
|
|
13660
13558
|
accept: true
|
|
13661
13559
|
});
|
|
13662
|
-
return
|
|
13663
|
-
case
|
|
13560
|
+
return _context2.abrupt("return", false);
|
|
13561
|
+
case 53:
|
|
13664
13562
|
case "end":
|
|
13665
|
-
return
|
|
13563
|
+
return _context2.stop();
|
|
13666
13564
|
}
|
|
13667
|
-
},
|
|
13565
|
+
}, _callee2, null, [[2, 42], [11, 21]]);
|
|
13668
13566
|
}));
|
|
13669
13567
|
return function save() {
|
|
13670
|
-
return
|
|
13568
|
+
return _ref.apply(this, arguments);
|
|
13671
13569
|
};
|
|
13672
13570
|
}();
|
|
13673
13571
|
var reset = /*#__PURE__*/function () {
|
|
13674
|
-
var
|
|
13572
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(basket, productData) {
|
|
13675
13573
|
var _configurationData$Pr;
|
|
13676
|
-
var
|
|
13677
|
-
return _regeneratorRuntime.wrap(function
|
|
13678
|
-
while (1) switch (
|
|
13574
|
+
var _yield$productHandler, isNew, resetState;
|
|
13575
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
13576
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
13679
13577
|
case 0:
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
_context4.next = 5;
|
|
13683
|
-
break;
|
|
13684
|
-
}
|
|
13685
|
-
updateBasket = basket;
|
|
13686
|
-
_context4.next = 15;
|
|
13687
|
-
break;
|
|
13688
|
-
case 5:
|
|
13689
|
-
resetBasketState();
|
|
13690
|
-
_context4.next = 8;
|
|
13691
|
-
return openBasket(undefined, divaNr);
|
|
13692
|
-
case 8:
|
|
13693
|
-
_yield$openBasket = _context4.sent;
|
|
13694
|
-
openedBasket = _yield$openBasket.basket;
|
|
13695
|
-
openedCatalogData = _yield$openBasket.catalogData;
|
|
13696
|
-
_saved = _yield$openBasket.saved;
|
|
13697
|
-
updateBasket = openedBasket;
|
|
13698
|
-
usedCatalogData = openedCatalogData;
|
|
13699
|
-
basketSaved = _saved;
|
|
13700
|
-
case 15:
|
|
13701
|
-
_context4.next = 17;
|
|
13578
|
+
if (!basket) resetBasketState();
|
|
13579
|
+
_context3.next = 3;
|
|
13702
13580
|
return productHandler.loadProducts({
|
|
13703
|
-
basket:
|
|
13704
|
-
|
|
13581
|
+
basket: basket,
|
|
13582
|
+
divaNr: divaNr,
|
|
13583
|
+
catalogData: catalogData,
|
|
13705
13584
|
productData: productData,
|
|
13706
13585
|
classificationFields: state === null || state === void 0 ? void 0 : state.classificationFields,
|
|
13707
13586
|
fieldConfiguration: configurationData === null || configurationData === void 0 || (_configurationData$Pr = configurationData.ProductCreator) === null || _configurationData$Pr === void 0 ? void 0 : _configurationData$Pr.fields,
|
|
13708
13587
|
customBaseFields: additionalBaseFields,
|
|
13709
13588
|
classificationConfig: classificationConfig,
|
|
13710
13589
|
availableLanguages: availableLanguages,
|
|
13711
|
-
currentLang: language
|
|
13712
|
-
editedBasket: editedBasket
|
|
13590
|
+
currentLang: language
|
|
13713
13591
|
});
|
|
13714
|
-
case
|
|
13715
|
-
_yield$productHandler =
|
|
13592
|
+
case 3:
|
|
13593
|
+
_yield$productHandler = _context3.sent;
|
|
13716
13594
|
isNew = _yield$productHandler.isNew;
|
|
13717
13595
|
resetState = _objectWithoutProperties(_yield$productHandler, _excluded$2);
|
|
13718
13596
|
dispatch({
|
|
@@ -13723,91 +13601,75 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13723
13601
|
classificationFields: state === null || state === void 0 ? void 0 : state.classificationFields
|
|
13724
13602
|
})
|
|
13725
13603
|
});
|
|
13726
|
-
setSaved(!isNew
|
|
13604
|
+
setSaved(!isNew);
|
|
13727
13605
|
setError(undefined);
|
|
13728
13606
|
setWarning(undefined);
|
|
13729
|
-
case
|
|
13607
|
+
case 10:
|
|
13730
13608
|
case "end":
|
|
13731
|
-
return
|
|
13609
|
+
return _context3.stop();
|
|
13732
13610
|
}
|
|
13733
|
-
},
|
|
13611
|
+
}, _callee3);
|
|
13734
13612
|
}));
|
|
13735
|
-
return function reset(
|
|
13736
|
-
return
|
|
13613
|
+
return function reset(_x, _x2) {
|
|
13614
|
+
return _ref2.apply(this, arguments);
|
|
13737
13615
|
};
|
|
13738
13616
|
}();
|
|
13739
13617
|
useEffect(function () {
|
|
13740
13618
|
var init = /*#__PURE__*/function () {
|
|
13741
|
-
var
|
|
13742
|
-
var
|
|
13743
|
-
return _regeneratorRuntime.wrap(function
|
|
13744
|
-
while (1) switch (
|
|
13619
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
13620
|
+
var _ref4, updateBasket, catalogData, _affiliates, _Object$keys$map2, _configurationData$Pr2, _optClassMap, _initState, _yield$loadCategories, classificationFields, newCurrentData, additional, _additionalBaseFields, newLivingArea, _yield$productHandler2, _isNew, baseChanged, catalogs, initState, currentCategories, differingOptFields, optMapEntries, missingOptFields, accountlogourl, logofile, _initState$baseData$m, newlogofile, _initState$baseData$m2;
|
|
13621
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
13622
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
13745
13623
|
case 0:
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
case 2:
|
|
13749
|
-
_yield$openBasket2 = _context5.sent;
|
|
13750
|
-
updateBasket = _yield$openBasket2.basket;
|
|
13751
|
-
catalogData = _yield$openBasket2.catalogData;
|
|
13752
|
-
basketSaved = _yield$openBasket2.saved;
|
|
13753
|
-
toggleLoading('ProductDataInit');
|
|
13754
|
-
updateBasketState({
|
|
13755
|
-
overwriteStates: ['BASE_CONFIGURATION']
|
|
13756
|
-
});
|
|
13757
|
-
_context5.prev = 8;
|
|
13758
|
-
if (!(updateBasket.Status != 'BASE_CONFIGURATION')) {
|
|
13759
|
-
_context5.next = 16;
|
|
13624
|
+
if (!basket) {
|
|
13625
|
+
_context4.next = 6;
|
|
13760
13626
|
break;
|
|
13761
13627
|
}
|
|
13762
|
-
|
|
13763
|
-
return
|
|
13764
|
-
case
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13628
|
+
_context4.next = 3;
|
|
13629
|
+
return openBasket(undefined, divaNr, undefined, basket);
|
|
13630
|
+
case 3:
|
|
13631
|
+
_context4.t0 = _context4.sent;
|
|
13632
|
+
_context4.next = 7;
|
|
13633
|
+
break;
|
|
13634
|
+
case 6:
|
|
13635
|
+
_context4.t0 = {};
|
|
13636
|
+
case 7:
|
|
13637
|
+
_ref4 = _context4.t0;
|
|
13638
|
+
updateBasket = _ref4.basket;
|
|
13639
|
+
catalogData = _ref4.catalogData;
|
|
13640
|
+
toggleLoading('ProductDataInit');
|
|
13768
13641
|
updateBasketState({
|
|
13769
|
-
|
|
13642
|
+
overwriteStates: ['BASE_CONFIGURATION']
|
|
13770
13643
|
});
|
|
13771
|
-
case 16:
|
|
13772
|
-
_context5.next = 21;
|
|
13773
|
-
break;
|
|
13774
|
-
case 18:
|
|
13775
|
-
_context5.prev = 18;
|
|
13776
|
-
_context5.t0 = _context5["catch"](8);
|
|
13777
|
-
LOG$3.error(new DivaError("Error updating basket", {
|
|
13778
|
-
code: 'SELLER_0002',
|
|
13779
|
-
cause: _context5.t0
|
|
13780
|
-
}));
|
|
13781
|
-
case 21:
|
|
13782
13644
|
if (!userHasPermission('productcreator_affiliate')) {
|
|
13783
|
-
|
|
13645
|
+
_context4.next = 23;
|
|
13784
13646
|
break;
|
|
13785
13647
|
}
|
|
13786
|
-
|
|
13787
|
-
|
|
13648
|
+
_context4.prev = 13;
|
|
13649
|
+
_context4.next = 16;
|
|
13788
13650
|
return apiGetAffiliates({
|
|
13789
13651
|
serviceUrl: apiConfig.authService,
|
|
13790
13652
|
organizationId: organization._id,
|
|
13791
13653
|
jwt: jwt
|
|
13792
13654
|
});
|
|
13793
|
-
case
|
|
13794
|
-
_affiliates =
|
|
13655
|
+
case 16:
|
|
13656
|
+
_affiliates = _context4.sent;
|
|
13795
13657
|
setAffiliates(_affiliates);
|
|
13796
|
-
|
|
13658
|
+
_context4.next = 23;
|
|
13797
13659
|
break;
|
|
13798
|
-
case
|
|
13799
|
-
|
|
13800
|
-
|
|
13660
|
+
case 20:
|
|
13661
|
+
_context4.prev = 20;
|
|
13662
|
+
_context4.t1 = _context4["catch"](13);
|
|
13801
13663
|
LOG$3.error(new DivaError("Error loading affiliates", {
|
|
13802
13664
|
code: 'SELLER_0002',
|
|
13803
|
-
cause:
|
|
13665
|
+
cause: _context4.t1
|
|
13804
13666
|
}));
|
|
13805
|
-
case
|
|
13806
|
-
|
|
13807
|
-
|
|
13667
|
+
case 23:
|
|
13668
|
+
_context4.prev = 23;
|
|
13669
|
+
_context4.next = 26;
|
|
13808
13670
|
return loadCategories();
|
|
13809
|
-
case
|
|
13810
|
-
_yield$loadCategories =
|
|
13671
|
+
case 26:
|
|
13672
|
+
_yield$loadCategories = _context4.sent;
|
|
13811
13673
|
classificationFields = _yield$loadCategories.classificationFields;
|
|
13812
13674
|
newCurrentData = _yield$loadCategories.newCurrentData;
|
|
13813
13675
|
additional = _yield$loadCategories.additional;
|
|
@@ -13830,22 +13692,23 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13830
13692
|
});
|
|
13831
13693
|
newCurrentData.livingAreas = _objectSpread$5({}, newLivingArea);
|
|
13832
13694
|
}
|
|
13833
|
-
|
|
13695
|
+
_context4.next = 34;
|
|
13834
13696
|
return productHandler.loadProducts({
|
|
13835
13697
|
basket: updateBasket,
|
|
13698
|
+
divaNr: divaNr,
|
|
13836
13699
|
catalogData: catalogData,
|
|
13837
13700
|
classificationFields: !customFormData ? classificationFields : undefined,
|
|
13838
13701
|
fieldConfiguration: configurationData === null || configurationData === void 0 || (_configurationData$Pr2 = configurationData.ProductCreator) === null || _configurationData$Pr2 === void 0 ? void 0 : _configurationData$Pr2.fields,
|
|
13839
13702
|
customBaseFields: !customFormData ? _additionalBaseFields : undefined,
|
|
13840
13703
|
classificationConfig: !customFormData ? newCurrentData : undefined,
|
|
13841
13704
|
availableLanguages: availableLanguages,
|
|
13842
|
-
currentLang: language
|
|
13843
|
-
editedBasket: editedBasket
|
|
13705
|
+
currentLang: language
|
|
13844
13706
|
});
|
|
13845
|
-
case
|
|
13846
|
-
_yield$productHandler2 =
|
|
13707
|
+
case 34:
|
|
13708
|
+
_yield$productHandler2 = _context4.sent;
|
|
13847
13709
|
_isNew = _yield$productHandler2.isNew;
|
|
13848
13710
|
baseChanged = _yield$productHandler2.baseChanged;
|
|
13711
|
+
catalogs = _yield$productHandler2.catalogData;
|
|
13849
13712
|
initState = _objectWithoutProperties(_yield$productHandler2, _excluded2);
|
|
13850
13713
|
setIsNew(_isNew);
|
|
13851
13714
|
currentCategories = updateCategoriesInternal(initState.baseData.livingArea ? initState.baseData.livingArea : returnTo === 'toAssortmentManager' ? productCategories === null || productCategories === void 0 ? void 0 : productCategories.livingArea : undefined, initState.baseData.mainCategory ? initState.baseData.mainCategory : returnTo === 'toAssortmentManager' ? productCategories === null || productCategories === void 0 ? void 0 : productCategories.mainCategory : undefined, initState.baseData.subCategory ? initState.baseData.subCategory : returnTo === 'toAssortmentManager' ? productCategories === null || productCategories === void 0 ? void 0 : productCategories.subCategory : undefined, newCurrentData);
|
|
@@ -13872,7 +13735,7 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13872
13735
|
return (_opt$title = opt.title) !== null && _opt$title !== void 0 ? _opt$title : opt.field;
|
|
13873
13736
|
}).join(', ')));
|
|
13874
13737
|
}
|
|
13875
|
-
accountlogourl =
|
|
13738
|
+
accountlogourl = catalogs[0].accountLogo;
|
|
13876
13739
|
if (accountlogourl) {
|
|
13877
13740
|
logofile = new DivaFile({
|
|
13878
13741
|
jwt: jwt,
|
|
@@ -13914,26 +13777,26 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13914
13777
|
title: t('productcreator.configurationchanged.title'),
|
|
13915
13778
|
text: t('productcreator.configurationchanged.text')
|
|
13916
13779
|
});
|
|
13917
|
-
setSaved(!_isNew
|
|
13918
|
-
|
|
13780
|
+
setSaved(!_isNew);
|
|
13781
|
+
_context4.next = 60;
|
|
13919
13782
|
break;
|
|
13920
|
-
case
|
|
13921
|
-
|
|
13922
|
-
|
|
13783
|
+
case 57:
|
|
13784
|
+
_context4.prev = 57;
|
|
13785
|
+
_context4.t2 = _context4["catch"](23);
|
|
13923
13786
|
LOG$3.error(new DivaError("Error initalization", {
|
|
13924
13787
|
code: 'SELLER_0002',
|
|
13925
|
-
cause:
|
|
13788
|
+
cause: _context4.t2
|
|
13926
13789
|
}));
|
|
13927
|
-
case
|
|
13790
|
+
case 60:
|
|
13928
13791
|
toggleLoading('ProductDataInit');
|
|
13929
|
-
case
|
|
13792
|
+
case 61:
|
|
13930
13793
|
case "end":
|
|
13931
|
-
return
|
|
13794
|
+
return _context4.stop();
|
|
13932
13795
|
}
|
|
13933
|
-
},
|
|
13796
|
+
}, _callee4, null, [[13, 20], [23, 57]]);
|
|
13934
13797
|
}));
|
|
13935
13798
|
return function init() {
|
|
13936
|
-
return
|
|
13799
|
+
return _ref3.apply(this, arguments);
|
|
13937
13800
|
};
|
|
13938
13801
|
}();
|
|
13939
13802
|
init();
|
|
@@ -13942,40 +13805,40 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13942
13805
|
return _checkAndSetCustomForm.apply(this, arguments);
|
|
13943
13806
|
}
|
|
13944
13807
|
function _checkAndSetCustomForm() {
|
|
13945
|
-
_checkAndSetCustomForm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
13808
|
+
_checkAndSetCustomForm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
13946
13809
|
var _state$baseData$custo;
|
|
13947
13810
|
var productCreatorConfig;
|
|
13948
|
-
return _regeneratorRuntime.wrap(function
|
|
13949
|
-
while (1) switch (
|
|
13811
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
13812
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
13950
13813
|
case 0:
|
|
13951
|
-
|
|
13814
|
+
_context6.next = 2;
|
|
13952
13815
|
return getCustomFormConfig();
|
|
13953
13816
|
case 2:
|
|
13954
|
-
productCreatorConfig =
|
|
13817
|
+
productCreatorConfig = _context6.sent;
|
|
13955
13818
|
if (productCreatorConfig && !smArticleModalShowed && !originProductId && !(state !== null && state !== void 0 && (_state$baseData$custo = state.baseData.customData) !== null && _state$baseData$custo !== void 0 && (_state$baseData$custo = _state$baseData$custo.SMArticleId) !== null && _state$baseData$custo !== void 0 && _state$baseData$custo.value)) {
|
|
13956
13819
|
openModal({
|
|
13957
13820
|
accept: true,
|
|
13958
13821
|
reject: true,
|
|
13959
13822
|
text: t('productcreator.modal.createsmarticle'),
|
|
13960
13823
|
callback: function () {
|
|
13961
|
-
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
13824
|
+
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(accepted) {
|
|
13962
13825
|
var customFormDataLoaded;
|
|
13963
|
-
return _regeneratorRuntime.wrap(function
|
|
13964
|
-
while (1) switch (
|
|
13826
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
13827
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
13965
13828
|
case 0:
|
|
13966
13829
|
toggleLoading('loadCustomForm');
|
|
13967
13830
|
if (!accepted) {
|
|
13968
|
-
|
|
13831
|
+
_context5.next = 8;
|
|
13969
13832
|
break;
|
|
13970
13833
|
}
|
|
13971
|
-
|
|
13834
|
+
_context5.next = 4;
|
|
13972
13835
|
return loadCustomForm(productCreatorConfig);
|
|
13973
13836
|
case 4:
|
|
13974
|
-
customFormDataLoaded =
|
|
13837
|
+
customFormDataLoaded = _context5.sent;
|
|
13975
13838
|
if (customFormDataLoaded) {
|
|
13976
13839
|
setCustomFormData(customFormDataLoaded);
|
|
13977
13840
|
}
|
|
13978
|
-
|
|
13841
|
+
_context5.next = 9;
|
|
13979
13842
|
break;
|
|
13980
13843
|
case 8:
|
|
13981
13844
|
setCustomFormData(undefined);
|
|
@@ -13984,11 +13847,11 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13984
13847
|
toggleLoading('loadCustomForm');
|
|
13985
13848
|
case 11:
|
|
13986
13849
|
case "end":
|
|
13987
|
-
return
|
|
13850
|
+
return _context5.stop();
|
|
13988
13851
|
}
|
|
13989
|
-
},
|
|
13852
|
+
}, _callee5);
|
|
13990
13853
|
}));
|
|
13991
|
-
function callback(
|
|
13854
|
+
function callback(_x3) {
|
|
13992
13855
|
return _callback.apply(this, arguments);
|
|
13993
13856
|
}
|
|
13994
13857
|
return callback;
|
|
@@ -13997,9 +13860,9 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
13997
13860
|
}
|
|
13998
13861
|
case 4:
|
|
13999
13862
|
case "end":
|
|
14000
|
-
return
|
|
13863
|
+
return _context6.stop();
|
|
14001
13864
|
}
|
|
14002
|
-
},
|
|
13865
|
+
}, _callee6);
|
|
14003
13866
|
}));
|
|
14004
13867
|
return _checkAndSetCustomForm.apply(this, arguments);
|
|
14005
13868
|
}
|
|
@@ -14027,7 +13890,6 @@ function useProductState (basket, divaNr, checkBasket, editedBasket) {
|
|
|
14027
13890
|
removeMedia: removeMedia,
|
|
14028
13891
|
sortMedia: sortMedia,
|
|
14029
13892
|
sortVariantRows: sortVariantRows,
|
|
14030
|
-
addBasket: addBasket,
|
|
14031
13893
|
save: save,
|
|
14032
13894
|
reset: reset,
|
|
14033
13895
|
updateOptMap: dispatchUpdateOptMap
|
|
@@ -14082,162 +13944,14 @@ function reducer(state, action) {
|
|
|
14082
13944
|
var _newState7 = state;
|
|
14083
13945
|
_newState7 = sortVariantRows(_newState7, action.from, action.to, action.sortedVariantIds);
|
|
14084
13946
|
return _newState7;
|
|
14085
|
-
} else if (action.type == '
|
|
13947
|
+
} else if (action.type == 'updateOptMap') {
|
|
14086
13948
|
var _newState8 = state;
|
|
14087
|
-
action.data.
|
|
14088
|
-
if (d.DivaNr == _newState8.baseData.divaNr) {
|
|
14089
|
-
//if on basketdata is from the current basedata, pass the product as well
|
|
14090
|
-
_newState8 = addBasket(_newState8, d, _newState8.baseData);
|
|
14091
|
-
} else {
|
|
14092
|
-
_newState8 = addBasket(_newState8, d);
|
|
14093
|
-
}
|
|
14094
|
-
});
|
|
13949
|
+
_newState8 = updateOptMap(_newState8, action.data, action.mediaService, action.jwt);
|
|
14095
13950
|
return _newState8;
|
|
14096
|
-
} else if (action.type == 'updateOptMap') {
|
|
14097
|
-
var _newState9 = state;
|
|
14098
|
-
_newState9 = updateOptMap(_newState9, action.data, action.mediaService, action.jwt);
|
|
14099
|
-
return _newState9;
|
|
14100
13951
|
}
|
|
14101
13952
|
return state;
|
|
14102
13953
|
}
|
|
14103
13954
|
|
|
14104
|
-
/**
|
|
14105
|
-
* Adds a basketdata as variant to the current product
|
|
14106
|
-
*
|
|
14107
|
-
* @param prevState the previouse state object
|
|
14108
|
-
* @param basket a basket data to be added as variant
|
|
14109
|
-
* @param productData an existing product data
|
|
14110
|
-
* @returns the updated state object
|
|
14111
|
-
*/
|
|
14112
|
-
function addBasket(prevState, basket, productData) {
|
|
14113
|
-
var _orderSet$OrderLines$, _orderSet$SetVariantB;
|
|
14114
|
-
var baseData = prevState.baseData;
|
|
14115
|
-
var orderSet = basket === null || basket === void 0 ? void 0 : basket.OrderSets[0];
|
|
14116
|
-
var dockingPoints = orderSet.getDockingPointInfo();
|
|
14117
|
-
var newVariantData = prevState.variantData ? _toConsumableArray(prevState.variantData) : [];
|
|
14118
|
-
var newVariant;
|
|
14119
|
-
if (productData) {
|
|
14120
|
-
//if basedata is turned into a varinat, the current product data is used
|
|
14121
|
-
//and the media is removed from the base data, because if there are variants, only the variants should have media
|
|
14122
|
-
newVariant = _objectSpread$5(_objectSpread$5({}, productData), {}, {
|
|
14123
|
-
_id: nanoid(),
|
|
14124
|
-
variantId: newVariantData.length,
|
|
14125
|
-
originDivaNr: basket === null || basket === void 0 ? void 0 : basket.DivaNr
|
|
14126
|
-
});
|
|
14127
|
-
baseData = _objectSpread$5(_objectSpread$5({}, prevState.baseData), {}, {
|
|
14128
|
-
media: []
|
|
14129
|
-
});
|
|
14130
|
-
} else {
|
|
14131
|
-
var _orderSet$BBox, _orderSet$BBox2, _orderSet$BBox3;
|
|
14132
|
-
newVariant = {
|
|
14133
|
-
_id: nanoid(),
|
|
14134
|
-
divaNr: prevState.baseData.divaNr,
|
|
14135
|
-
modelName: prevState.baseData.modelName,
|
|
14136
|
-
shortDescription: prevState.baseData.shortDescription,
|
|
14137
|
-
info: prevState.baseData.info,
|
|
14138
|
-
technicalDescription: orderSet === null || orderSet === void 0 ? void 0 : orderSet.VariantDescription,
|
|
14139
|
-
orderDescription: orderSet === null || orderSet === void 0 ? void 0 : orderSet.VariantDescription,
|
|
14140
|
-
width: orderSet === null || orderSet === void 0 || (_orderSet$BBox = orderSet.BBox) === null || _orderSet$BBox === void 0 ? void 0 : _orderSet$BBox.X,
|
|
14141
|
-
height: orderSet === null || orderSet === void 0 || (_orderSet$BBox2 = orderSet.BBox) === null || _orderSet$BBox2 === void 0 ? void 0 : _orderSet$BBox2.Z,
|
|
14142
|
-
depth: orderSet === null || orderSet === void 0 || (_orderSet$BBox3 = orderSet.BBox) === null || _orderSet$BBox3 === void 0 ? void 0 : _orderSet$BBox3.Y,
|
|
14143
|
-
calculatedPrice: orderSet === null || orderSet === void 0 ? void 0 : orderSet.SetPrice,
|
|
14144
|
-
addedPrice: orderSet === null || orderSet === void 0 ? void 0 : orderSet.SetPrice,
|
|
14145
|
-
articles: orderSet === null || orderSet === void 0 ? void 0 : orderSet.OrderLines.map(function (ol) {
|
|
14146
|
-
var _ol$VariantBasketData;
|
|
14147
|
-
return {
|
|
14148
|
-
articleCodex: ol.ArticleCodex,
|
|
14149
|
-
catalogCodex: orderSet.CatalogCodex,
|
|
14150
|
-
variantValues: (_ol$VariantBasketData = ol.VariantBasketDatas) === null || _ol$VariantBasketData === void 0 ? void 0 : _ol$VariantBasketData.map(function (vb) {
|
|
14151
|
-
return {
|
|
14152
|
-
OPT: vb.OPT,
|
|
14153
|
-
OPV: vb.OPV
|
|
14154
|
-
};
|
|
14155
|
-
})
|
|
14156
|
-
};
|
|
14157
|
-
}),
|
|
14158
|
-
image: orderSet === null || orderSet === void 0 ? void 0 : orderSet.SetImage,
|
|
14159
|
-
image2D: orderSet === null || orderSet === void 0 ? void 0 : orderSet.Set2DImage,
|
|
14160
|
-
catalogId: [orderSet === null || orderSet === void 0 ? void 0 : orderSet.CatalogGUID],
|
|
14161
|
-
collection: [orderSet === null || orderSet === void 0 ? void 0 : orderSet.AccountName],
|
|
14162
|
-
collectionId: [orderSet === null || orderSet === void 0 ? void 0 : orderSet.CollectionGUID],
|
|
14163
|
-
catCodex: [orderSet.CatalogCodex],
|
|
14164
|
-
livingArea: prevState.baseData.livingArea,
|
|
14165
|
-
mainCategory: prevState.baseData.mainCategory,
|
|
14166
|
-
subCategory: prevState.baseData.subCategory,
|
|
14167
|
-
dockingPoints: dockingPoints,
|
|
14168
|
-
variantId: newVariantData.length,
|
|
14169
|
-
originDivaNr: basket === null || basket === void 0 ? void 0 : basket.DivaNr
|
|
14170
|
-
};
|
|
14171
|
-
}
|
|
14172
|
-
var optFields = prevState.optFields ? _toConsumableArray(prevState.optFields) : [];
|
|
14173
|
-
var initialSelectedFields = prevState.initialSelectedFields ? _toConsumableArray(prevState.initialSelectedFields) : [];
|
|
14174
|
-
|
|
14175
|
-
//get optFields and initaliSelectedFileds
|
|
14176
|
-
//if optField is not yet preset in the list of opts, add it
|
|
14177
|
-
//if it is present, check if it is not yet in the list of initial selected fields and if now there are varinats with differences in this OPV
|
|
14178
|
-
//if so add it it initalSelectedFields
|
|
14179
|
-
var basketId = (_orderSet$OrderLines$ = orderSet.OrderLines.find(function (ol) {
|
|
14180
|
-
return !ol.RelatedToBasketID;
|
|
14181
|
-
})) === null || _orderSet$OrderLines$ === void 0 ? void 0 : _orderSet$OrderLines$.BasketID;
|
|
14182
|
-
orderSet === null || orderSet === void 0 || (_orderSet$SetVariantB = orderSet.SetVariantBasketDatas) === null || _orderSet$SetVariantB === void 0 || _orderSet$SetVariantB.filter(function (vb) {
|
|
14183
|
-
return !vb.IsDescribingState;
|
|
14184
|
-
}).forEach(function (v) {
|
|
14185
|
-
var _prevState$variantDat;
|
|
14186
|
-
//if this opt is already set do nothing
|
|
14187
|
-
if (newVariant[v.OPT]) {
|
|
14188
|
-
return;
|
|
14189
|
-
}
|
|
14190
|
-
//if the same OPT existis multiple times, use the one of the main article
|
|
14191
|
-
var variantsWithSameOPT = orderSet.SetVariantBasketDatas.filter(function (v2) {
|
|
14192
|
-
return v2.OPT == v.OPT;
|
|
14193
|
-
});
|
|
14194
|
-
if (variantsWithSameOPT.length > 1) {
|
|
14195
|
-
v = variantsWithSameOPT.find(function (v2) {
|
|
14196
|
-
return v2.BasketID == basketId;
|
|
14197
|
-
}) || v;
|
|
14198
|
-
}
|
|
14199
|
-
newVariant[v.OPT] = v.OPVName || v.OPV;
|
|
14200
|
-
var field = {
|
|
14201
|
-
field: v.OPT,
|
|
14202
|
-
type: 'string',
|
|
14203
|
-
title: v.OPTName || v.OPT,
|
|
14204
|
-
readOnly: true,
|
|
14205
|
-
fieldType: 'OPT'
|
|
14206
|
-
};
|
|
14207
|
-
if (!optFields.find(function (f) {
|
|
14208
|
-
return f.field == v.OPT;
|
|
14209
|
-
})) {
|
|
14210
|
-
optFields.push(field);
|
|
14211
|
-
} else if (!initialSelectedFields.find(function (f) {
|
|
14212
|
-
return f.field == v.OPT;
|
|
14213
|
-
}) && (_prevState$variantDat = prevState.variantData) !== null && _prevState$variantDat !== void 0 && _prevState$variantDat.some(function (vd) {
|
|
14214
|
-
return vd[v.OPT] != newVariant[v.OPT];
|
|
14215
|
-
})) {
|
|
14216
|
-
initialSelectedFields.push(field);
|
|
14217
|
-
}
|
|
14218
|
-
});
|
|
14219
|
-
|
|
14220
|
-
//add classification values to the variant
|
|
14221
|
-
Object.entries(prevState.classificationData).forEach(function (_ref7) {
|
|
14222
|
-
var _ref8 = _slicedToArray(_ref7, 2),
|
|
14223
|
-
key = _ref8[0],
|
|
14224
|
-
value = _ref8[1];
|
|
14225
|
-
return newVariant[key] = value;
|
|
14226
|
-
});
|
|
14227
|
-
var newModifiedData = prevState.modified.variantData ? _toConsumableArray(prevState.modified.variantData) : [];
|
|
14228
|
-
newModifiedData.push({});
|
|
14229
|
-
newVariantData.push(newVariant);
|
|
14230
|
-
return _objectSpread$5(_objectSpread$5({}, prevState), {}, {
|
|
14231
|
-
baseData: baseData,
|
|
14232
|
-
variantData: newVariantData,
|
|
14233
|
-
optFields: optFields,
|
|
14234
|
-
initialSelectedFields: initialSelectedFields,
|
|
14235
|
-
modified: _objectSpread$5(_objectSpread$5({}, prevState.modified), {}, {
|
|
14236
|
-
variantData: newModifiedData
|
|
14237
|
-
})
|
|
14238
|
-
});
|
|
14239
|
-
}
|
|
14240
|
-
|
|
14241
13955
|
/**
|
|
14242
13956
|
* Updates all variant data
|
|
14243
13957
|
*
|
|
@@ -14252,10 +13966,10 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
|
|
|
14252
13966
|
if (baseDataFields.some(function (field) {
|
|
14253
13967
|
return field.manualFields && field.field == 'customData';
|
|
14254
13968
|
}) && currentState.baseData.customData) {
|
|
14255
|
-
var manualFields = Object.entries(currentState.baseData.customData).filter(function (
|
|
14256
|
-
var
|
|
14257
|
-
|
|
14258
|
-
var valueObj =
|
|
13969
|
+
var manualFields = Object.entries(currentState.baseData.customData).filter(function (_ref7) {
|
|
13970
|
+
var _ref8 = _slicedToArray(_ref7, 2);
|
|
13971
|
+
_ref8[0];
|
|
13972
|
+
var valueObj = _ref8[1];
|
|
14259
13973
|
return valueObj === null || valueObj === void 0 ? void 0 : valueObj.manual;
|
|
14260
13974
|
});
|
|
14261
13975
|
for (var i = 0; i < manualFields.length; i++) {
|
|
@@ -14541,10 +14255,10 @@ function updateOptMap(currentState, optMap, mediaService, jwt) {
|
|
|
14541
14255
|
LOG$3.debug("Product ".concat(product._id, " has no class mapping for OPT ").concat(optField.field));
|
|
14542
14256
|
return;
|
|
14543
14257
|
}
|
|
14544
|
-
var className = (_optMapEntries$find = optMapEntries.find(function (
|
|
14545
|
-
var
|
|
14546
|
-
|
|
14547
|
-
var optValueField =
|
|
14258
|
+
var className = (_optMapEntries$find = optMapEntries.find(function (_ref9) {
|
|
14259
|
+
var _ref10 = _slicedToArray(_ref9, 2);
|
|
14260
|
+
_ref10[0];
|
|
14261
|
+
var optValueField = _ref10[1];
|
|
14548
14262
|
return (optValueField === null || optValueField === void 0 ? void 0 : optValueField.field) == optField.field;
|
|
14549
14263
|
})) === null || _optMapEntries$find === void 0 ? void 0 : _optMapEntries$find[0];
|
|
14550
14264
|
if (!className) {
|
|
@@ -14665,9 +14379,9 @@ function removeMedia(currentState, data, variants) {
|
|
|
14665
14379
|
return m.url == data.url;
|
|
14666
14380
|
});
|
|
14667
14381
|
if (product.media && index != undefined) {
|
|
14668
|
-
var
|
|
14382
|
+
var _ref11;
|
|
14669
14383
|
var deleted = product.media.splice(index, 1);
|
|
14670
|
-
(
|
|
14384
|
+
(_ref11 = newState.removedMedia).push.apply(_ref11, _toConsumableArray(deleted));
|
|
14671
14385
|
}
|
|
14672
14386
|
});
|
|
14673
14387
|
return newState;
|
|
@@ -15022,6 +14736,9 @@ function RenderJobForm (_ref) {
|
|
|
15022
14736
|
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
15023
14737
|
value: "HQ",
|
|
15024
14738
|
children: "HQ"
|
|
14739
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
14740
|
+
value: "MASTER",
|
|
14741
|
+
children: "MASTER"
|
|
15025
14742
|
}), /*#__PURE__*/jsx(MenuItem, {
|
|
15026
14743
|
value: "SPIN",
|
|
15027
14744
|
children: "SPIN"
|
|
@@ -15209,9 +14926,8 @@ function useRenderjobs (_ref) {
|
|
|
15209
14926
|
var hasVariants = _ref.hasVariants,
|
|
15210
14927
|
baseData = _ref.baseData,
|
|
15211
14928
|
onError = _ref.onError;
|
|
15212
|
-
var _useSellerState = useSellerState()
|
|
15213
|
-
|
|
15214
|
-
var basket = currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket;
|
|
14929
|
+
var _useSellerState = useSellerState();
|
|
14930
|
+
_useSellerState.state.currentBasketState;
|
|
15215
14931
|
var _useState = useState(hasVariants ? [] : [baseData]),
|
|
15216
14932
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15217
14933
|
selected = _useState2[0],
|
|
@@ -15276,60 +14992,42 @@ function useRenderjobs (_ref) {
|
|
|
15276
14992
|
setSelectionData();
|
|
15277
14993
|
}, [selected, renderJobFormState]);
|
|
15278
14994
|
function setSelectionData() {
|
|
15279
|
-
if (!basket) {
|
|
15280
|
-
throw new Error("can't order renderjobs without basket");
|
|
15281
|
-
}
|
|
15282
14995
|
if (hasVariants) {
|
|
15283
|
-
var
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
return selected.some(function (s, selIdx) {
|
|
15291
|
-
var _s$variantId, _cV$VariantID;
|
|
15292
|
-
return ((_s$variantId = s.variantId) !== null && _s$variantId !== void 0 ? _s$variantId : selIdx) == ((_cV$VariantID = cV.VariantID) !== null && _cV$VariantID !== void 0 ? _cV$VariantID : idx);
|
|
15293
|
-
});
|
|
15294
|
-
});
|
|
15295
|
-
if (!selectedConfigVariants) {
|
|
15296
|
-
throw new Error('no selected configVariants');
|
|
15297
|
-
}
|
|
15298
|
-
var d3dps = [];
|
|
15299
|
-
var hqrs = [];
|
|
15300
|
-
selectedConfigVariants.forEach(function (cV) {
|
|
15301
|
-
d3dps.push(JSON.parse(atob(cV.Diva3DProject)));
|
|
15302
|
-
hqrs.push(cV.HQRenderScript);
|
|
15303
|
-
});
|
|
15304
|
-
setDiva3DProjects(d3dps);
|
|
15305
|
-
setInitialDiva3DProject(d3dps[0]);
|
|
15306
|
-
setHQRenderScripts(hqrs);
|
|
15307
|
-
getHQRenderScript(hqrs[0]).then(function (res) {
|
|
15308
|
-
var _res$data;
|
|
15309
|
-
return res.data[0] && res.data[0].hqRenderscript && setCurrentHQRenderScript((_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data[0]) === null || _res$data === void 0 ? void 0 : _res$data.hqRenderscript);
|
|
15310
|
-
});
|
|
15311
|
-
};
|
|
15312
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
15313
|
-
_loop();
|
|
15314
|
-
}
|
|
15315
|
-
} catch (err) {
|
|
15316
|
-
_iterator.e(err);
|
|
15317
|
-
} finally {
|
|
15318
|
-
_iterator.f();
|
|
14996
|
+
var selectedConfigVariants = selected.filter(function (v) {
|
|
14997
|
+
return !!v.configuration;
|
|
14998
|
+
}).map(function (v) {
|
|
14999
|
+
return v.configuration;
|
|
15000
|
+
});
|
|
15001
|
+
if (!selectedConfigVariants) {
|
|
15002
|
+
throw new Error('no selected configVariants');
|
|
15319
15003
|
}
|
|
15004
|
+
var d3dps = [];
|
|
15005
|
+
var hqrs = [];
|
|
15006
|
+
selectedConfigVariants.forEach(function (cV) {
|
|
15007
|
+
var set = cV === null || cV === void 0 ? void 0 : cV.OrderSets[0];
|
|
15008
|
+
if (set !== null && set !== void 0 && set.Diva3DProject) d3dps.push(JSON.parse(atob(set.Diva3DProject)));
|
|
15009
|
+
if (set !== null && set !== void 0 && set.HQRenderScript) hqrs.push(set.HQRenderScript);
|
|
15010
|
+
});
|
|
15011
|
+
setDiva3DProjects(d3dps);
|
|
15012
|
+
setInitialDiva3DProject(d3dps[0]);
|
|
15013
|
+
setHQRenderScripts(hqrs);
|
|
15014
|
+
getHQRenderScript(hqrs[0]).then(function (res) {
|
|
15015
|
+
var _res$data;
|
|
15016
|
+
return res.data[0] && res.data[0].hqRenderscript && setCurrentHQRenderScript((_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data[0]) === null || _res$data === void 0 ? void 0 : _res$data.hqRenderscript);
|
|
15017
|
+
});
|
|
15320
15018
|
} else {
|
|
15321
|
-
|
|
15322
|
-
|
|
15019
|
+
var _selected$0$configura;
|
|
15020
|
+
var orderSet = (_selected$0$configura = selected[0].configuration) === null || _selected$0$configura === void 0 ? void 0 : _selected$0$configura.OrderSets[0];
|
|
15021
|
+
if (!orderSet || !orderSet.HQRenderScript || !orderSet.Diva3DProject) {
|
|
15022
|
+
throw new Error('HQRenderScript or Diva3DProject missing in product');
|
|
15323
15023
|
}
|
|
15324
|
-
getHQRenderScript(
|
|
15024
|
+
getHQRenderScript(orderSet.HQRenderScript).then(function (res) {
|
|
15325
15025
|
var _res$data2;
|
|
15326
15026
|
return res.data[0] && res.data[0].hqRenderscript && setCurrentHQRenderScript((_res$data2 = res.data) === null || _res$data2 === void 0 || (_res$data2 = _res$data2[0]) === null || _res$data2 === void 0 ? void 0 : _res$data2.hqRenderscript);
|
|
15327
15027
|
});
|
|
15328
|
-
setDiva3DProjects([JSON.parse(atob(
|
|
15329
|
-
setInitialDiva3DProject(JSON.parse(atob(
|
|
15330
|
-
setHQRenderScripts(
|
|
15331
|
-
return os.HQRenderScript;
|
|
15332
|
-
}));
|
|
15028
|
+
setDiva3DProjects([JSON.parse(atob(orderSet.Diva3DProject))]);
|
|
15029
|
+
setInitialDiva3DProject(JSON.parse(atob(orderSet.Diva3DProject)));
|
|
15030
|
+
setHQRenderScripts([orderSet.HQRenderScript]);
|
|
15333
15031
|
}
|
|
15334
15032
|
}
|
|
15335
15033
|
function reducerRenderJobForm(state, action) {
|
|
@@ -15359,11 +15057,11 @@ function useRenderjobs (_ref) {
|
|
|
15359
15057
|
for (var elIdx = 0; elIdx < initSet.ELE.length; elIdx++) {
|
|
15360
15058
|
var initEl = initSet.ELE[elIdx];
|
|
15361
15059
|
var changedCFG = changedSet.ELE[elIdx].CFG;
|
|
15362
|
-
var
|
|
15363
|
-
|
|
15060
|
+
var _iterator = _createForOfIteratorHelper(initEl.CFG),
|
|
15061
|
+
_step;
|
|
15364
15062
|
try {
|
|
15365
|
-
var
|
|
15366
|
-
var initOption =
|
|
15063
|
+
var _loop = function _loop() {
|
|
15064
|
+
var initOption = _step.value;
|
|
15367
15065
|
if (!changedCFG.find(function (option) {
|
|
15368
15066
|
return option.OPT == initOption.OPT && option.OPV == initOption.OPV;
|
|
15369
15067
|
})) {
|
|
@@ -15373,14 +15071,14 @@ function useRenderjobs (_ref) {
|
|
|
15373
15071
|
}
|
|
15374
15072
|
},
|
|
15375
15073
|
_ret;
|
|
15376
|
-
for (
|
|
15377
|
-
_ret =
|
|
15074
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
15075
|
+
_ret = _loop();
|
|
15378
15076
|
if (_ret) return _ret.v;
|
|
15379
15077
|
}
|
|
15380
15078
|
} catch (err) {
|
|
15381
|
-
|
|
15079
|
+
_iterator.e(err);
|
|
15382
15080
|
} finally {
|
|
15383
|
-
|
|
15081
|
+
_iterator.f();
|
|
15384
15082
|
}
|
|
15385
15083
|
}
|
|
15386
15084
|
}
|
|
@@ -15403,7 +15101,7 @@ function useRenderjobs (_ref) {
|
|
|
15403
15101
|
i = 0;
|
|
15404
15102
|
case 5:
|
|
15405
15103
|
if (!(i < selected.length)) {
|
|
15406
|
-
_context.next =
|
|
15104
|
+
_context.next = 24;
|
|
15407
15105
|
break;
|
|
15408
15106
|
}
|
|
15409
15107
|
selectedProduct = selected[i];
|
|
@@ -15445,43 +15143,37 @@ function useRenderjobs (_ref) {
|
|
|
15445
15143
|
if (newJob.fileName && newJob.fileName.includes(';') && variantId) {
|
|
15446
15144
|
newJob.fileName = newJob.fileName.split(';')[Number(variantId)];
|
|
15447
15145
|
}
|
|
15448
|
-
if (basket) {
|
|
15449
|
-
_context.next = 16;
|
|
15450
|
-
break;
|
|
15451
|
-
}
|
|
15452
|
-
throw Error('cant order renderjob without basket');
|
|
15453
|
-
case 16:
|
|
15454
15146
|
if (!diva3DProjects[i]) {
|
|
15455
|
-
_context.next =
|
|
15147
|
+
_context.next = 20;
|
|
15456
15148
|
break;
|
|
15457
15149
|
}
|
|
15458
15150
|
newJob.diva3DProject = JSON.stringify(diva3DProjects[i]);
|
|
15459
15151
|
jobs.push(newJob);
|
|
15460
|
-
return _context.abrupt("continue",
|
|
15461
|
-
case
|
|
15152
|
+
return _context.abrupt("continue", 21);
|
|
15153
|
+
case 20:
|
|
15462
15154
|
throw Error('cant order renderjob without diva3dproject');
|
|
15463
|
-
case
|
|
15155
|
+
case 21:
|
|
15464
15156
|
i++;
|
|
15465
15157
|
_context.next = 5;
|
|
15466
15158
|
break;
|
|
15467
|
-
case
|
|
15468
|
-
_context.next =
|
|
15159
|
+
case 24:
|
|
15160
|
+
_context.next = 26;
|
|
15469
15161
|
return apiSaveRenderJobs({
|
|
15470
15162
|
serviceUrl: apiConfig.mediaService,
|
|
15471
15163
|
jwt: jwt,
|
|
15472
15164
|
jobs: jobs
|
|
15473
15165
|
});
|
|
15474
|
-
case
|
|
15166
|
+
case 26:
|
|
15475
15167
|
jobs = _context.sent;
|
|
15476
15168
|
// reset diva3dproject and hqrenderscript by resetting it
|
|
15477
15169
|
setSelectionData();
|
|
15478
15170
|
jobs.forEach(function (j) {
|
|
15479
15171
|
return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(j);
|
|
15480
15172
|
});
|
|
15481
|
-
_context.next =
|
|
15173
|
+
_context.next = 35;
|
|
15482
15174
|
break;
|
|
15483
|
-
case
|
|
15484
|
-
_context.prev =
|
|
15175
|
+
case 31:
|
|
15176
|
+
_context.prev = 31;
|
|
15485
15177
|
_context.t0 = _context["catch"](0);
|
|
15486
15178
|
LOG$2.error(new DivaError('Coud not created renderjobs', {
|
|
15487
15179
|
cause: _context.t0
|
|
@@ -15493,11 +15185,11 @@ function useRenderjobs (_ref) {
|
|
|
15493
15185
|
} else {
|
|
15494
15186
|
onError(t('modal.general_error') + ' ' + t('modal.errorcode') + ':' + DivaUtils$1.getCurrentTraceId() + ' ' + DivaUtils$1.formatDate(new Date(), true, undefined, true));
|
|
15495
15187
|
}
|
|
15496
|
-
case
|
|
15188
|
+
case 35:
|
|
15497
15189
|
case "end":
|
|
15498
15190
|
return _context.stop();
|
|
15499
15191
|
}
|
|
15500
|
-
}, _callee, null, [[0,
|
|
15192
|
+
}, _callee, null, [[0, 31]]);
|
|
15501
15193
|
}));
|
|
15502
15194
|
return function createRenderJob(_x) {
|
|
15503
15195
|
return _ref3.apply(this, arguments);
|
|
@@ -16628,11 +16320,9 @@ function RenderJobTableLegacy (_ref) {
|
|
|
16628
16320
|
}
|
|
16629
16321
|
|
|
16630
16322
|
function ProductCreator (_ref) {
|
|
16631
|
-
var _state$variantData, _state$variantData2, _state$variantData$fi, _state$variantData3, _state$baseData$custo2,
|
|
16323
|
+
var _state$variantData, _state$variantData2, _state$variantData$fi, _state$variantData3, _state$baseData$custo2, _currentBasket$DivaNr, _configurationData$Pr6, _state$baseData$custo3, _configurationData$Pr7, _configurationData$Pr8, _currentBasket$OrderS;
|
|
16632
16324
|
var basket = _ref.basket,
|
|
16633
|
-
divaNr = _ref.divaNr
|
|
16634
|
-
checkBasket = _ref.checkBasket,
|
|
16635
|
-
editedBasket = _ref.editedBasket;
|
|
16325
|
+
divaNr = _ref.divaNr;
|
|
16636
16326
|
var _useSellerState = useSellerState(),
|
|
16637
16327
|
_useSellerState$actio = _useSellerState.actions,
|
|
16638
16328
|
openPlanner = _useSellerState$actio.openPlanner,
|
|
@@ -16648,7 +16338,7 @@ function ProductCreator (_ref) {
|
|
|
16648
16338
|
userHasPermission = _useDivaCore.actions.userHasPermission;
|
|
16649
16339
|
var _useTranslation = useTranslation(),
|
|
16650
16340
|
t = _useTranslation.t;
|
|
16651
|
-
var _useProductState = useProductState(basket, divaNr
|
|
16341
|
+
var _useProductState = useProductState(basket, divaNr),
|
|
16652
16342
|
state = _useProductState.state,
|
|
16653
16343
|
baseDataFields = _useProductState.baseDataFields,
|
|
16654
16344
|
currentBasket = _useProductState.basket,
|
|
@@ -16672,7 +16362,6 @@ function ProductCreator (_ref) {
|
|
|
16672
16362
|
sortMedia = _useProductState.sortMedia,
|
|
16673
16363
|
sortVariantRows = _useProductState.sortVariantRows,
|
|
16674
16364
|
removeMedia = _useProductState.removeMedia,
|
|
16675
|
-
addBasket = _useProductState.addBasket,
|
|
16676
16365
|
save = _useProductState.save,
|
|
16677
16366
|
reset = _useProductState.reset,
|
|
16678
16367
|
updateOptMap = _useProductState.updateOptMap;
|
|
@@ -16769,51 +16458,35 @@ function ProductCreator (_ref) {
|
|
|
16769
16458
|
setSelectedFields((_state$initialSelecte = state === null || state === void 0 ? void 0 : state.initialSelectedFields) !== null && _state$initialSelecte !== void 0 ? _state$initialSelecte : []);
|
|
16770
16459
|
}, [state === null || state === void 0 ? void 0 : state.initialSelectedFields]);
|
|
16771
16460
|
var onOpenPlanner = function onOpenPlanner() {
|
|
16461
|
+
var basketToInit = new BasketData(state === null || state === void 0 ? void 0 : state.baseData.configuration);
|
|
16462
|
+
basketToInit.OrderSets[0].TinyVariantConfiguration = state === null || state === void 0 ? void 0 : state.variantData.map(function (v) {
|
|
16463
|
+
return v.configuration;
|
|
16464
|
+
});
|
|
16772
16465
|
if (currentBasket !== null && currentBasket !== void 0 && currentBasket.SetPlannerInfos) {
|
|
16773
16466
|
openPlanner({
|
|
16774
|
-
basketData:
|
|
16775
|
-
divaNr:
|
|
16467
|
+
basketData: basketToInit,
|
|
16468
|
+
divaNr: state === null || state === void 0 ? void 0 : state.baseData.divaNr,
|
|
16776
16469
|
returnTo: 'SETPLANNER_OPEN_SELLER_PRODUCTCREATOR',
|
|
16777
16470
|
forceReload: '1'
|
|
16778
16471
|
});
|
|
16779
16472
|
} else if (showVarinats) {
|
|
16780
16473
|
openPlanner({
|
|
16781
|
-
setId:
|
|
16782
|
-
basketData:
|
|
16783
|
-
divaNr:
|
|
16474
|
+
setId: basketToInit.OrderSets[0].SetID,
|
|
16475
|
+
basketData: basketToInit,
|
|
16476
|
+
divaNr: state === null || state === void 0 ? void 0 : state.baseData.divaNr,
|
|
16784
16477
|
returnTo: 'FAVORITS_OPEN_SELLER_PRODUCTCREATOR',
|
|
16785
16478
|
forceReload: '1'
|
|
16786
16479
|
});
|
|
16787
16480
|
} else {
|
|
16788
16481
|
openPlanner({
|
|
16789
|
-
setId:
|
|
16790
|
-
basketData:
|
|
16791
|
-
divaNr:
|
|
16482
|
+
setId: basketToInit.OrderSets[0].SetID,
|
|
16483
|
+
basketData: basketToInit,
|
|
16484
|
+
divaNr: state === null || state === void 0 ? void 0 : state.baseData.divaNr,
|
|
16792
16485
|
returnTo: 'OPEN_SELLER_PRODUCTCREATOR',
|
|
16793
16486
|
forceReload: '1'
|
|
16794
16487
|
});
|
|
16795
16488
|
}
|
|
16796
16489
|
};
|
|
16797
|
-
var onAddBasket = function onAddBasket() {
|
|
16798
|
-
openModal({
|
|
16799
|
-
accept: true,
|
|
16800
|
-
reject: true,
|
|
16801
|
-
title: 'Planung hinzufügen',
|
|
16802
|
-
text: 'Geben Sie die DivaNr der Planung ein, die Sie zu diesem Produkt hinzufügen wollen.' + ' Die Plannung muss vom selben Katalog sein und muss die selben Artikel enthalten. ',
|
|
16803
|
-
content: /*#__PURE__*/jsx(Fragment, {
|
|
16804
|
-
children: /*#__PURE__*/jsx(TextField$1, {
|
|
16805
|
-
label: "DivaNr",
|
|
16806
|
-
name: "DivaNr"
|
|
16807
|
-
})
|
|
16808
|
-
}),
|
|
16809
|
-
callback: function callback(d) {
|
|
16810
|
-
if (d instanceof FormData) {
|
|
16811
|
-
var _d$get;
|
|
16812
|
-
addBasket((_d$get = d.get('DivaNr')) === null || _d$get === void 0 ? void 0 : _d$get.trim());
|
|
16813
|
-
}
|
|
16814
|
-
}
|
|
16815
|
-
});
|
|
16816
|
-
};
|
|
16817
16490
|
var onSave = /*#__PURE__*/function () {
|
|
16818
16491
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
16819
16492
|
var success, _opener, _state$variantData$fi2, _state$variantData4, variantId, _configurationData$Pr2, _configurationData$Pr3;
|
|
@@ -16991,9 +16664,7 @@ function ProductCreator (_ref) {
|
|
|
16991
16664
|
var ButtonsElement = /*#__PURE__*/jsx(Buttons, {
|
|
16992
16665
|
saveDisabled: missingMandatoryFields || missingMandatoryCustomFields,
|
|
16993
16666
|
editBasketDisabled: editBasketDisabled,
|
|
16994
|
-
allowAdd: configurationData === null || configurationData === void 0 || (_configurationData$Pr6 = configurationData.ProductCreator) === null || _configurationData$Pr6 === void 0 ? void 0 : _configurationData$Pr6.allowAddBasket,
|
|
16995
16667
|
onSave: onSave,
|
|
16996
|
-
onAddBasket: onAddBasket,
|
|
16997
16668
|
onOpenPlanner: onOpenPlanner,
|
|
16998
16669
|
onCancel: onCancel
|
|
16999
16670
|
});
|
|
@@ -17006,7 +16677,7 @@ function ProductCreator (_ref) {
|
|
|
17006
16677
|
height: '100%'
|
|
17007
16678
|
},
|
|
17008
16679
|
children: [/*#__PURE__*/jsx(Title, {
|
|
17009
|
-
text: "".concat(t('productcreator.title'), " - ").concat(currentBasket === null || currentBasket === void 0 ? void 0 : currentBasket.DivaNr)
|
|
16680
|
+
text: "".concat(t('productcreator.title'), " - ").concat((_currentBasket$DivaNr = currentBasket === null || currentBasket === void 0 ? void 0 : currentBasket.DivaNr) !== null && _currentBasket$DivaNr !== void 0 ? _currentBasket$DivaNr : state.baseData.divaNr)
|
|
17010
16681
|
}), /*#__PURE__*/jsxs("div", {
|
|
17011
16682
|
style: {
|
|
17012
16683
|
position: 'relative',
|
|
@@ -17024,7 +16695,6 @@ function ProductCreator (_ref) {
|
|
|
17024
16695
|
return setTab(v);
|
|
17025
16696
|
},
|
|
17026
16697
|
indicatorColor: "primary",
|
|
17027
|
-
textColor: "primary",
|
|
17028
16698
|
children: [tabs.map(function (tab) {
|
|
17029
16699
|
return /*#__PURE__*/jsx(Tab$1, {
|
|
17030
16700
|
style: {
|
|
@@ -17086,20 +16756,20 @@ function ProductCreator (_ref) {
|
|
|
17086
16756
|
}), tab == 'RENDERJOBLEGACY' && /*#__PURE__*/jsx(RenderJobTableLegacy, {
|
|
17087
16757
|
variantData: validVariantData,
|
|
17088
16758
|
baseData: state.baseData,
|
|
17089
|
-
configuration: configurationData === null || configurationData === void 0 || (_configurationData$
|
|
16759
|
+
configuration: configurationData === null || configurationData === void 0 || (_configurationData$Pr6 = configurationData.ProductCreator) === null || _configurationData$Pr6 === void 0 || (_configurationData$Pr6 = _configurationData$Pr6.renderjobs) === null || _configurationData$Pr6 === void 0 ? void 0 : _configurationData$Pr6.ambienteSelection,
|
|
17090
16760
|
basketData: currentBasket,
|
|
17091
16761
|
onSave: save,
|
|
17092
16762
|
saved: !isNew,
|
|
17093
16763
|
onError: setError,
|
|
17094
16764
|
children: !(state !== null && state !== void 0 && (_state$baseData$custo3 = state.baseData.customData) !== null && _state$baseData$custo3 !== void 0 && (_state$baseData$custo3 = _state$baseData$custo3.SMArticleId) !== null && _state$baseData$custo3 !== void 0 && _state$baseData$custo3.value) && ButtonsElement
|
|
17095
|
-
}), (configurationData === null || configurationData === void 0 || (_configurationData$
|
|
16765
|
+
}), (configurationData === null || configurationData === void 0 || (_configurationData$Pr7 = configurationData.ProductCreator) === null || _configurationData$Pr7 === void 0 ? void 0 : _configurationData$Pr7.renderjobs) && tab == 'RENDERJOB' && /*#__PURE__*/jsx(RenderJobTable, {
|
|
17096
16766
|
variantData: validVariantData,
|
|
17097
16767
|
baseData: state.baseData,
|
|
17098
16768
|
basketData: currentBasket,
|
|
17099
16769
|
onSave: save,
|
|
17100
16770
|
saved: !isNew,
|
|
17101
16771
|
onError: setError,
|
|
17102
|
-
config: configurationData === null || configurationData === void 0 || (_configurationData$
|
|
16772
|
+
config: configurationData === null || configurationData === void 0 || (_configurationData$Pr8 = configurationData.ProductCreator) === null || _configurationData$Pr8 === void 0 ? void 0 : _configurationData$Pr8.renderjobs
|
|
17103
16773
|
}), tab == 'MEDIA' && /*#__PURE__*/jsx(MediaTable, {
|
|
17104
16774
|
variantData: validVariantData,
|
|
17105
16775
|
baseData: state.baseData,
|
|
@@ -17124,7 +16794,7 @@ function ProductCreator (_ref) {
|
|
|
17124
16794
|
isBaseConfig: customFormData ? true : false,
|
|
17125
16795
|
children: ButtonsElement
|
|
17126
16796
|
}), tab == 'CLASS' && /*#__PURE__*/jsx(ClassificationDataForm, {
|
|
17127
|
-
orderDescription: currentBasket.OrderSets[0].VariantDescription,
|
|
16797
|
+
orderDescription: (_currentBasket$OrderS = currentBasket === null || currentBasket === void 0 ? void 0 : currentBasket.OrderSets[0].VariantDescription) !== null && _currentBasket$OrderS !== void 0 ? _currentBasket$OrderS : state.baseData.technicalDescription,
|
|
17128
16798
|
classificationData: state === null || state === void 0 ? void 0 : state.classificationData,
|
|
17129
16799
|
classificationFields: state === null || state === void 0 ? void 0 : state.classificationFields,
|
|
17130
16800
|
updateClassification: updateClassifications,
|
|
@@ -17440,7 +17110,6 @@ function ModuleComponent(_ref) {
|
|
|
17440
17110
|
activeDivaNr = _ref.activeDivaNr,
|
|
17441
17111
|
activeBasket = _ref.activeBasket,
|
|
17442
17112
|
activeAccountId = _ref.activeAccountId,
|
|
17443
|
-
editedBasket = _ref.editedBasket,
|
|
17444
17113
|
checkBasket = _ref.checkBasket;
|
|
17445
17114
|
var _useSellerState2 = useSellerState(),
|
|
17446
17115
|
configurationData = _useSellerState2.state.configurationData;
|
|
@@ -17481,9 +17150,7 @@ function ModuleComponent(_ref) {
|
|
|
17481
17150
|
case 'PCreator':
|
|
17482
17151
|
return /*#__PURE__*/jsx(ProductCreator, {
|
|
17483
17152
|
basket: activeBasket,
|
|
17484
|
-
divaNr: activeDivaNr
|
|
17485
|
-
checkBasket: checkBasket,
|
|
17486
|
-
editedBasket: editedBasket
|
|
17153
|
+
divaNr: activeDivaNr
|
|
17487
17154
|
});
|
|
17488
17155
|
default:
|
|
17489
17156
|
throw Error("Unknown Module: ".concat(activeModule));
|
|
@@ -17579,7 +17246,6 @@ var Main = function Main(_ref) {
|
|
|
17579
17246
|
activeCollectionId: parameters === null || parameters === void 0 ? void 0 : parameters.collectionId,
|
|
17580
17247
|
activeDivaNr: (parameters === null || parameters === void 0 ? void 0 : parameters.DivaNR) || (parameters === null || parameters === void 0 ? void 0 : parameters.divaNr) || (parameters === null || parameters === void 0 ? void 0 : parameters.divanr),
|
|
17581
17248
|
activeBasket: internal === null || internal === void 0 ? void 0 : internal.basketData,
|
|
17582
|
-
editedBasket: internal === null || internal === void 0 ? void 0 : internal.edited,
|
|
17583
17249
|
activeAccountId: parameters === null || parameters === void 0 ? void 0 : parameters.accountId,
|
|
17584
17250
|
checkBasket: parameters === null || parameters === void 0 ? void 0 : parameters.check
|
|
17585
17251
|
})
|