thm-p3-configurator 0.0.151 → 0.0.153
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.
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.array.includes.js");
|
|
5
4
|
require("core-js/modules/es.array.sort.js");
|
|
6
5
|
require("core-js/modules/es.json.stringify.js");
|
|
7
|
-
require("core-js/modules/es.string.includes.js");
|
|
8
6
|
require("core-js/modules/es.weak-map.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
10
7
|
require("core-js/modules/esnext.iterator.map.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.some.js");
|
|
12
8
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
9
|
require("core-js/modules/es.weak-map.js");
|
|
14
10
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -16,13 +12,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
12
|
});
|
|
17
13
|
exports.default = void 0;
|
|
18
14
|
require("core-js/modules/es.symbol.description.js");
|
|
19
|
-
require("core-js/modules/es.array.includes.js");
|
|
20
15
|
require("core-js/modules/es.array.sort.js");
|
|
21
16
|
require("core-js/modules/es.json.stringify.js");
|
|
22
|
-
require("core-js/modules/es.string.includes.js");
|
|
23
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
24
17
|
require("core-js/modules/esnext.iterator.map.js");
|
|
25
|
-
require("core-js/modules/esnext.iterator.some.js");
|
|
26
18
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
27
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
28
20
|
var _reactRouter = require("react-router");
|
|
@@ -156,6 +148,21 @@ const ProductsOverview = () => {
|
|
|
156
148
|
towbarId: isSelected ? productId : null
|
|
157
149
|
}
|
|
158
150
|
});
|
|
151
|
+
|
|
152
|
+
// Auto-select kabelset if towbar is selected and no kabelset is currently selected
|
|
153
|
+
if (isSelected && !selectedCableset) {
|
|
154
|
+
var _products$PRODUCT_CAT;
|
|
155
|
+
// Check if there's exactly one kabelset available
|
|
156
|
+
if (((_products$PRODUCT_CAT = products[_constants__.PRODUCT_CATEGORIES.CABLESET]) === null || _products$PRODUCT_CAT === void 0 ? void 0 : _products$PRODUCT_CAT.length) === 1) {
|
|
157
|
+
const kabelsetId = products[_constants__.PRODUCT_CATEGORIES.CABLESET][0].articleNumber;
|
|
158
|
+
dispatch({
|
|
159
|
+
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_CABLESET,
|
|
160
|
+
payload: {
|
|
161
|
+
cabelsetId: kabelsetId
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
159
166
|
break;
|
|
160
167
|
}
|
|
161
168
|
case _constants__.PRODUCT_CATEGORIES.CABLESET:
|
|
@@ -240,7 +247,7 @@ const ProductsOverview = () => {
|
|
|
240
247
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
241
248
|
className: (0, _helpers__.withStyle)(index === 0 ? 'mt-0' : 'mt-5'),
|
|
242
249
|
key: "category-".concat(productCategory)
|
|
243
|
-
}, /*#__PURE__*/_react.default.createElement("h2", null, productCategory), productsPerCategory.sort((a, b) => (0, _product.checkIfTowbarIsRecommended)({
|
|
250
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, productCategory === _constants__.PRODUCT_CATEGORIES.CABLESET ? 'Altijd inbegrepen bij een montage' : productCategory), productsPerCategory.sort((a, b) => (0, _product.checkIfTowbarIsRecommended)({
|
|
244
251
|
product: a,
|
|
245
252
|
category: productCategory
|
|
246
253
|
}) ? -1 : 0).map(product => {
|
|
@@ -249,9 +256,6 @@ const ProductsOverview = () => {
|
|
|
249
256
|
product,
|
|
250
257
|
category: productCategory
|
|
251
258
|
});
|
|
252
|
-
|
|
253
|
-
// Check if another product within the same category has already been selected
|
|
254
|
-
const isAnotherProductSelected = productsPerCategory.some(otherProduct => [selectedCableset, selectedCombiset, selectedTowbar].includes(otherProduct.articleNumber) && otherProduct.articleNumber !== product.articleNumber);
|
|
255
259
|
if (productCategory === _constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER && selectedCableset) {
|
|
256
260
|
return /*#__PURE__*/_react.default.createElement(_BoardComputerCard.default, {
|
|
257
261
|
defaultSelected: selectedBoardComputer === product.articleNumber,
|