thm-p3-configurator 0.0.158 → 0.0.159
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.
|
@@ -408,7 +408,7 @@ const useSingleOrderCart = () => {
|
|
|
408
408
|
*/
|
|
409
409
|
exports.useSingleOrderCart = useSingleOrderCart;
|
|
410
410
|
const useProductsQuery = orderParameters => {
|
|
411
|
-
var _productsQuery$data, _productsQuery$data2, _productsQuery$data3, _productsQuery$data4, _productsQuery$data5, _productsQuery$data6, _productsQuery$data7, _productsQuery$data8, _productsQuery$data9, _productsQuery$data$a, _productsQuery$
|
|
411
|
+
var _productsQuery$data, _productsQuery$data2, _productsQuery$data3, _productsQuery$data4, _productsQuery$data5, _productsQuery$data6, _productsQuery$data7, _productsQuery$data8, _productsQuery$data9, _productsQuery$data10, _productsQuery$data11, _productsQuery$data12, _productsQuery$data13, _productsQuery$data14, _productsQuery$data15, _productsQuery$data16, _productsQuery$data$a, _productsQuery$data17, _productsQuery$data$c, _productsQuery$data18, _productsQuery$data$a2, _productsQuery$data19, _productsQuery$data$a3, _productsQuery$data20, _productsQuery$data$a4, _productsQuery$data21, _productsQuery$data22, _productsQuery$data23, _productsQuery$data$a5, _productsQuery$data24, _productsQuery$data$t, _productsQuery$data25;
|
|
412
412
|
const {
|
|
413
413
|
licensePlate,
|
|
414
414
|
model,
|
|
@@ -461,30 +461,38 @@ const useProductsQuery = orderParameters => {
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
});
|
|
464
|
+
const buildYear = new Date(productsQuery === null || productsQuery === void 0 || (_productsQuery$data = productsQuery.data) === null || _productsQuery$data === void 0 || (_productsQuery$data = _productsQuery$data.vehicleInfo) === null || _productsQuery$data === void 0 || (_productsQuery$data = _productsQuery$data.vehicle) === null || _productsQuery$data === void 0 ? void 0 : _productsQuery$data.constructionDate).getFullYear();
|
|
464
465
|
return {
|
|
465
466
|
isLoadingProducts: productsQuery.isLoading,
|
|
466
467
|
isProductsError: productsQuery.isError,
|
|
467
|
-
vehicleLogo: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
468
|
+
vehicleLogo: productsQuery === null || productsQuery === void 0 || (_productsQuery$data2 = productsQuery.data) === null || _productsQuery$data2 === void 0 || (_productsQuery$data2 = _productsQuery$data2.vehicleInfo) === null || _productsQuery$data2 === void 0 || (_productsQuery$data2 = _productsQuery$data2.make) === null || _productsQuery$data2 === void 0 ? void 0 : _productsQuery$data2.logo,
|
|
468
469
|
vehicleDetails: {
|
|
469
|
-
merk: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
470
|
-
model: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
471
|
-
duration: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
472
|
-
carrosserie: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
473
|
-
brandstof: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
474
|
-
uitvoering: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
475
|
-
'uitvoering #2': productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
470
|
+
merk: productsQuery === null || productsQuery === void 0 || (_productsQuery$data3 = productsQuery.data) === null || _productsQuery$data3 === void 0 || (_productsQuery$data3 = _productsQuery$data3.vehicleInfo) === null || _productsQuery$data3 === void 0 || (_productsQuery$data3 = _productsQuery$data3.make) === null || _productsQuery$data3 === void 0 ? void 0 : _productsQuery$data3.name,
|
|
471
|
+
model: productsQuery === null || productsQuery === void 0 || (_productsQuery$data4 = productsQuery.data) === null || _productsQuery$data4 === void 0 || (_productsQuery$data4 = _productsQuery$data4.vehicleInfo) === null || _productsQuery$data4 === void 0 || (_productsQuery$data4 = _productsQuery$data4.model) === null || _productsQuery$data4 === void 0 ? void 0 : _productsQuery$data4.name,
|
|
472
|
+
duration: productsQuery === null || productsQuery === void 0 || (_productsQuery$data5 = productsQuery.data) === null || _productsQuery$data5 === void 0 || (_productsQuery$data5 = _productsQuery$data5.vehicleInfo) === null || _productsQuery$data5 === void 0 || (_productsQuery$data5 = _productsQuery$data5.model) === null || _productsQuery$data5 === void 0 ? void 0 : _productsQuery$data5.duration,
|
|
473
|
+
carrosserie: productsQuery === null || productsQuery === void 0 || (_productsQuery$data6 = productsQuery.data) === null || _productsQuery$data6 === void 0 || (_productsQuery$data6 = _productsQuery$data6.vehicleInfo) === null || _productsQuery$data6 === void 0 || (_productsQuery$data6 = _productsQuery$data6.vehicle) === null || _productsQuery$data6 === void 0 || (_productsQuery$data6 = _productsQuery$data6.bodyType) === null || _productsQuery$data6 === void 0 ? void 0 : _productsQuery$data6.description,
|
|
474
|
+
brandstof: productsQuery === null || productsQuery === void 0 || (_productsQuery$data7 = productsQuery.data) === null || _productsQuery$data7 === void 0 || (_productsQuery$data7 = _productsQuery$data7.vehicleInfo) === null || _productsQuery$data7 === void 0 || (_productsQuery$data7 = _productsQuery$data7.vehicle) === null || _productsQuery$data7 === void 0 || (_productsQuery$data7 = _productsQuery$data7.fuelType) === null || _productsQuery$data7 === void 0 ? void 0 : _productsQuery$data7.description,
|
|
475
|
+
uitvoering: productsQuery === null || productsQuery === void 0 || (_productsQuery$data8 = productsQuery.data) === null || _productsQuery$data8 === void 0 || (_productsQuery$data8 = _productsQuery$data8.answers) === null || _productsQuery$data8 === void 0 ? void 0 : _productsQuery$data8.execution1,
|
|
476
|
+
'uitvoering #2': productsQuery === null || productsQuery === void 0 || (_productsQuery$data9 = productsQuery.data) === null || _productsQuery$data9 === void 0 || (_productsQuery$data9 = _productsQuery$data9.answers) === null || _productsQuery$data9 === void 0 ? void 0 : _productsQuery$data9.execution2,
|
|
477
|
+
Geimporteerd: productsQuery !== null && productsQuery !== void 0 && (_productsQuery$data10 = productsQuery.data) !== null && _productsQuery$data10 !== void 0 && (_productsQuery$data10 = _productsQuery$data10.vehicleInfo) !== null && _productsQuery$data10 !== void 0 && (_productsQuery$data10 = _productsQuery$data10.vehicle) !== null && _productsQuery$data10 !== void 0 && _productsQuery$data10.isImported ? 'Ja' : 'Nee',
|
|
478
|
+
'Trekgewicht op kenteken': Boolean(productsQuery === null || productsQuery === void 0 || (_productsQuery$data11 = productsQuery.data) === null || _productsQuery$data11 === void 0 || (_productsQuery$data11 = _productsQuery$data11.vehicleInfo) === null || _productsQuery$data11 === void 0 || (_productsQuery$data11 = _productsQuery$data11.vehicle) === null || _productsQuery$data11 === void 0 ? void 0 : _productsQuery$data11.maxTowingMassBraked) ? 'Ja' : 'Nee',
|
|
479
|
+
'Max. Trekgewicht, geremd': productsQuery === null || productsQuery === void 0 || (_productsQuery$data12 = productsQuery.data) === null || _productsQuery$data12 === void 0 || (_productsQuery$data12 = _productsQuery$data12.vehicleInfo) === null || _productsQuery$data12 === void 0 || (_productsQuery$data12 = _productsQuery$data12.vehicle) === null || _productsQuery$data12 === void 0 ? void 0 : _productsQuery$data12.maxTowingMassBraked,
|
|
480
|
+
'Max. Trekgewicht, niet geremd': productsQuery === null || productsQuery === void 0 || (_productsQuery$data13 = productsQuery.data) === null || _productsQuery$data13 === void 0 || (_productsQuery$data13 = _productsQuery$data13.vehicleInfo) === null || _productsQuery$data13 === void 0 || (_productsQuery$data13 = _productsQuery$data13.vehicle) === null || _productsQuery$data13 === void 0 ? void 0 : _productsQuery$data13.maxTowingMassUnbraked,
|
|
481
|
+
bouwjaar: buildYear,
|
|
482
|
+
kType: productsQuery === null || productsQuery === void 0 || (_productsQuery$data14 = productsQuery.data) === null || _productsQuery$data14 === void 0 || (_productsQuery$data14 = _productsQuery$data14.vehicleInfo) === null || _productsQuery$data14 === void 0 || (_productsQuery$data14 = _productsQuery$data14.model) === null || _productsQuery$data14 === void 0 ? void 0 : _productsQuery$data14.kType,
|
|
483
|
+
kMod: productsQuery === null || productsQuery === void 0 || (_productsQuery$data15 = productsQuery.data) === null || _productsQuery$data15 === void 0 || (_productsQuery$data15 = _productsQuery$data15.vehicleInfo) === null || _productsQuery$data15 === void 0 || (_productsQuery$data15 = _productsQuery$data15.model) === null || _productsQuery$data15 === void 0 ? void 0 : _productsQuery$data15.kMod
|
|
476
484
|
},
|
|
477
|
-
discountCodeInfo: productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
478
|
-
discountProducts: (_productsQuery$data$a = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
479
|
-
cart: (_productsQuery$data$c = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
485
|
+
discountCodeInfo: productsQuery === null || productsQuery === void 0 || (_productsQuery$data16 = productsQuery.data) === null || _productsQuery$data16 === void 0 ? void 0 : _productsQuery$data16.discountCodeInfo,
|
|
486
|
+
discountProducts: (_productsQuery$data$a = productsQuery === null || productsQuery === void 0 || (_productsQuery$data17 = productsQuery.data) === null || _productsQuery$data17 === void 0 || (_productsQuery$data17 = _productsQuery$data17.articles) === null || _productsQuery$data17 === void 0 ? void 0 : _productsQuery$data17.discountCode) !== null && _productsQuery$data$a !== void 0 ? _productsQuery$data$a : [],
|
|
487
|
+
cart: (_productsQuery$data$c = productsQuery === null || productsQuery === void 0 || (_productsQuery$data18 = productsQuery.data) === null || _productsQuery$data18 === void 0 ? void 0 : _productsQuery$data18.cart) !== null && _productsQuery$data$c !== void 0 ? _productsQuery$data$c : [],
|
|
480
488
|
products: {
|
|
481
|
-
[_constants__.PRODUCT_CATEGORIES.TOWBAR]: (_productsQuery$data$a2 = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
482
|
-
[_constants__.PRODUCT_CATEGORIES.CABLESET]: (_productsQuery$data$a3 = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
483
|
-
[_constants__.PRODUCT_CATEGORIES.COMBISET]: (_productsQuery$data$a4 = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
484
|
-
[_constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER]: productsQuery !== null && productsQuery !== void 0 && (_productsQuery$
|
|
485
|
-
[_constants__.PRODUCT_CATEGORIES.EXTRAS]: (_productsQuery$data$a5 = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
489
|
+
[_constants__.PRODUCT_CATEGORIES.TOWBAR]: (_productsQuery$data$a2 = productsQuery === null || productsQuery === void 0 || (_productsQuery$data19 = productsQuery.data) === null || _productsQuery$data19 === void 0 || (_productsQuery$data19 = _productsQuery$data19.articles) === null || _productsQuery$data19 === void 0 ? void 0 : _productsQuery$data19.towbars) !== null && _productsQuery$data$a2 !== void 0 ? _productsQuery$data$a2 : [],
|
|
490
|
+
[_constants__.PRODUCT_CATEGORIES.CABLESET]: (_productsQuery$data$a3 = productsQuery === null || productsQuery === void 0 || (_productsQuery$data20 = productsQuery.data) === null || _productsQuery$data20 === void 0 || (_productsQuery$data20 = _productsQuery$data20.articles) === null || _productsQuery$data20 === void 0 ? void 0 : _productsQuery$data20.cablesets) !== null && _productsQuery$data$a3 !== void 0 ? _productsQuery$data$a3 : [],
|
|
491
|
+
[_constants__.PRODUCT_CATEGORIES.COMBISET]: (_productsQuery$data$a4 = productsQuery === null || productsQuery === void 0 || (_productsQuery$data21 = productsQuery.data) === null || _productsQuery$data21 === void 0 || (_productsQuery$data21 = _productsQuery$data21.articles) === null || _productsQuery$data21 === void 0 ? void 0 : _productsQuery$data21.combisets) !== null && _productsQuery$data$a4 !== void 0 ? _productsQuery$data$a4 : [],
|
|
492
|
+
[_constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER]: productsQuery !== null && productsQuery !== void 0 && (_productsQuery$data22 = productsQuery.data) !== null && _productsQuery$data22 !== void 0 && (_productsQuery$data22 = _productsQuery$data22.articles) !== null && _productsQuery$data22 !== void 0 && _productsQuery$data22.boardComputerUpdate ? [productsQuery === null || productsQuery === void 0 || (_productsQuery$data23 = productsQuery.data) === null || _productsQuery$data23 === void 0 || (_productsQuery$data23 = _productsQuery$data23.articles) === null || _productsQuery$data23 === void 0 ? void 0 : _productsQuery$data23.boardComputerUpdate] : [],
|
|
493
|
+
[_constants__.PRODUCT_CATEGORIES.EXTRAS]: (_productsQuery$data$a5 = productsQuery === null || productsQuery === void 0 || (_productsQuery$data24 = productsQuery.data) === null || _productsQuery$data24 === void 0 || (_productsQuery$data24 = _productsQuery$data24.articles) === null || _productsQuery$data24 === void 0 ? void 0 : _productsQuery$data24.extras) !== null && _productsQuery$data$a5 !== void 0 ? _productsQuery$data$a5 : []
|
|
486
494
|
},
|
|
487
|
-
totals: (_productsQuery$data$t = productsQuery === null || productsQuery === void 0 || (_productsQuery$
|
|
495
|
+
totals: (_productsQuery$data$t = productsQuery === null || productsQuery === void 0 || (_productsQuery$data25 = productsQuery.data) === null || _productsQuery$data25 === void 0 ? void 0 : _productsQuery$data25.totals) !== null && _productsQuery$data$t !== void 0 ? _productsQuery$data$t : []
|
|
488
496
|
};
|
|
489
497
|
};
|
|
490
498
|
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
4
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
3
5
|
require("core-js/modules/esnext.iterator.map.js");
|
|
4
6
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.default = void 0;
|
|
11
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
9
13
|
require("core-js/modules/esnext.iterator.map.js");
|
|
10
14
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
15
|
var _lodash = require("lodash");
|
|
@@ -19,6 +23,7 @@ var _FormulaContext = require("../__context__/FormulaContext");
|
|
|
19
23
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
20
24
|
var _helpers__ = require("../__helpers__");
|
|
21
25
|
var _image = require("../__helpers__/image");
|
|
26
|
+
var _useIsTmg = require("../__hooks__/useIsTmg");
|
|
22
27
|
function _interopRequireDefault(e) {
|
|
23
28
|
return e && e.__esModule ? e : {
|
|
24
29
|
default: e
|
|
@@ -39,6 +44,7 @@ const VehicleData = _ref => {
|
|
|
39
44
|
singleOrderFormulaCode,
|
|
40
45
|
existingDossierId
|
|
41
46
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
47
|
+
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
42
48
|
let formula = (0, _FormulaContext.useFormula)();
|
|
43
49
|
if (isFilter && singleOrderFormulaCode) {
|
|
44
50
|
formula = singleOrderFormulaCode;
|
|
@@ -84,8 +90,11 @@ const VehicleData = _ref => {
|
|
|
84
90
|
className: (0, _helpers__.withStyle)('license-plate__edit link-primary col-12'),
|
|
85
91
|
type: "button"
|
|
86
92
|
})),
|
|
87
|
-
expandedBody: Object.entries(vehicleDetails).
|
|
88
|
-
let [key
|
|
93
|
+
expandedBody: Object.entries(vehicleDetails).filter(_ref2 => {
|
|
94
|
+
let [key] = _ref2;
|
|
95
|
+
return isTmg || key !== 'kType' && key !== 'kMod';
|
|
96
|
+
}).map(_ref3 => {
|
|
97
|
+
let [key, value] = _ref3;
|
|
89
98
|
if (!value) {
|
|
90
99
|
return null;
|
|
91
100
|
}
|