thm-p3-configurator 0.0.445 → 0.0.447
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/dist/public/assets/images/logo-th-icon.png +0 -0
- package/dist/public/assets/images/logo-th-primary.png +0 -0
- package/dist/public/assets/images/logo-thl-icon.png +0 -0
- package/dist/public/assets/images/logo-thl-primary.png +0 -0
- package/dist/public/assets/images/logo-wb-icon.png +0 -0
- package/dist/public/assets/images/logo-wb-primary.png +0 -0
- package/dist/src/shared/__components__/Header.js +47 -3
- package/dist/src/shared/__containers__/ProductsCartOverview.js +5 -5
- package/dist/src/shared/__containers__/ProductsOverview.js +3 -1
- package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +99 -16
- package/dist/src/shared/__containers__/internal/OrderTypeSelectorModal.js +8 -0
- package/dist/src/shared/__helpers__/__tests__/product.test.js +11 -0
- package/dist/src/shared/__helpers__/__tests__/singleOrderBranchSelector.test.js +64 -0
- package/dist/src/shared/__helpers__/__tests__/singleOrderWebshop.test.js +17 -0
- package/dist/src/shared/__helpers__/index.js +18 -1
- package/dist/src/shared/__helpers__/product.js +30 -14
- package/dist/src/shared/__helpers__/singleOrderArticles.js +27 -15
- package/dist/src/shared/__helpers__/singleOrderBranchSelector.js +57 -2
- package/dist/src/shared/__helpers__/singleOrderCustomerDetails.js +1 -1
- package/dist/src/shared/__helpers__/singleOrderWebshop.js +46 -0
- package/dist/src/shared/__hooks__/useBranchTheme.js +12 -1
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +5 -4
- package/dist/src/shared/__style__/_variables-external.scss +6 -0
- package/dist/src/shared/__style__/_variables.scss +6 -0
- package/dist/src/shared/__style__/components/card/_card-horizontal.scss +6 -0
- package/dist/src/shared/__style__/configurator/_configurator.scss +100 -0
- package/package.json +1 -1
- package/dist/src/shared/__components__/LocationsSelector/LocationClusteredTreeMarkers.js +0 -247
- package/dist/src/shared/__components__/LocationsSelector/LocationDetails.js +0 -295
- package/dist/src/shared/__components__/LocationsSelector/LocationInfo.js +0 -140
- package/dist/src/shared/__components__/LocationsSelector/LocationList.js +0 -190
- package/dist/src/shared/__components__/LocationsSelector/LocationListItem.js +0 -116
- package/dist/src/shared/__components__/LocationsSelector/LocationTreeMarker.js +0 -97
- package/dist/src/shared/__components__/LocationsSelector/index.js +0 -156
- package/dist/src/shared/__components__/Modal.js +0 -78
- package/dist/src/shared/__components__/Navbar.js +0 -82
- package/dist/src/shared/__components__/NavigationSteps.js +0 -143
- package/dist/src/shared/__components__/Pagination.js +0 -53
- package/dist/src/shared/__components__/ProductCard/ProductCardCheckbox.js +0 -38
- package/dist/src/shared/__components__/ProductCard/ProductCardDescription.js +0 -84
- package/dist/src/shared/__components__/ProductCard/ProductCardDiscountAlert.js +0 -57
- package/dist/src/shared/__components__/ProductCard/ProductCardImage.js +0 -28
- package/dist/src/shared/__components__/ProductCard/ProductCardPrice.js +0 -37
- package/dist/src/shared/__components__/ProductCard/ProductCardRibbon.js +0 -28
- package/dist/src/shared/__components__/ProductCard/ProductCardSpecifications.js +0 -77
- package/dist/src/shared/__components__/ProductCard/ProductCardUsps.js +0 -82
- package/dist/src/shared/__components__/ProductCard/index.js +0 -228
- package/dist/src/shared/__components__/ProductTable/ProductTableEditableRow.js +0 -66
- package/dist/src/shared/__components__/ProductTable/ProductTableHead.js +0 -32
- package/dist/src/shared/__components__/ProductTable/ProductTableSection.js +0 -25
- package/dist/src/shared/__components__/ProductTable/ProductTableSectionTotal.js +0 -46
- package/dist/src/shared/__components__/ProductTable/ProductTableStaticRow.js +0 -47
- package/dist/src/shared/__components__/ProductTable/ProductTableTotal.js +0 -41
- package/dist/src/shared/__components__/ProductTable/index.js +0 -127
- package/dist/src/shared/__components__/SingleOrderCartCard.js +0 -85
- package/dist/src/shared/__components__/SingleOrderProductCard.js +0 -387
- package/dist/src/shared/__components__/Spinners/FullPageSpinner.js +0 -73
- package/dist/src/shared/__components__/Spinners/InlineSpinner.js +0 -26
- package/dist/src/shared/__components__/Spinners/TextSpinner.js +0 -31
- package/dist/src/shared/__components__/UspsList.js +0 -27
- package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +0 -1090
- package/dist/src/shared/__constants__/__tests__/index.test.js +0 -38
- package/dist/src/shared/__constants__/cartTable.js +0 -35
- package/dist/src/shared/__constants__/cookiebot.js +0 -7
- package/dist/src/shared/__constants__/index.js +0 -398
- package/dist/src/shared/__constants__/sentry.js +0 -20
- package/dist/src/shared/__containers__/ANWBMembershipInput.js +0 -170
- package/dist/src/shared/__containers__/AppointmentForm.js +0 -551
- package/dist/src/shared/__containers__/BoardComputerCard.js +0 -139
- package/dist/src/shared/__containers__/BottomNavigationBar.js +0 -185
- package/dist/src/shared/__containers__/DiscountProductsSelector.js +0 -151
- package/dist/src/shared/__containers__/ExitIntentModal.js +0 -428
- package/dist/src/shared/__containers__/ExtraProductsOverview.js +0 -202
- package/dist/src/shared/__containers__/LicensePlateForm.js +0 -177
- package/dist/src/shared/__containers__/ManualSelectionForm.js +0 -277
- package/dist/src/shared/__containers__/ProductCartSide.js +0 -374
- package/dist/src/shared/__containers__/ProductDiscountCard.js +0 -169
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,6 +9,9 @@ var _logoPrimaryIcon = _interopRequireDefault(require("../../../public/assets/im
|
|
|
9
9
|
var _logoThcWhite = _interopRequireDefault(require("../../../public/assets/images/logo-thc-white.svg"));
|
|
10
10
|
var _logoTmgPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-tmg-primary.png"));
|
|
11
11
|
var _tmLogo = _interopRequireDefault(require("../../../public/assets/images/tm-logo.png"));
|
|
12
|
+
var _logoWbPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-wb-primary.png"));
|
|
13
|
+
var _logoThlPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-thl-primary.png"));
|
|
14
|
+
var _logoThPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-th-primary.png"));
|
|
12
15
|
var _constants__ = require("../__constants__");
|
|
13
16
|
var _helpers__ = require("../__helpers__");
|
|
14
17
|
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
@@ -17,12 +20,53 @@ function _interopRequireDefault(e) {
|
|
|
17
20
|
default: e
|
|
18
21
|
};
|
|
19
22
|
}
|
|
23
|
+
const getHeaderLogo = theme => {
|
|
24
|
+
switch (theme) {
|
|
25
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotive:
|
|
26
|
+
return {
|
|
27
|
+
src: _tmLogo.default,
|
|
28
|
+
alt: 'TowMotive'
|
|
29
|
+
};
|
|
30
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum:
|
|
31
|
+
return {
|
|
32
|
+
src: _logoThcWhite.default,
|
|
33
|
+
alt: 'Trekhaakcentrum'
|
|
34
|
+
};
|
|
35
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup:
|
|
36
|
+
return {
|
|
37
|
+
src: _logoTmgPrimary.default,
|
|
38
|
+
alt: 'TowMotive Group'
|
|
39
|
+
};
|
|
40
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.WestfaliaBenelux:
|
|
41
|
+
return {
|
|
42
|
+
src: _logoWbPrimary.default,
|
|
43
|
+
alt: 'Westfalia Benelux'
|
|
44
|
+
};
|
|
45
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakland:
|
|
46
|
+
return {
|
|
47
|
+
src: _logoThlPrimary.default,
|
|
48
|
+
alt: 'Trekhaakland'
|
|
49
|
+
};
|
|
50
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaken:
|
|
51
|
+
return {
|
|
52
|
+
src: _logoThPrimary.default,
|
|
53
|
+
alt: 'Trekhaken.nl'
|
|
54
|
+
};
|
|
55
|
+
default:
|
|
56
|
+
return {
|
|
57
|
+
src: _logoPrimaryIcon.default,
|
|
58
|
+
alt: 'Trekhaak Montage'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
20
62
|
const Header = _ref => {
|
|
21
63
|
let {
|
|
22
64
|
title,
|
|
23
65
|
subtitle = ''
|
|
24
66
|
} = _ref;
|
|
25
67
|
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
68
|
+
const headerLogo = getHeaderLogo(theme);
|
|
69
|
+
const isWebshopTheme = theme === _constants__.BRANCH_THEME_BY_FORMULA.WestfaliaBenelux || theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakland || theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaken;
|
|
26
70
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
71
|
className: (0, _helpers__.withStyle)("hero hero--offset")
|
|
28
72
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -32,9 +76,9 @@ const Header = _ref => {
|
|
|
32
76
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
77
|
className: (0, _helpers__.withStyle)('col hero__logo-container')
|
|
34
78
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
35
|
-
className: (0, _helpers__.withStyle)("hero__logo ".concat(theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? 'hero__logo--tmg' : '')),
|
|
36
|
-
src:
|
|
37
|
-
alt:
|
|
79
|
+
className: (0, _helpers__.withStyle)("hero__logo ".concat(theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? 'hero__logo--tmg' : '', " ").concat(isWebshopTheme ? 'hero__logo--webshop' : '')),
|
|
80
|
+
src: headerLogo.src,
|
|
81
|
+
alt: headerLogo.alt
|
|
38
82
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
39
83
|
className: (0, _helpers__.withStyle)('hero__inner d-none d-lg-block')
|
|
40
84
|
}, /*#__PURE__*/_react.default.createElement("h2", null, (title === null || title === void 0 ? void 0 : title.length) > 0 ? title : 'Trekhaak offerte opstellen'), (subtitle === null || subtitle === void 0 ? void 0 : subtitle.length) > 0 && /*#__PURE__*/_react.default.createElement("p", {
|
|
@@ -280,7 +280,8 @@ const ProductCartTable = () => {
|
|
|
280
280
|
touchedConsumerDiscounts,
|
|
281
281
|
montageRate,
|
|
282
282
|
isMontageTariffFixed,
|
|
283
|
-
extraPriceAmount
|
|
283
|
+
extraPriceAmount,
|
|
284
|
+
skipFilters
|
|
284
285
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
285
286
|
|
|
286
287
|
// Determine display mode
|
|
@@ -354,10 +355,9 @@ const ProductCartTable = () => {
|
|
|
354
355
|
consumerDiscounts,
|
|
355
356
|
touchedConsumerDiscounts
|
|
356
357
|
});
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
|
|
360
|
-
const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput) || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
|
|
358
|
+
// Use the session skipFilters so this query matches the product page's;
|
|
359
|
+
// an unfiltered request can return a different catalogue than the page.
|
|
360
|
+
const shouldRequestUnfilteredProducts = skipFilters || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
|
|
361
361
|
const durationAnswerForQuery = durationAnswerIsPrefilled ? undefined : durationAnswer;
|
|
362
362
|
const {
|
|
363
363
|
cart,
|
|
@@ -456,6 +456,7 @@ const ProductsOverview = () => {
|
|
|
456
456
|
})
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
|
+
const towbarOrientation = !APP_CONFIG.internal && (productCategory === _constants__.PRODUCT_CATEGORIES.TOWBAR || productCategory === _constants__.PRODUCT_CATEGORIES.COMBISET) ? (0, _product.getDetachableTowbarOrientation)(product === null || product === void 0 ? void 0 : product.subgroupName) : null;
|
|
459
460
|
return /*#__PURE__*/_react.default.createElement(_ProductCard.default, {
|
|
460
461
|
isTmg: isTmg,
|
|
461
462
|
stock: (_product$consumerPric = product === null || product === void 0 || (_product$consumerPric2 = product.consumerPrices) === null || _product$consumerPric2 === void 0 ? void 0 : _product$consumerPric2.stock) !== null && _product$consumerPric !== void 0 ? _product$consumerPric : product === null || product === void 0 || (_product$locationPric = product.locationPrices) === null || _product$locationPric === void 0 ? void 0 : _product$locationPric.stock,
|
|
@@ -463,7 +464,8 @@ const ProductsOverview = () => {
|
|
|
463
464
|
hasCheckbox: (productsPerCategory === null || productsPerCategory === void 0 ? void 0 : productsPerCategory.length) > 1,
|
|
464
465
|
isRecommended: isRecommended,
|
|
465
466
|
productId: product === null || product === void 0 ? void 0 : product.articleNumber,
|
|
466
|
-
productTitle: product === null || product === void 0 ? void 0 : product.subgroupName,
|
|
467
|
+
productTitle: towbarOrientation ? (0, _product.getTowbarInfoTitle)(product === null || product === void 0 ? void 0 : product.subgroupName) : product === null || product === void 0 ? void 0 : product.subgroupName,
|
|
468
|
+
productOrientation: towbarOrientation,
|
|
467
469
|
productDescription: product === null || product === void 0 ? void 0 : product.productDescription,
|
|
468
470
|
productUsps: [{
|
|
469
471
|
type: 'excl',
|
|
@@ -30,6 +30,7 @@ var _DropdownInput = _interopRequireDefault(require("../../__components__/Form/D
|
|
|
30
30
|
var _Modal = _interopRequireDefault(require("../../__components__/Modal"));
|
|
31
31
|
var _FullPageSpinner = _interopRequireDefault(require("../../__components__/Spinners/FullPageSpinner"));
|
|
32
32
|
var _constants__ = require("../../__constants__");
|
|
33
|
+
var _singleOrderWebshop = require("../../__helpers__/singleOrderWebshop");
|
|
33
34
|
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
34
35
|
var _OrderSessionContext = require("../../__context__/OrderSessionContext");
|
|
35
36
|
var _helpers__ = require("../../__helpers__");
|
|
@@ -209,6 +210,15 @@ const SingleOrderModalContent = _ref6 => {
|
|
|
209
210
|
} = (0, _queries.useBranchTypes)();
|
|
210
211
|
const [singleOrderBranchType, setSingleOrderBranchType] = (0, _react.useState)();
|
|
211
212
|
const [selectedBranchId, setLocalBranchId] = (0, _react.useState)();
|
|
213
|
+
const normalizedFormula = (0, _constants__.getConfiguratorFormulaCode)(formula);
|
|
214
|
+
const shouldShowBranchTypeSelector = (0, _singleOrderBranchSelector.shouldShowSingleOrderBranchTypeSelector)({
|
|
215
|
+
isTmgOrganization: isTMGOrganization,
|
|
216
|
+
formula: normalizedFormula
|
|
217
|
+
});
|
|
218
|
+
const previousDependenciesRef = (0, _react.useRef)({
|
|
219
|
+
formula: normalizedFormula,
|
|
220
|
+
branchTypeId: singleOrderBranchType
|
|
221
|
+
});
|
|
212
222
|
const {
|
|
213
223
|
singleOrderBranchTypes,
|
|
214
224
|
isLoadingSingleOrderBranchTypes
|
|
@@ -217,17 +227,41 @@ const SingleOrderModalContent = _ref6 => {
|
|
|
217
227
|
singleOrderBranches,
|
|
218
228
|
isLoadingSingleOrderBranches
|
|
219
229
|
} = (0, _queries.useSingleOrderBranchesQuery)({
|
|
220
|
-
branchTypeId:
|
|
221
|
-
|
|
230
|
+
branchTypeId: (0, _singleOrderBranchSelector.getSingleOrderBranchTypeId)({
|
|
231
|
+
isTmgOrganization: isTMGOrganization,
|
|
232
|
+
formula: normalizedFormula,
|
|
233
|
+
selectedBranchTypeId: singleOrderBranchType
|
|
234
|
+
}),
|
|
235
|
+
formula: normalizedFormula,
|
|
222
236
|
limit: 500,
|
|
223
237
|
offset: 0
|
|
224
238
|
});
|
|
225
|
-
|
|
239
|
+
(0, _react.useEffect)(() => {
|
|
240
|
+
const previousDependencies = previousDependenciesRef.current;
|
|
241
|
+
if ((0, _singleOrderBranchSelector.shouldResetSingleOrderBranchSelection)({
|
|
242
|
+
previousFormula: previousDependencies.formula,
|
|
243
|
+
formula: normalizedFormula,
|
|
244
|
+
previousBranchTypeId: previousDependencies.branchTypeId,
|
|
245
|
+
branchTypeId: singleOrderBranchType
|
|
246
|
+
})) {
|
|
247
|
+
setSelectedBranchId(undefined);
|
|
248
|
+
setLocalBranchId(undefined);
|
|
249
|
+
dispatch({
|
|
250
|
+
type: _OrderSessionContext.orderSessionActions.SET_SINGLE_ORDER_FORMULA_CODE,
|
|
251
|
+
payload: {
|
|
252
|
+
formulaCode: null
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
previousDependenciesRef.current = {
|
|
257
|
+
formula: normalizedFormula,
|
|
258
|
+
branchTypeId: singleOrderBranchType
|
|
259
|
+
};
|
|
260
|
+
}, [dispatch, normalizedFormula, setSelectedBranchId, singleOrderBranchType]);
|
|
226
261
|
const filteredBranches = _react.default.useMemo(() => {
|
|
227
|
-
if (
|
|
262
|
+
if (normalizedFormula === _constants__.CONFIGURATOR_FORMULAS.TMG || !singleOrderBranches) {
|
|
228
263
|
return singleOrderBranches;
|
|
229
264
|
}
|
|
230
|
-
const normalizedFormula = (0, _constants__.getConfiguratorFormulaCode)(formula);
|
|
231
265
|
return singleOrderBranches.filter(branch => {
|
|
232
266
|
var _ref7, _branch$formulaCode, _branch$formule;
|
|
233
267
|
const branchFormula = (0, _constants__.getConfiguratorFormulaCode)((_ref7 = (_branch$formulaCode = branch === null || branch === void 0 ? void 0 : branch.formulaCode) !== null && _branch$formulaCode !== void 0 ? _branch$formulaCode : branch === null || branch === void 0 || (_branch$formule = branch.formule) === null || _branch$formule === void 0 ? void 0 : _branch$formule.code) !== null && _ref7 !== void 0 ? _ref7 : branch === null || branch === void 0 ? void 0 : branch.formule);
|
|
@@ -236,23 +270,23 @@ const SingleOrderModalContent = _ref6 => {
|
|
|
236
270
|
}
|
|
237
271
|
return branchFormula === normalizedFormula;
|
|
238
272
|
});
|
|
239
|
-
}, [singleOrderBranches,
|
|
273
|
+
}, [singleOrderBranches, normalizedFormula]);
|
|
240
274
|
const branchIdWithFormulaCode = new Map();
|
|
241
275
|
filteredBranches === null || filteredBranches === void 0 || filteredBranches.forEach(branch => {
|
|
242
276
|
var _getConfiguratorFormu, _ref8, _branch$formulaCode2, _branch$formule2;
|
|
243
|
-
branchIdWithFormulaCode.set(branch === null || branch === void 0 ? void 0 : branch.entityId, (_getConfiguratorFormu = (0, _constants__.getConfiguratorFormulaCode)((_ref8 = (_branch$formulaCode2 = branch === null || branch === void 0 ? void 0 : branch.formulaCode) !== null && _branch$formulaCode2 !== void 0 ? _branch$formulaCode2 : branch === null || branch === void 0 || (_branch$formule2 = branch.formule) === null || _branch$formule2 === void 0 ? void 0 : _branch$formule2.code) !== null && _ref8 !== void 0 ? _ref8 : branch === null || branch === void 0 ? void 0 : branch.formule)) !== null && _getConfiguratorFormu !== void 0 ? _getConfiguratorFormu :
|
|
277
|
+
branchIdWithFormulaCode.set(branch === null || branch === void 0 ? void 0 : branch.entityId, (_getConfiguratorFormu = (0, _constants__.getConfiguratorFormulaCode)((_ref8 = (_branch$formulaCode2 = branch === null || branch === void 0 ? void 0 : branch.formulaCode) !== null && _branch$formulaCode2 !== void 0 ? _branch$formulaCode2 : branch === null || branch === void 0 || (_branch$formule2 = branch.formule) === null || _branch$formule2 === void 0 ? void 0 : _branch$formule2.code) !== null && _ref8 !== void 0 ? _ref8 : branch === null || branch === void 0 ? void 0 : branch.formule)) !== null && _getConfiguratorFormu !== void 0 ? _getConfiguratorFormu : normalizedFormula);
|
|
244
278
|
});
|
|
245
279
|
const branchOptions = filteredBranches === null || filteredBranches === void 0 ? void 0 : filteredBranches.map(branch => ({
|
|
246
|
-
label:
|
|
280
|
+
label: (0, _singleOrderBranchSelector.getSingleOrderBranchOptionLabel)(branch),
|
|
247
281
|
value: branch === null || branch === void 0 ? void 0 : branch.entityId
|
|
248
282
|
}));
|
|
249
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
283
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, shouldShowBranchTypeSelector && /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
|
|
250
284
|
options: singleOrderBranchTypes === null || singleOrderBranchTypes === void 0 ? void 0 : singleOrderBranchTypes.map(branchType => ({
|
|
251
285
|
label: branchType === null || branchType === void 0 ? void 0 : branchType.title,
|
|
252
286
|
value: branchType === null || branchType === void 0 ? void 0 : branchType.entityId
|
|
253
287
|
})),
|
|
254
|
-
name: "
|
|
255
|
-
label: "
|
|
288
|
+
name: "branchType",
|
|
289
|
+
label: "Organisatietype:",
|
|
256
290
|
isRequired: true,
|
|
257
291
|
isLoading: isLoadingSingleOrderBranchTypes,
|
|
258
292
|
noOptionsMessage: "Geen opties beschikbaar",
|
|
@@ -260,14 +294,13 @@ const SingleOrderModalContent = _ref6 => {
|
|
|
260
294
|
initialValue: singleOrderBranchType,
|
|
261
295
|
onChange: _ref9 => {
|
|
262
296
|
let {
|
|
263
|
-
label,
|
|
264
297
|
value
|
|
265
298
|
} = _ref9;
|
|
266
299
|
setSingleOrderBranchType(value);
|
|
267
300
|
setSelectedBranchId(undefined);
|
|
268
301
|
setLocalBranchId(undefined);
|
|
269
302
|
}
|
|
270
|
-
}), (
|
|
303
|
+
}), (!shouldShowBranchTypeSelector || singleOrderBranchType) && /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
|
|
271
304
|
options: branchOptions,
|
|
272
305
|
name: "branch",
|
|
273
306
|
label: "Vestiging:",
|
|
@@ -312,6 +345,7 @@ const InternalBranchSelectorModal = () => {
|
|
|
312
345
|
const [isDismissed, setIsDismissed] = (0, _react.useState)(false);
|
|
313
346
|
const isSingleOrderPage = (0, _useIsSingleOrder.default)();
|
|
314
347
|
const formula = (0, _FormulaContext.useFormula)();
|
|
348
|
+
const previousFormulaRef = (0, _react.useRef)(formula);
|
|
315
349
|
const isTMGOrganization = (0, _useIsTmg.useIsTmg)();
|
|
316
350
|
(0, _react.useEffect)(() => {
|
|
317
351
|
_setSelectedBranchId(undefined);
|
|
@@ -321,12 +355,36 @@ const InternalBranchSelectorModal = () => {
|
|
|
321
355
|
selectedBranch,
|
|
322
356
|
existingDossierId,
|
|
323
357
|
orderType,
|
|
358
|
+
webshop,
|
|
324
359
|
licensePlate,
|
|
325
360
|
model,
|
|
326
361
|
singleOrderFlowRevision
|
|
327
362
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
363
|
+
const defaultWebshop = (0, _singleOrderWebshop.getWebshopForFormula)(formula);
|
|
328
364
|
const previousSelectedBranchRef = (0, _react.useRef)(selectedBranch);
|
|
329
365
|
const previousLocationKeyRef = (0, _react.useRef)(location.key);
|
|
366
|
+
(0, _react.useEffect)(() => {
|
|
367
|
+
if ((0, _singleOrderBranchSelector.shouldResetSingleOrderBranchSelection)({
|
|
368
|
+
previousFormula: previousFormulaRef.current,
|
|
369
|
+
formula
|
|
370
|
+
})) {
|
|
371
|
+
_setSelectedBranchId(undefined);
|
|
372
|
+
setIsDismissed(false);
|
|
373
|
+
dispatch({
|
|
374
|
+
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_BRANCH,
|
|
375
|
+
payload: {
|
|
376
|
+
branchId: null
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
dispatch({
|
|
380
|
+
type: _OrderSessionContext.orderSessionActions.SET_SINGLE_ORDER_FORMULA_CODE,
|
|
381
|
+
payload: {
|
|
382
|
+
formulaCode: null
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
previousFormulaRef.current = formula;
|
|
387
|
+
}, [dispatch, formula]);
|
|
330
388
|
const {
|
|
331
389
|
myBranches,
|
|
332
390
|
isLoadingMyBranches
|
|
@@ -334,6 +392,26 @@ const InternalBranchSelectorModal = () => {
|
|
|
334
392
|
const {
|
|
335
393
|
branchById
|
|
336
394
|
} = (0, _queries.useBranchByIdOrWidgetId)(selectedBranch);
|
|
395
|
+
(0, _react.useEffect)(() => {
|
|
396
|
+
if (!isSingleOrderPage || !defaultWebshop) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (webshop === defaultWebshop && orderType === _OrderTypeSelectorModal.ORDER_TYPES.ONLINE) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
dispatch({
|
|
403
|
+
type: _OrderSessionContext.orderSessionActions.SET_WEBSHOP,
|
|
404
|
+
payload: {
|
|
405
|
+
webshop: defaultWebshop
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
dispatch({
|
|
409
|
+
type: _OrderSessionContext.orderSessionActions.SET_ORDER_TYPE,
|
|
410
|
+
payload: {
|
|
411
|
+
orderType: _OrderTypeSelectorModal.ORDER_TYPES.ONLINE
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}, [defaultWebshop, dispatch, isSingleOrderPage, orderType, webshop]);
|
|
337
415
|
const shouldResolveMyBranchesBeforeOpening = APP_CONFIG.internal && !selectedBranch && !existingDossierId && !isSingleOrderPage && !isTMGOrganization && !isDismissed;
|
|
338
416
|
const shouldAutoSelectSingleMyBranch = shouldResolveMyBranchesBeforeOpening && !isLoadingMyBranches && (myBranches === null || myBranches === void 0 ? void 0 : myBranches.length) === 1;
|
|
339
417
|
const shouldWaitForMyBranchResolution = shouldResolveMyBranchesBeforeOpening && (isLoadingMyBranches || shouldAutoSelectSingleMyBranch);
|
|
@@ -391,7 +469,12 @@ const InternalBranchSelectorModal = () => {
|
|
|
391
469
|
}
|
|
392
470
|
});
|
|
393
471
|
};
|
|
394
|
-
const shouldShowModalForSingleOrder = APP_CONFIG.internal &&
|
|
472
|
+
const shouldShowModalForSingleOrder = APP_CONFIG.internal && (0, _singleOrderBranchSelector.shouldOpenSingleOrderCustomerSelector)({
|
|
473
|
+
isSingleOrderPage,
|
|
474
|
+
selectedBranch,
|
|
475
|
+
existingDossierId,
|
|
476
|
+
isDismissed
|
|
477
|
+
});
|
|
395
478
|
const shouldShowModalForOtherPages = APP_CONFIG.internal && !selectedBranch && !existingDossierId && !isSingleOrderPage && !isTMGOrganization && !shouldWaitForMyBranchResolution && !isDismissed;
|
|
396
479
|
|
|
397
480
|
// Show loading state only when we actually need to show the modal
|
|
@@ -418,13 +501,13 @@ const InternalBranchSelectorModal = () => {
|
|
|
418
501
|
className: "ms-3"
|
|
419
502
|
}, "Vestigingen laden..."));
|
|
420
503
|
}
|
|
421
|
-
if ((shouldShowModalForSingleOrder || shouldShowModalForOtherPages) && isTMGOrganization && formula === _constants__.CONFIGURATOR_FORMULAS.TMG && !orderType) {
|
|
504
|
+
if ((shouldShowModalForSingleOrder || shouldShowModalForOtherPages) && isTMGOrganization && formula === _constants__.CONFIGURATOR_FORMULAS.TMG && !orderType && !defaultWebshop) {
|
|
422
505
|
return /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorModal.default, {
|
|
423
506
|
isOpen: true
|
|
424
507
|
});
|
|
425
508
|
}
|
|
426
509
|
return /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
427
|
-
isOpen:
|
|
510
|
+
isOpen: shouldShowModalForSingleOrder || shouldShowModalForOtherPages,
|
|
428
511
|
title: 'Kies een vestiging:',
|
|
429
512
|
size: "wide",
|
|
430
513
|
hasSecondaryButton: false,
|
|
@@ -47,6 +47,7 @@ const ORDER_TYPES = exports.ORDER_TYPES = {
|
|
|
47
47
|
OFFLINE: 'offline'
|
|
48
48
|
};
|
|
49
49
|
const WEBSHOPS = exports.WEBSHOPS = {
|
|
50
|
+
WESTFALIA_BENELUX: 'Westfalia Benelux',
|
|
50
51
|
TREKHAAKLAND: 'Trekhaakland',
|
|
51
52
|
TREKHAKEN_NL: 'Trekhaken.nl'
|
|
52
53
|
};
|
|
@@ -112,6 +113,13 @@ const OrderTypeSelectorModal = _ref => {
|
|
|
112
113
|
},
|
|
113
114
|
onClick: () => handleTypeSelect(ORDER_TYPES.OFFLINE)
|
|
114
115
|
}, "Offline order")), step === 'webshop' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
116
|
+
type: "button",
|
|
117
|
+
className: (0, _helpers__.withStyle)('btn btn-outline-primary btn-lg w-100 d-flex align-items-center justify-content-center p-4'),
|
|
118
|
+
style: {
|
|
119
|
+
minHeight: '80px'
|
|
120
|
+
},
|
|
121
|
+
onClick: () => handleWebshopSelect(WEBSHOPS.WESTFALIA_BENELUX)
|
|
122
|
+
}, "Westfalia Benelux"), /*#__PURE__*/_react.default.createElement("button", {
|
|
115
123
|
type: "button",
|
|
116
124
|
className: (0, _helpers__.withStyle)('btn btn-outline-primary btn-lg w-100 d-flex align-items-center justify-content-center p-4'),
|
|
117
125
|
style: {
|
|
@@ -46,4 +46,15 @@ describe('product helpers', () => {
|
|
|
46
46
|
expect(result.priceInclVat).toBe(189);
|
|
47
47
|
expect(result.priceExclVat).toBeCloseTo(156.2, 2);
|
|
48
48
|
});
|
|
49
|
+
});
|
|
50
|
+
describe('getDetachableTowbarOrientation', () => {
|
|
51
|
+
it('returns horizontaal or verticaal for detachable towbars', () => {
|
|
52
|
+
expect((0, _product.getDetachableTowbarOrientation)('Trekhaken horizontaal afneembaar')).toBe('horizontaal');
|
|
53
|
+
expect((0, _product.getDetachableTowbarOrientation)('Trekhaken verticaal afneembaar')).toBe('verticaal');
|
|
54
|
+
});
|
|
55
|
+
it('does not infer a type for other hitch names', () => {
|
|
56
|
+
expect((0, _product.getDetachableTowbarOrientation)('Afneembare trekhaak')).toBeNull();
|
|
57
|
+
expect((0, _product.getDetachableTowbarOrientation)('Trekhaken vast')).toBeNull();
|
|
58
|
+
expect((0, _product.getDetachableTowbarOrientation)('')).toBeNull();
|
|
59
|
+
});
|
|
49
60
|
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _singleOrderBranchSelector = require("../singleOrderBranchSelector");
|
|
4
|
+
var _constants__ = require("../../__constants__");
|
|
5
|
+
describe('single-order branch selector helpers', () => {
|
|
6
|
+
it.each([_constants__.CONFIGURATOR_FORMULAS.TMG, _constants__.CONFIGURATOR_FORMULAS.WB, _constants__.CONFIGURATOR_FORMULAS.THL, _constants__.CONFIGURATOR_FORMULAS.TH])('shows dependent organization types for TMG formula %s', formula => {
|
|
7
|
+
expect((0, _singleOrderBranchSelector.shouldShowSingleOrderBranchTypeSelector)({
|
|
8
|
+
isTmgOrganization: true,
|
|
9
|
+
formula
|
|
10
|
+
})).toBe(true);
|
|
11
|
+
expect((0, _singleOrderBranchSelector.getSingleOrderBranchTypeId)({
|
|
12
|
+
isTmgOrganization: true,
|
|
13
|
+
formula,
|
|
14
|
+
selectedBranchTypeId: 'type-id'
|
|
15
|
+
})).toBe('type-id');
|
|
16
|
+
});
|
|
17
|
+
it('still opens the two-field customer picker for webshop formulas', () => {
|
|
18
|
+
expect((0, _singleOrderBranchSelector.shouldOpenSingleOrderCustomerSelector)({
|
|
19
|
+
isSingleOrderPage: true,
|
|
20
|
+
selectedBranch: null,
|
|
21
|
+
existingDossierId: null,
|
|
22
|
+
isDismissed: false
|
|
23
|
+
})).toBe(true);
|
|
24
|
+
expect((0, _singleOrderBranchSelector.shouldOpenSingleOrderCustomerSelector)({
|
|
25
|
+
isSingleOrderPage: true,
|
|
26
|
+
selectedBranch: 'branch-id',
|
|
27
|
+
existingDossierId: null,
|
|
28
|
+
isDismissed: false
|
|
29
|
+
})).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
it('keeps the fixed branch type for non-TMG organizations', () => {
|
|
32
|
+
expect((0, _singleOrderBranchSelector.getSingleOrderBranchTypeId)({
|
|
33
|
+
isTmgOrganization: false,
|
|
34
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.WB,
|
|
35
|
+
selectedBranchTypeId: 'type-id'
|
|
36
|
+
})).toBe(_constants__.VESTIGING_TYPE_ID);
|
|
37
|
+
});
|
|
38
|
+
it('resets a branch when its formula or organization type changes', () => {
|
|
39
|
+
expect((0, _singleOrderBranchSelector.shouldResetSingleOrderBranchSelection)({
|
|
40
|
+
previousFormula: _constants__.CONFIGURATOR_FORMULAS.WB,
|
|
41
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.THL,
|
|
42
|
+
previousBranchTypeId: 'webshop',
|
|
43
|
+
branchTypeId: 'webshop'
|
|
44
|
+
})).toBe(true);
|
|
45
|
+
expect((0, _singleOrderBranchSelector.shouldResetSingleOrderBranchSelection)({
|
|
46
|
+
previousFormula: _constants__.CONFIGURATOR_FORMULAS.WB,
|
|
47
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.WB,
|
|
48
|
+
previousBranchTypeId: 'webshop',
|
|
49
|
+
branchTypeId: 'customer'
|
|
50
|
+
})).toBe(true);
|
|
51
|
+
expect((0, _singleOrderBranchSelector.shouldResetSingleOrderBranchSelection)({
|
|
52
|
+
previousFormula: 'Westfalia Benelux',
|
|
53
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.WB,
|
|
54
|
+
previousBranchTypeId: 'webshop',
|
|
55
|
+
branchTypeId: 'webshop'
|
|
56
|
+
})).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
it('formats branch options as branch name followed by organization name', () => {
|
|
59
|
+
expect((0, _singleOrderBranchSelector.getSingleOrderBranchOptionLabel)({
|
|
60
|
+
naamVestiging: 'Rotterdam',
|
|
61
|
+
name: 'Voorbeeld B.V.'
|
|
62
|
+
})).toBe('Rotterdam - Voorbeeld B.V.');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _constants__ = require("../../__constants__");
|
|
4
|
+
var _singleOrderWebshop = require("../singleOrderWebshop");
|
|
5
|
+
describe('single-order webshop helpers', () => {
|
|
6
|
+
it.each([[_constants__.CONFIGURATOR_FORMULAS.WB, _singleOrderWebshop.WEBSHOPS.WESTFALIA_BENELUX], ['Westfalia Benelux', _singleOrderWebshop.WEBSHOPS.WESTFALIA_BENELUX], [_constants__.CONFIGURATOR_FORMULAS.THL, _singleOrderWebshop.WEBSHOPS.TREKHAAKLAND], ['Trekhaakland', _singleOrderWebshop.WEBSHOPS.TREKHAAKLAND], [_constants__.CONFIGURATOR_FORMULAS.TH, _singleOrderWebshop.WEBSHOPS.TREKHAKEN_NL], ['Trekhaken.nl', _singleOrderWebshop.WEBSHOPS.TREKHAKEN_NL], [_constants__.CONFIGURATOR_FORMULAS.TMG, null]])('maps formula %s to webshop %s', (formula, webshop) => {
|
|
7
|
+
expect((0, _singleOrderWebshop.getWebshopForFormula)(formula)).toBe(webshop);
|
|
8
|
+
});
|
|
9
|
+
it.each([['Westfalia Benelux', _constants__.CONFIGURATOR_FORMULAS.WB], ['westfalia trekhaken', _constants__.CONFIGURATOR_FORMULAS.WB], ['Trekhaakland', _constants__.CONFIGURATOR_FORMULAS.THL], ['Trekhaken.nl', _constants__.CONFIGURATOR_FORMULAS.TH], ['trekhaken', _constants__.CONFIGURATOR_FORMULAS.TH]])('maps webshop %s back to formula %s', (webshop, formula) => {
|
|
10
|
+
expect((0, _singleOrderWebshop.getSingleOrderFormulaForWebshop)(webshop)).toBe(formula);
|
|
11
|
+
});
|
|
12
|
+
it('uses Shopify only for Trekhaakland and Trekhaken.nl', () => {
|
|
13
|
+
expect((0, _singleOrderWebshop.isShopifyWebshop)(_singleOrderWebshop.WEBSHOPS.TREKHAAKLAND)).toBe(true);
|
|
14
|
+
expect((0, _singleOrderWebshop.isShopifyWebshop)(_singleOrderWebshop.WEBSHOPS.TREKHAKEN_NL)).toBe(true);
|
|
15
|
+
expect((0, _singleOrderWebshop.isShopifyWebshop)(_singleOrderWebshop.WEBSHOPS.WESTFALIA_BENELUX)).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -150,6 +150,12 @@ const getConfiguratorThemeClass = theme => {
|
|
|
150
150
|
return 'tm';
|
|
151
151
|
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup:
|
|
152
152
|
return 'tmg';
|
|
153
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.WestfaliaBenelux:
|
|
154
|
+
return 'wb';
|
|
155
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakland:
|
|
156
|
+
return 'thl';
|
|
157
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaken:
|
|
158
|
+
return 'th';
|
|
153
159
|
default:
|
|
154
160
|
return '';
|
|
155
161
|
}
|
|
@@ -161,8 +167,13 @@ const getConfiguratorThemeClassByFormula = formula => {
|
|
|
161
167
|
return 'thc';
|
|
162
168
|
case _constants__.CONFIGURATOR_FORMULAS.TMG:
|
|
163
169
|
return 'tmg';
|
|
164
|
-
case _constants__.CONFIGURATOR_FORMULAS.
|
|
170
|
+
case _constants__.CONFIGURATOR_FORMULAS.WB:
|
|
171
|
+
return 'wb';
|
|
172
|
+
case _constants__.CONFIGURATOR_FORMULAS.THL:
|
|
173
|
+
return 'thl';
|
|
165
174
|
case _constants__.CONFIGURATOR_FORMULAS.TH:
|
|
175
|
+
return 'th';
|
|
176
|
+
case _constants__.CONFIGURATOR_FORMULAS.TOW:
|
|
166
177
|
case _constants__.CONFIGURATOR_FORMULAS.TowMotive:
|
|
167
178
|
return 'tm';
|
|
168
179
|
default:
|
|
@@ -179,6 +190,12 @@ const getConfiguratorButtonVariant = exports.getConfiguratorButtonVariant = func
|
|
|
179
190
|
return outline ? 'outline-tm-primary' : 'tm-primary';
|
|
180
191
|
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup:
|
|
181
192
|
return outline ? 'outline-tmg-primary' : 'tmg-primary';
|
|
193
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.WestfaliaBenelux:
|
|
194
|
+
return outline ? 'outline-wb-primary' : 'wb-primary';
|
|
195
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakland:
|
|
196
|
+
return outline ? 'outline-thl-primary' : 'thl-primary';
|
|
197
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaken:
|
|
198
|
+
return outline ? 'outline-th-primary' : 'th-primary';
|
|
182
199
|
default:
|
|
183
200
|
return outline ? 'outline-primary' : 'primary';
|
|
184
201
|
}
|
|
@@ -9,12 +9,11 @@ require("core-js/modules/esnext.iterator.filter.js");
|
|
|
9
9
|
require("core-js/modules/esnext.iterator.flat-map.js");
|
|
10
10
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
11
11
|
require("core-js/modules/esnext.iterator.map.js");
|
|
12
|
-
require("core-js/modules/esnext.iterator.some.js");
|
|
13
12
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
14
13
|
Object.defineProperty(exports, "__esModule", {
|
|
15
14
|
value: true
|
|
16
15
|
});
|
|
17
|
-
exports.validateCartInput = exports.shouldSelectBoardComputerUpdate = exports.
|
|
16
|
+
exports.validateCartInput = exports.shouldSelectBoardComputerUpdate = exports.resolveSingleOrderArticlePrices = exports.parseProductSpecifications = exports.getTowbarInfoTitle = exports.getEffectiveBoardComputerSelection = exports.getDetachableTowbarOrientation = exports.formatHyperDescription = exports.extractProductSpecsArray = exports.checkIfTowbarIsRecommended = exports.buildCartInput = void 0;
|
|
18
17
|
require("core-js/modules/es.array.flat-map.js");
|
|
19
18
|
require("core-js/modules/es.array.includes.js");
|
|
20
19
|
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
@@ -24,7 +23,6 @@ require("core-js/modules/esnext.iterator.filter.js");
|
|
|
24
23
|
require("core-js/modules/esnext.iterator.flat-map.js");
|
|
25
24
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
26
25
|
require("core-js/modules/esnext.iterator.map.js");
|
|
27
|
-
require("core-js/modules/esnext.iterator.some.js");
|
|
28
26
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
29
27
|
var _constants__ = require("../__constants__");
|
|
30
28
|
function ownKeys(e, r) {
|
|
@@ -98,16 +96,6 @@ const validateCartInput = exports.validateCartInput = function validateCartInput
|
|
|
98
96
|
}
|
|
99
97
|
return;
|
|
100
98
|
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* @description Cart overviews resolve selected articles from the order article lists.
|
|
104
|
-
* If the user selected an article that only appears with skipFilters enabled,
|
|
105
|
-
* those read-only lookups must request the unfiltered product list too.
|
|
106
|
-
*/
|
|
107
|
-
const shouldRequestUnfilteredProductsForCart = exports.shouldRequestUnfilteredProductsForCart = function shouldRequestUnfilteredProductsForCart() {
|
|
108
|
-
let cart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
109
|
-
return Array.isArray(cart) && cart.some(lineItem => (lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber) != null);
|
|
110
|
-
};
|
|
111
99
|
const getEffectiveBoardComputerSelection = exports.getEffectiveBoardComputerSelection = function getEffectiveBoardComputerSelection() {
|
|
112
100
|
var _ref3;
|
|
113
101
|
let {
|
|
@@ -227,11 +215,39 @@ const checkIfTowbarIsRecommended = _ref8 => {
|
|
|
227
215
|
} = _ref8;
|
|
228
216
|
return category === _constants__.PRODUCT_CATEGORIES.TOWBAR && ((product === null || product === void 0 ? void 0 : product.subgroupName.toLowerCase().includes('afneembaar')) || (product === null || product === void 0 || (_product$subgroupName = product.subgroupName) === null || _product$subgroupName === void 0 ? void 0 : _product$subgroupName.toLowerCase().includes('afneembare')));
|
|
229
217
|
};
|
|
218
|
+
exports.checkIfTowbarIsRecommended = checkIfTowbarIsRecommended;
|
|
219
|
+
const getTowbarInfoTitle = title => {
|
|
220
|
+
const lower = (title || '').toLowerCase();
|
|
221
|
+
if (lower.includes('afneemba')) {
|
|
222
|
+
return 'Afneembare trekhaak';
|
|
223
|
+
}
|
|
224
|
+
if (lower.includes('wegklapba') || lower.includes('wegdraai')) {
|
|
225
|
+
return 'Wegklapbare trekhaak';
|
|
226
|
+
}
|
|
227
|
+
if (lower.includes('vast')) {
|
|
228
|
+
return 'Vaste trekhaak';
|
|
229
|
+
}
|
|
230
|
+
return title;
|
|
231
|
+
};
|
|
232
|
+
exports.getTowbarInfoTitle = getTowbarInfoTitle;
|
|
233
|
+
const getDetachableTowbarOrientation = title => {
|
|
234
|
+
const lower = (title || '').toLowerCase();
|
|
235
|
+
if (!lower.includes('afneemba')) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
if (lower.includes('horizontaal')) {
|
|
239
|
+
return 'horizontaal';
|
|
240
|
+
}
|
|
241
|
+
if (lower.includes('verticaal')) {
|
|
242
|
+
return 'verticaal';
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
245
|
+
};
|
|
230
246
|
|
|
231
247
|
/**
|
|
232
248
|
* @description Formats the description of a product
|
|
233
249
|
*/
|
|
234
|
-
exports.
|
|
250
|
+
exports.getDetachableTowbarOrientation = getDetachableTowbarOrientation;
|
|
235
251
|
const formatHyperDescription = description => {
|
|
236
252
|
return description === null || description === void 0 ? void 0 : description.ops.map(phrase => phrase.insert).join('');
|
|
237
253
|
};
|