thm-p3-configurator 0.0.368 → 0.0.370
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/src/shared/__containers__/QuotationForm.js +85 -31
- package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +1 -0
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +1 -1
- package/dist/src/shared/__context__/OrderSessionContext.js +20 -9
- package/dist/src/shared/__helpers__/singleOrderArticles.js +15 -22
- package/dist/src/shared/__pages__/LicensePlatePage.js +2 -2
- package/dist/src/shared/__pages__/ManualSelectionPage.js +2 -2
- package/package.json +1 -1
- package/dist/src/shared/__components__/LocationsSelector/LocationDetails.js +0 -320
- package/dist/src/shared/__components__/LocationsSelector/LocationInfo.js +0 -140
- package/dist/src/shared/__components__/LocationsSelector/LocationList.js +0 -180
- package/dist/src/shared/__components__/LocationsSelector/LocationListItem.js +0 -115
- package/dist/src/shared/__components__/LocationsSelector/LocationTreeMarker.js +0 -97
- package/dist/src/shared/__components__/LocationsSelector/index.js +0 -162
- 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 -124
- 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 -78
- package/dist/src/shared/__components__/SingleOrderProductCard.js +0 -269
- 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 -995
- package/dist/src/shared/__constants__/__tests__/index.test.js +0 -20
- package/dist/src/shared/__constants__/cartTable.js +0 -32
- package/dist/src/shared/__constants__/cookiebot.js +0 -7
- package/dist/src/shared/__constants__/index.js +0 -379
- 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 -481
- package/dist/src/shared/__containers__/BoardComputerCard.js +0 -139
- package/dist/src/shared/__containers__/BottomNavigationBar.js +0 -182
- package/dist/src/shared/__containers__/DiscountProductsSelector.js +0 -149
- package/dist/src/shared/__containers__/ExitIntentModal.js +0 -346
- package/dist/src/shared/__containers__/ExtraProductsOverview.js +0 -251
- package/dist/src/shared/__containers__/LicensePlateForm.js +0 -187
- package/dist/src/shared/__containers__/ManualSelectionForm.js +0 -284
- package/dist/src/shared/__containers__/ProductCartSide.js +0 -356
- package/dist/src/shared/__containers__/ProductDiscountCard.js +0 -167
- package/dist/src/shared/__containers__/ProductsCartOverview.js +0 -903
- package/dist/src/shared/__containers__/ProductsOverview.js +0 -436
- package/dist/src/shared/__containers__/QuestionsForm.js +0 -532
|
@@ -190,6 +190,10 @@ const QuotationForm = () => {
|
|
|
190
190
|
action: 'submit',
|
|
191
191
|
action_value: 'valid'
|
|
192
192
|
});
|
|
193
|
+
(0, _Datalayer.pushToDataLayer)({
|
|
194
|
+
event: 'form_submit',
|
|
195
|
+
form_name: 'config_offerte'
|
|
196
|
+
});
|
|
193
197
|
await createQuotation((0, _helpers__.removeNullishProps)({
|
|
194
198
|
isExitIntent: false,
|
|
195
199
|
licensePlate,
|
|
@@ -316,12 +320,22 @@ const QuotationForm = () => {
|
|
|
316
320
|
placeholder: "",
|
|
317
321
|
initialValue: customer.infix,
|
|
318
322
|
name: "infix",
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
onFocus: () => trackFormField('tussenvoegsel', 'focus'),
|
|
324
|
+
onChange: value => {
|
|
325
|
+
trackInput({
|
|
326
|
+
event: 'form',
|
|
327
|
+
component: 'offerte',
|
|
328
|
+
element: 'text_field',
|
|
329
|
+
field: 'tussenvoegsel',
|
|
330
|
+
action: 'input'
|
|
331
|
+
});
|
|
332
|
+
dispatch({
|
|
333
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
|
|
334
|
+
payload: {
|
|
335
|
+
infix: value
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
},
|
|
325
339
|
isRequired: false,
|
|
326
340
|
form: "quotation",
|
|
327
341
|
label: "Tussenvoegsel:",
|
|
@@ -330,12 +344,22 @@ const QuotationForm = () => {
|
|
|
330
344
|
placeholder: "",
|
|
331
345
|
initialValue: customer.lastName,
|
|
332
346
|
name: "lastName",
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
onFocus: () => trackFormField('achternaam', 'focus'),
|
|
348
|
+
onChange: value => {
|
|
349
|
+
trackInput({
|
|
350
|
+
event: 'form',
|
|
351
|
+
component: 'offerte',
|
|
352
|
+
element: 'text_field',
|
|
353
|
+
field: 'achternaam',
|
|
354
|
+
action: 'input'
|
|
355
|
+
});
|
|
356
|
+
dispatch({
|
|
357
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
|
|
358
|
+
payload: {
|
|
359
|
+
lastName: value
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
},
|
|
339
363
|
isRequired: true,
|
|
340
364
|
form: "quotation",
|
|
341
365
|
label: "Achternaam:",
|
|
@@ -368,12 +392,22 @@ const QuotationForm = () => {
|
|
|
368
392
|
placeholder: "",
|
|
369
393
|
initialValue: customer.phoneNumber,
|
|
370
394
|
name: "phoneNumber",
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
395
|
+
onFocus: () => trackFormField('telefoonnummer', 'focus'),
|
|
396
|
+
onChange: value => {
|
|
397
|
+
trackInput({
|
|
398
|
+
event: 'form',
|
|
399
|
+
component: 'offerte',
|
|
400
|
+
element: 'text_field',
|
|
401
|
+
field: 'telefoonnummer',
|
|
402
|
+
action: 'input'
|
|
403
|
+
});
|
|
404
|
+
dispatch({
|
|
405
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
|
|
406
|
+
payload: {
|
|
407
|
+
phoneNumber: value
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
},
|
|
377
411
|
isRequired: true,
|
|
378
412
|
form: "quotation",
|
|
379
413
|
label: "Telefoonnummer:",
|
|
@@ -388,12 +422,22 @@ const QuotationForm = () => {
|
|
|
388
422
|
placeholder: "",
|
|
389
423
|
initialValue: customer.companyName,
|
|
390
424
|
name: "companyName",
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
425
|
+
onFocus: () => trackFormField('bedrijfsnaam', 'focus'),
|
|
426
|
+
onChange: value => {
|
|
427
|
+
trackInput({
|
|
428
|
+
event: 'form',
|
|
429
|
+
component: 'offerte',
|
|
430
|
+
element: 'text_field',
|
|
431
|
+
field: 'bedrijfsnaam',
|
|
432
|
+
action: 'input'
|
|
433
|
+
});
|
|
434
|
+
dispatch({
|
|
435
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
|
|
436
|
+
payload: {
|
|
437
|
+
companyName: value
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
},
|
|
397
441
|
isRequired: true,
|
|
398
442
|
form: "quotation",
|
|
399
443
|
label: "Bedrijfsnaam:",
|
|
@@ -402,12 +446,21 @@ const QuotationForm = () => {
|
|
|
402
446
|
placeholder: "",
|
|
403
447
|
initialValue: customer.note,
|
|
404
448
|
name: "note",
|
|
405
|
-
onChange: value =>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
449
|
+
onChange: value => {
|
|
450
|
+
trackInput({
|
|
451
|
+
event: 'form',
|
|
452
|
+
component: 'offerte',
|
|
453
|
+
element: 'text_field',
|
|
454
|
+
field: 'opmerkingen',
|
|
455
|
+
action: 'input'
|
|
456
|
+
});
|
|
457
|
+
dispatch({
|
|
458
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
|
|
459
|
+
payload: {
|
|
460
|
+
note: value
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
},
|
|
411
464
|
isRequired: false,
|
|
412
465
|
form: "quotation",
|
|
413
466
|
label: "Eventuele vragen of opmerkingen:",
|
|
@@ -421,8 +474,9 @@ const QuotationForm = () => {
|
|
|
421
474
|
event: 'form',
|
|
422
475
|
component: 'offerte',
|
|
423
476
|
element: 'checkbox',
|
|
477
|
+
field: 'algemene voorwaarden',
|
|
424
478
|
action: value ? 'on' : 'off',
|
|
425
|
-
action_value:
|
|
479
|
+
action_value: String(value)
|
|
426
480
|
});
|
|
427
481
|
setIsTermsAccepted(value);
|
|
428
482
|
},
|
|
@@ -212,6 +212,7 @@ const SingleOrderModalContent = _ref6 => {
|
|
|
212
212
|
isLoadingSingleOrderBranches
|
|
213
213
|
} = (0, _queries.useSingleOrderBranchesQuery)({
|
|
214
214
|
branchTypeId: formula === _constants__.CONFIGURATOR_FORMULAS.TMG ? singleOrderBranchType : _constants__.VESTIGING_TYPE_ID,
|
|
215
|
+
formula: (0, _constants__.getConfiguratorFormulaCode)(formula),
|
|
215
216
|
limit: 500,
|
|
216
217
|
offset: 0
|
|
217
218
|
});
|
|
@@ -144,7 +144,7 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
144
144
|
const stockQuantity = orderSession.webshop ? 0 : (_article$consumerPric = article === null || article === void 0 || (_article$consumerPric2 = article.consumerPrices) === null || _article$consumerPric2 === void 0 || (_article$consumerPric2 = _article$consumerPric2.stock) === null || _article$consumerPric2 === void 0 ? void 0 : _article$consumerPric2.quantity) !== null && _article$consumerPric !== void 0 ? _article$consumerPric : 0;
|
|
145
145
|
const apiStockStatus = article === null || article === void 0 || (_article$consumerPric3 = article.consumerPrices) === null || _article$consumerPric3 === void 0 || (_article$consumerPric3 = _article$consumerPric3.stock) === null || _article$consumerPric3 === void 0 ? void 0 : _article$consumerPric3.status;
|
|
146
146
|
const stockStatus = (0, _singleOrderArticles.mapApiStockStatusToStockStatus)(apiStockStatus);
|
|
147
|
-
const isOutOfStock = !orderSession.webshop &&
|
|
147
|
+
const isOutOfStock = !orderSession.webshop && stockStatus === _constants__.StockStatus.OutOfStock;
|
|
148
148
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
149
149
|
isTmg: isTmg,
|
|
150
150
|
branchId: selectedBranch,
|
|
@@ -1357,7 +1357,10 @@ const initializeOrderSession = function initializeOrderSession() {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
return cachedSession;
|
|
1359
1359
|
};
|
|
1360
|
-
const AuthSessionRuntimeSync =
|
|
1360
|
+
const AuthSessionRuntimeSync = _ref => {
|
|
1361
|
+
let {
|
|
1362
|
+
authMode = 'internal'
|
|
1363
|
+
} = _ref;
|
|
1361
1364
|
const {
|
|
1362
1365
|
authenticated,
|
|
1363
1366
|
initialized,
|
|
@@ -1370,25 +1373,26 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1370
1373
|
const formula = (0, _FormulaContext.useFormula)();
|
|
1371
1374
|
const lastSyncedContextRef = (0, _react.useRef)(null);
|
|
1372
1375
|
const authRuntime = (0, _AuthRuntimeContext.useAuthRuntime)();
|
|
1376
|
+
const isExternalAuthMode = authMode === 'external';
|
|
1373
1377
|
(0, _react.useLayoutEffect)(() => {
|
|
1374
|
-
var
|
|
1378
|
+
var _ref2;
|
|
1375
1379
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1376
1380
|
if (APP_CONFIG.internal) {
|
|
1377
1381
|
authRuntime.setSessionContextReady(false);
|
|
1378
1382
|
}
|
|
1379
1383
|
return;
|
|
1380
1384
|
}
|
|
1381
|
-
authRuntime.setActiveBranchId((
|
|
1385
|
+
authRuntime.setActiveBranchId((_ref2 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref2 !== void 0 ? _ref2 : null);
|
|
1382
1386
|
}, [authRuntime, initialized, selectedBranch, branch]);
|
|
1383
1387
|
(0, _react.useEffect)(() => {
|
|
1384
|
-
var
|
|
1388
|
+
var _ref3;
|
|
1385
1389
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1386
1390
|
if (APP_CONFIG.internal) {
|
|
1387
1391
|
authRuntime.setSessionContextReady(false);
|
|
1388
1392
|
}
|
|
1389
1393
|
return;
|
|
1390
1394
|
}
|
|
1391
|
-
const branchId = (
|
|
1395
|
+
const branchId = (_ref3 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref3 !== void 0 ? _ref3 : null;
|
|
1392
1396
|
if (!authenticated || !branchId || !formula) {
|
|
1393
1397
|
lastSyncedContextRef.current = null;
|
|
1394
1398
|
authRuntime.setSessionContextReady(false);
|
|
@@ -1404,6 +1408,11 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1404
1408
|
authRuntime.setSessionContextReady(true);
|
|
1405
1409
|
return;
|
|
1406
1410
|
}
|
|
1411
|
+
if (isExternalAuthMode) {
|
|
1412
|
+
lastSyncedContextRef.current = nextContextKey;
|
|
1413
|
+
authRuntime.setSessionContextReady(true);
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1407
1416
|
let isCancelled = false;
|
|
1408
1417
|
authRuntime.setSessionContextReady(false);
|
|
1409
1418
|
_authenticatedProxyApi.authenticatedProxyApi.putSessionContext({
|
|
@@ -1422,16 +1431,16 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1422
1431
|
return () => {
|
|
1423
1432
|
isCancelled = true;
|
|
1424
1433
|
};
|
|
1425
|
-
}, [authRuntime, authenticated, initialized, selectedBranch, branch, formula, module]);
|
|
1434
|
+
}, [authRuntime, authenticated, initialized, selectedBranch, branch, formula, module, isExternalAuthMode]);
|
|
1426
1435
|
return null;
|
|
1427
1436
|
};
|
|
1428
|
-
const OrderSessionController =
|
|
1437
|
+
const OrderSessionController = _ref4 => {
|
|
1429
1438
|
let {
|
|
1430
1439
|
children,
|
|
1431
1440
|
authMode = 'internal',
|
|
1432
1441
|
externalAuthSession = null,
|
|
1433
1442
|
externalAuthRuntime = null
|
|
1434
|
-
} =
|
|
1443
|
+
} = _ref4;
|
|
1435
1444
|
const isSingleOrderPage = (0, _useIsSingleOrder.default)();
|
|
1436
1445
|
const isExternalAuthMode = authMode === 'external' || Boolean(externalAuthSession);
|
|
1437
1446
|
const runtimeMode = isExternalAuthMode ? 'external' : 'internal';
|
|
@@ -1451,7 +1460,9 @@ const OrderSessionController = _ref3 => {
|
|
|
1451
1460
|
}, /*#__PURE__*/_react.default.createElement(_AuthSessionContext.AuthSessionProvider, {
|
|
1452
1461
|
authMode: runtimeMode,
|
|
1453
1462
|
externalAuthSession: externalAuthSession
|
|
1454
|
-
}, /*#__PURE__*/_react.default.createElement(AuthSessionRuntimeSync,
|
|
1463
|
+
}, /*#__PURE__*/_react.default.createElement(AuthSessionRuntimeSync, {
|
|
1464
|
+
authMode: runtimeMode
|
|
1465
|
+
}), children)));
|
|
1455
1466
|
};
|
|
1456
1467
|
exports.OrderSessionController = OrderSessionController;
|
|
1457
1468
|
const useOrderSession = () => {
|
|
@@ -232,7 +232,7 @@ const fetchArticlesByArticleNumbers = exports.fetchArticlesByArticleNumbers = as
|
|
|
232
232
|
* @param {Object} parts - The parts
|
|
233
233
|
*/
|
|
234
234
|
const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetchPartStockLevels(part, branchId) {
|
|
235
|
-
var _response$data$data;
|
|
235
|
+
var _response$data$data$c, _response$data$data, _response$data$data2;
|
|
236
236
|
let formula = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
237
237
|
const partParamsString = new URLSearchParams((0, _index.removeNullishProps)(_objectSpread(_objectSpread({
|
|
238
238
|
branchId
|
|
@@ -247,7 +247,7 @@ const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetch
|
|
|
247
247
|
if (!(response !== null && response !== void 0 && response.data)) {
|
|
248
248
|
throw new Error('No response from the API');
|
|
249
249
|
}
|
|
250
|
-
const stockLevel = (_response$data$data = response.data.data) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data.consumerPrices) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data[0]) === null || _response$data$data === void 0 ? void 0 : _response$data$data.stock;
|
|
250
|
+
const stockLevel = (_response$data$data$c = (_response$data$data = response.data.data) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data.consumerPrices) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data[0]) === null || _response$data$data === void 0 ? void 0 : _response$data$data.stock) !== null && _response$data$data$c !== void 0 ? _response$data$data$c : (_response$data$data2 = response.data.data) === null || _response$data$data2 === void 0 || (_response$data$data2 = _response$data$data2.locationPrices) === null || _response$data$data2 === void 0 || (_response$data$data2 = _response$data$data2[0]) === null || _response$data$data2 === void 0 ? void 0 : _response$data$data2.stock;
|
|
251
251
|
if (stockLevel) {
|
|
252
252
|
return _objectSpread(_objectSpread({}, stockLevel), {}, {
|
|
253
253
|
status: mapApiStockStatusToStockStatus(stockLevel.status)
|
|
@@ -271,11 +271,6 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
|
|
|
271
271
|
let brandRecords = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
272
272
|
return (_brandRecords$find = brandRecords.find(brand => brand.entityId === article.entityId)) !== null && _brandRecords$find !== void 0 ? _brandRecords$find : brandRecords.find(brand => brand.articleNumber === article.articleNumber);
|
|
273
273
|
};
|
|
274
|
-
const findPreferredPricePart = article => {
|
|
275
|
-
var _parts$find;
|
|
276
|
-
const parts = Array.isArray(article === null || article === void 0 ? void 0 : article.parts) ? article.parts : [];
|
|
277
|
-
return (_parts$find = parts.find(part => (part === null || part === void 0 ? void 0 : part.isPreferred) === true)) !== null && _parts$find !== void 0 ? _parts$find : parts.length === 1 ? parts[0] : null;
|
|
278
|
-
};
|
|
279
274
|
const articleNumbers = [...new Set(articles.map(article => article.articleNumber))];
|
|
280
275
|
const articleBrandQueryString = new URLSearchParams({
|
|
281
276
|
articleNumbers: JSON.stringify(articleNumbers)
|
|
@@ -286,14 +281,12 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
|
|
|
286
281
|
throw new Error('Failed to fetch the brands of the articles');
|
|
287
282
|
}
|
|
288
283
|
const articlesWithBrands = articles.map(article => {
|
|
289
|
-
var
|
|
284
|
+
var _brandData$brandNumbe;
|
|
290
285
|
const brandData = findBrandDataForArticle(article, brandResponse.data);
|
|
291
|
-
const
|
|
292
|
-
const pricingPartNumber = (_preferredPricePart$p = preferredPricePart === null || preferredPricePart === void 0 ? void 0 : preferredPricePart.partNumber) !== null && _preferredPricePart$p !== void 0 ? _preferredPricePart$p : article.articleNumber;
|
|
293
|
-
const resolvedBrandNumber = preferredPricePart ? (_ref3 = (_ref4 = (_preferredPricePart$p2 = preferredPricePart === null || preferredPricePart === void 0 ? void 0 : preferredPricePart.partBrandId) !== null && _preferredPricePart$p2 !== void 0 ? _preferredPricePart$p2 : brandData === null || brandData === void 0 ? void 0 : brandData.preferredPartBrandNumber) !== null && _ref4 !== void 0 ? _ref4 : brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _ref3 !== void 0 ? _ref3 : _index2.DEFAULT_ARTICLE_BRAND : (_ref5 = (_brandData$brandNumbe = brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _brandData$brandNumbe !== void 0 ? _brandData$brandNumbe : brandData === null || brandData === void 0 ? void 0 : brandData.preferredPartBrandNumber) !== null && _ref5 !== void 0 ? _ref5 : _index2.DEFAULT_ARTICLE_BRAND;
|
|
286
|
+
const resolvedBrandNumber = (_brandData$brandNumbe = brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _brandData$brandNumbe !== void 0 ? _brandData$brandNumbe : _index2.DEFAULT_ARTICLE_BRAND;
|
|
294
287
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
295
288
|
brand: resolvedBrandNumber,
|
|
296
|
-
pricingPartNumber
|
|
289
|
+
pricingPartNumber: article.articleNumber
|
|
297
290
|
});
|
|
298
291
|
}).filter(article => article.brand && article.pricingPartNumber);
|
|
299
292
|
const parts = [...new Map(articlesWithBrands.map(article => {
|
|
@@ -318,11 +311,11 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
|
|
|
318
311
|
consumer: Object.fromEntries(consumerPrices.map(price => [price.partNumber, price])),
|
|
319
312
|
location: Object.fromEntries(locationPrices.map(price => [price.partNumber, price]))
|
|
320
313
|
};
|
|
321
|
-
let currentArticles = articlesWithBrands.map(
|
|
314
|
+
let currentArticles = articlesWithBrands.map(_ref3 => {
|
|
322
315
|
let {
|
|
323
316
|
pricingPartNumber
|
|
324
|
-
} =
|
|
325
|
-
article = _objectWithoutProperties(
|
|
317
|
+
} = _ref3,
|
|
318
|
+
article = _objectWithoutProperties(_ref3, _excluded);
|
|
326
319
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
327
320
|
consumerPrices: pricesMap.consumer[pricingPartNumber],
|
|
328
321
|
locationPrices: pricesMap.location[pricingPartNumber]
|
|
@@ -331,10 +324,10 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
|
|
|
331
324
|
return currentArticles;
|
|
332
325
|
};
|
|
333
326
|
const formatModelArticle = article => {
|
|
334
|
-
var
|
|
327
|
+
var _ref4, _article$name, _ref5, _article$description$, _article$description, _article$boldDescript, _article$boldDescript2, _article$specificatio, _article$images, _article$images2, _article$articleNumbe;
|
|
335
328
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
336
|
-
name: (
|
|
337
|
-
description: (
|
|
329
|
+
name: (_ref4 = (_article$name = article.name) !== null && _article$name !== void 0 ? _article$name : article === null || article === void 0 ? void 0 : article.title) !== null && _ref4 !== void 0 ? _ref4 : null,
|
|
330
|
+
description: (_ref5 = (_article$description$ = article === null || article === void 0 || (_article$description = article.description) === null || _article$description === void 0 || (_article$description = _article$description.ops) === null || _article$description === void 0 || (_article$description = _article$description[0]) === null || _article$description === void 0 ? void 0 : _article$description.insert) !== null && _article$description$ !== void 0 ? _article$description$ : article === null || article === void 0 ? void 0 : article.remark) !== null && _ref5 !== void 0 ? _ref5 : null,
|
|
338
331
|
subTitle: (_article$boldDescript = article === null || article === void 0 || (_article$boldDescript2 = article.boldDescription) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2.ops) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2[0]) === null || _article$boldDescript2 === void 0 ? void 0 : _article$boldDescript2.insert) !== null && _article$boldDescript !== void 0 ? _article$boldDescript : null,
|
|
339
332
|
specifications: Array.isArray(article === null || article === void 0 ? void 0 : article.specifications) ? article === null || article === void 0 ? void 0 : article.specifications.join(' \n ') : (_article$specificatio = article === null || article === void 0 ? void 0 : article.specifications) !== null && _article$specificatio !== void 0 ? _article$specificatio : null,
|
|
340
333
|
image: article !== null && article !== void 0 && (_article$images = article.images) !== null && _article$images !== void 0 && _article$images[0] ? (0, _image.getImageFromHyper)({
|
|
@@ -349,11 +342,11 @@ const formatModelArticle = article => {
|
|
|
349
342
|
const formatGenericArticle = article => {
|
|
350
343
|
var _article$articleNumbe2, _article$type, _article$group, _article$subgroup;
|
|
351
344
|
const specificationPairs = [['C2 module', article === null || article === void 0 ? void 0 : article.c2Module], ['Check control', article === null || article === void 0 ? void 0 : article.checkControl], ['Direct current', article === null || article === void 0 ? void 0 : article.directCurrent], ['Draw weight', article === null || article === void 0 ? void 0 : article.drawWeight], ['D value', article === null || article === void 0 ? void 0 : article.dValue], ['Foglight shutdown', article === null || article === void 0 ? void 0 : article.foglightShutdown], ['PDC shutdown', article === null || article === void 0 ? void 0 : article.pdcShutdown], ['Switched PSU', article === null || article === void 0 ? void 0 : article.switchedPsu], ['LED', article === null || article === void 0 ? void 0 : article.led]];
|
|
352
|
-
const specification = specificationPairs.filter(
|
|
353
|
-
let [_, value] =
|
|
345
|
+
const specification = specificationPairs.filter(_ref6 => {
|
|
346
|
+
let [_, value] = _ref6;
|
|
354
347
|
return value;
|
|
355
|
-
}).map(
|
|
356
|
-
let [label, value] =
|
|
348
|
+
}).map(_ref7 => {
|
|
349
|
+
let [label, value] = _ref7;
|
|
357
350
|
return "".concat(label, ": ").concat(value);
|
|
358
351
|
}).join(' \n ');
|
|
359
352
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
@@ -145,9 +145,9 @@ const LicensePlatePage = () => {
|
|
|
145
145
|
}
|
|
146
146
|
}, [discountCode]);
|
|
147
147
|
(0, _react.useEffect)(() => {
|
|
148
|
-
if (APP_CONFIG.internal) return;
|
|
148
|
+
if (APP_CONFIG.internal || activeStep !== 0) return;
|
|
149
149
|
(0, _Datalayer.pushToDataLayer)({
|
|
150
|
-
event:
|
|
150
|
+
event: 'configurator_step_wijzig_auto'
|
|
151
151
|
});
|
|
152
152
|
}, [activeStep]);
|
|
153
153
|
const Steps = (0, _react.useMemo)(() => getSteps({
|
|
@@ -121,9 +121,9 @@ const ManualSelectionPage = () => {
|
|
|
121
121
|
}
|
|
122
122
|
}, [franchiseName]);
|
|
123
123
|
(0, _react.useEffect)(() => {
|
|
124
|
-
if (APP_CONFIG.internal) return;
|
|
124
|
+
if (APP_CONFIG.internal || activeStep !== 0) return;
|
|
125
125
|
(0, _Datalayer.pushToDataLayer)({
|
|
126
|
-
event:
|
|
126
|
+
event: 'configurator_step_wijzig_auto'
|
|
127
127
|
});
|
|
128
128
|
}, [activeStep]);
|
|
129
129
|
const handleNext = () => {
|