thm-p3-configurator 0.0.150 → 0.0.152
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 && !selectedCombiset) {
|
|
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:
|
|
@@ -225,7 +232,6 @@ const ProductsOverview = () => {
|
|
|
225
232
|
|
|
226
233
|
// Filter out Extras category from products object
|
|
227
234
|
delete products[_constants__.PRODUCT_CATEGORIES.EXTRAS];
|
|
228
|
-
console.log(selectedBoardComputer, selectedCableset, selectedCombiset, selectedTowbar);
|
|
229
235
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isTmg && /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
230
236
|
name: 'skipFilters',
|
|
231
237
|
initialValue: skipFilters,
|
|
@@ -241,7 +247,7 @@ const ProductsOverview = () => {
|
|
|
241
247
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
242
248
|
className: (0, _helpers__.withStyle)(index === 0 ? 'mt-0' : 'mt-5'),
|
|
243
249
|
key: "category-".concat(productCategory)
|
|
244
|
-
}, /*#__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)({
|
|
245
251
|
product: a,
|
|
246
252
|
category: productCategory
|
|
247
253
|
}) ? -1 : 0).map(product => {
|
|
@@ -250,9 +256,6 @@ const ProductsOverview = () => {
|
|
|
250
256
|
product,
|
|
251
257
|
category: productCategory
|
|
252
258
|
});
|
|
253
|
-
|
|
254
|
-
// Check if another product within the same category has already been selected
|
|
255
|
-
const isAnotherProductSelected = productsPerCategory.some(otherProduct => [selectedCableset, selectedCombiset, selectedTowbar].includes(otherProduct.articleNumber) && otherProduct.articleNumber !== product.articleNumber);
|
|
256
259
|
if (productCategory === _constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER && selectedCableset) {
|
|
257
260
|
return /*#__PURE__*/_react.default.createElement(_BoardComputerCard.default, {
|
|
258
261
|
defaultSelected: selectedBoardComputer === product.articleNumber,
|