@crystaldesign/diva-seller 24.15.0-rc.8 → 24.15.0
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
CHANGED
|
@@ -11043,7 +11043,7 @@ function useProductState (basket, divaNr) {
|
|
|
11043
11043
|
}, [updateCategoriesInternal, state]);
|
|
11044
11044
|
var save = /*#__PURE__*/function () {
|
|
11045
11045
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
11046
|
-
var _state$classification, data, params, _productHandler$close, _productHandler$close2, _productHandler$close3, savedProducts;
|
|
11046
|
+
var _state$classification, data, params, _productHandler$close, _savedProducts, _productHandler$close2, _productHandler$close3, savedProducts;
|
|
11047
11047
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
11048
11048
|
while (1) switch (_context2.prev = _context2.next) {
|
|
11049
11049
|
case 0:
|
|
@@ -11083,7 +11083,7 @@ function useProductState (basket, divaNr) {
|
|
|
11083
11083
|
data = _context2.sent;
|
|
11084
11084
|
setIsNew(false);
|
|
11085
11085
|
if (!(originProductId || sendProductsToExternalService)) {
|
|
11086
|
-
_context2.next =
|
|
11086
|
+
_context2.next = 35;
|
|
11087
11087
|
break;
|
|
11088
11088
|
}
|
|
11089
11089
|
params = {
|
|
@@ -11092,49 +11092,50 @@ function useProductState (basket, divaNr) {
|
|
|
11092
11092
|
parentProductId: originProductId ? originProductId : undefined
|
|
11093
11093
|
};
|
|
11094
11094
|
if (!(clientArticleHandler !== null && clientArticleHandler !== void 0 && clientArticleHandler.clientArticleService)) {
|
|
11095
|
-
_context2.next =
|
|
11095
|
+
_context2.next = 30;
|
|
11096
11096
|
break;
|
|
11097
11097
|
}
|
|
11098
11098
|
_context2.prev = 11;
|
|
11099
11099
|
_context2.next = 14;
|
|
11100
11100
|
return clientArticleHandler.saveProductsSMArticles(params, clientArticleHandler.clientArticleService, organization._id);
|
|
11101
11101
|
case 14:
|
|
11102
|
+
_savedProducts = _context2.sent;
|
|
11102
11103
|
(_productHandler$close = productHandler.closeModal) === null || _productHandler$close === void 0 || _productHandler$close.call(productHandler);
|
|
11103
|
-
_context2.next =
|
|
11104
|
-
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket,
|
|
11105
|
-
case
|
|
11104
|
+
_context2.next = 18;
|
|
11105
|
+
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket, _savedProducts);
|
|
11106
|
+
case 18:
|
|
11106
11107
|
if (originProductId) clearOriginProductId();
|
|
11107
11108
|
return _context2.abrupt("return", true);
|
|
11108
|
-
case
|
|
11109
|
-
_context2.prev =
|
|
11109
|
+
case 22:
|
|
11110
|
+
_context2.prev = 22;
|
|
11110
11111
|
_context2.t0 = _context2["catch"](11);
|
|
11111
11112
|
(_productHandler$close2 = productHandler.closeModal) === null || _productHandler$close2 === void 0 || _productHandler$close2.call(productHandler);
|
|
11112
|
-
_context2.next =
|
|
11113
|
+
_context2.next = 27;
|
|
11113
11114
|
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket);
|
|
11114
|
-
case 26:
|
|
11115
|
-
throw new Error(_context2.t0.message);
|
|
11116
11115
|
case 27:
|
|
11117
|
-
_context2.
|
|
11116
|
+
throw new Error(_context2.t0.message);
|
|
11117
|
+
case 28:
|
|
11118
|
+
_context2.next = 35;
|
|
11118
11119
|
break;
|
|
11119
|
-
case
|
|
11120
|
+
case 30:
|
|
11120
11121
|
(_productHandler$close3 = productHandler.closeModal) === null || _productHandler$close3 === void 0 || _productHandler$close3.call(productHandler);
|
|
11121
11122
|
if (originProductId) clearOriginProductId();
|
|
11122
11123
|
LOG$2.error(new DivaError("Articles cannot be saved - ClientArticleService or JWT not set"));
|
|
11123
11124
|
setError(t('modal.general_error') + ' ' + t('modal.errorcode') + ':' + DivaUtils.getCurrentTraceId() + ' ' + DivaUtils.formatDate(new Date(), true, undefined, true));
|
|
11124
11125
|
return _context2.abrupt("return", false);
|
|
11125
|
-
case
|
|
11126
|
-
_context2.next =
|
|
11126
|
+
case 35:
|
|
11127
|
+
_context2.next = 37;
|
|
11127
11128
|
return productHandler.saveProducts(_objectSpread$4(_objectSpread$4({}, data), {}, {
|
|
11128
11129
|
awaitPDF: undefined
|
|
11129
11130
|
}));
|
|
11130
|
-
case
|
|
11131
|
+
case 37:
|
|
11131
11132
|
savedProducts = _context2.sent;
|
|
11132
|
-
_context2.next =
|
|
11133
|
+
_context2.next = 40;
|
|
11133
11134
|
return reset(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket, savedProducts);
|
|
11134
|
-
case
|
|
11135
|
+
case 40:
|
|
11135
11136
|
return _context2.abrupt("return", true);
|
|
11136
|
-
case
|
|
11137
|
-
_context2.prev =
|
|
11137
|
+
case 43:
|
|
11138
|
+
_context2.prev = 43;
|
|
11138
11139
|
_context2.t1 = _context2["catch"](2);
|
|
11139
11140
|
LOG$2.error(new DivaError("Error saving product", {
|
|
11140
11141
|
code: 'PROD_0002',
|
|
@@ -11146,7 +11147,7 @@ function useProductState (basket, divaNr) {
|
|
|
11146
11147
|
setError(t('modal.general_error') + ' ' + t('modal.errorcode') + ':' + DivaUtils.getCurrentTraceId() + ' ' + DivaUtils.formatDate(new Date(), true, undefined, true));
|
|
11147
11148
|
}
|
|
11148
11149
|
if (!_context2.t1.message.includes('PRODSM_0001')) {
|
|
11149
|
-
_context2.next =
|
|
11150
|
+
_context2.next = 52;
|
|
11150
11151
|
break;
|
|
11151
11152
|
}
|
|
11152
11153
|
openModal({
|
|
@@ -11155,18 +11156,18 @@ function useProductState (basket, divaNr) {
|
|
|
11155
11156
|
accept: true
|
|
11156
11157
|
});
|
|
11157
11158
|
return _context2.abrupt("return", false);
|
|
11158
|
-
case
|
|
11159
|
+
case 52:
|
|
11159
11160
|
openModal({
|
|
11160
11161
|
title: t('errorcodes._source.labels.error.SELLER_0002'),
|
|
11161
11162
|
text: t('grid.error'),
|
|
11162
11163
|
accept: true
|
|
11163
11164
|
});
|
|
11164
11165
|
return _context2.abrupt("return", false);
|
|
11165
|
-
case
|
|
11166
|
+
case 54:
|
|
11166
11167
|
case "end":
|
|
11167
11168
|
return _context2.stop();
|
|
11168
11169
|
}
|
|
11169
|
-
}, _callee2, null, [[2,
|
|
11170
|
+
}, _callee2, null, [[2, 43], [11, 22]]);
|
|
11170
11171
|
}));
|
|
11171
11172
|
return function save() {
|
|
11172
11173
|
return _ref.apply(this, arguments);
|
|
@@ -11658,6 +11659,8 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
|
|
|
11658
11659
|
} else if (field == 'percentageDiscount' && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === 0) {
|
|
11659
11660
|
finalVariant[field] = 0;
|
|
11660
11661
|
newModified[field] = variant[field] !== 0;
|
|
11662
|
+
} else if ((field == 'percentageDiscount' || field == 'discountedPrice') && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === variant[field]) {
|
|
11663
|
+
continue;
|
|
11661
11664
|
} else if (field == 'addedPrice' || field == 'calculatedPrice') {
|
|
11662
11665
|
var _currentState$modifie;
|
|
11663
11666
|
var _ProductHandler$calcu = ProductHandler.calculateComputedValue(variant[field], newVariant === null || newVariant === void 0 ? void 0 : newVariant[field], currentState.baseData[field], (_currentState$modifie = currentState.modified.variantData[_i]) === null || _currentState$modifie === void 0 ? void 0 : _currentState$modifie[field]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProductState.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ProductCreator/hooks/useProductState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,WAAW,EACX,KAAK,EAGN,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,KAAK,EAAE,aAAa,EAAyC,MAAM,gCAAgC,CAAC;AAKlJ,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAK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lE9F,WAAW;kCAaX,GAAG;2BAcH,GAAG,EAAE;wBAQL,QAAQ,EAAE,aAAa,MAAM,EAAE;wBAQ/B,KAAK,aAAa,MAAM,EAAE;sBAQ1B,MAAM,MAAM,MAAM,cAAc,OAAO,cAAc,MAAM;4BAQ3D,MAAM,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,SAAS;;qBAgIlC,UAAU,gBAAgB,GAAG,EAAE;yBApLb;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE;;EAoZxF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-seller",
|
|
3
|
-
"version": "24.15.0
|
|
3
|
+
"version": "24.15.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"react-dom": "^18.3.1"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@crystaldesign/analytics": "24.15.0
|
|
33
|
-
"@crystaldesign/products-component": "24.15.0
|
|
34
|
-
"@crystaldesign/real-time-viewer": "24.15.0
|
|
32
|
+
"@crystaldesign/analytics": "24.15.0",
|
|
33
|
+
"@crystaldesign/products-component": "24.15.0",
|
|
34
|
+
"@crystaldesign/real-time-viewer": "24.15.0",
|
|
35
35
|
"@emotion/react": "^11.4.1",
|
|
36
36
|
"@emotion/styled": "^11.3.0",
|
|
37
37
|
"@mui/icons-material": "^6.1.5",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
},
|
|
44
44
|
"types": "./build/types/seller/src/index.d.ts",
|
|
45
45
|
"module": "build/esm/index.js",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "c278d5e4544907ea74555b4eecb863ebab7c1fac"
|
|
47
47
|
}
|