thm-p3-configurator 0.0.275 → 0.0.277
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__/StyleWrapper.js +1 -4
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +23 -23
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +17 -16
- package/dist/src/shared/__style__/configurator/_configurator-offset.scss +1 -1
- package/package.json +1 -1
|
@@ -74,10 +74,7 @@ const StyleWrapper = _ref => {
|
|
|
74
74
|
return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeProvider, {
|
|
75
75
|
theme: theme
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement("main", {
|
|
77
|
-
className: (0, _helpers__.withStyle)("thm-configurator ".concat(
|
|
78
|
-
// Don't apply offset when embedded in partner portal - it handles sidebar spacing
|
|
79
|
-
false // was: APP_CONFIG.internal ? 'thm-configurator--offset' : ''
|
|
80
|
-
, " ", theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum ? 'thc' : theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? 'tmg' : '')),
|
|
77
|
+
className: (0, _helpers__.withStyle)("thm-configurator ".concat(APP_CONFIG.internal ? 'thm-configurator--offset' : '', " ").concat(theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum ? 'thc' : theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? 'tmg' : '')),
|
|
81
78
|
style: height
|
|
82
79
|
}, children));
|
|
83
80
|
};
|
|
@@ -342,7 +342,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
342
342
|
const handleSubmit = async function handleSubmit() {
|
|
343
343
|
let appointmentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants__.DOSSIER_TYPES.PlannedAppointment;
|
|
344
344
|
try {
|
|
345
|
-
var _customer$kvkNumber, _customer$vatNumber, _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName, _customer$kvkNumber2, _customer$vatNumber2
|
|
345
|
+
var _customer$kvkNumber, _customer$vatNumber, _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName, _customer$kvkNumber2, _customer$vatNumber2;
|
|
346
346
|
setErrors({});
|
|
347
347
|
if (!model) {
|
|
348
348
|
// Note: this does not throw on error.
|
|
@@ -402,7 +402,6 @@ const InternalAppointmentForm = _ref => {
|
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
const parsedMontageRate = montageRate === null || montageRate === undefined ? undefined : Number.parseFloat(montageRate.toString().replace(',', '.'));
|
|
405
|
-
console.log('parsedMontageRate', parsedMontageRate);
|
|
406
405
|
const payload = (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({
|
|
407
406
|
vehicle,
|
|
408
407
|
customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
|
|
@@ -426,7 +425,8 @@ const InternalAppointmentForm = _ref => {
|
|
|
426
425
|
appointment,
|
|
427
426
|
appointmentType,
|
|
428
427
|
channel,
|
|
429
|
-
licensePlate:
|
|
428
|
+
licensePlate: licensePlate ? licensePlate.replace(/-/g, '') : undefined,
|
|
429
|
+
licensePlateBrandModel: !licensePlate && model && (_licensePlate || licensePlateBrandModel) ? (_licensePlate || licensePlateBrandModel).replace(/-/g, '') : undefined,
|
|
430
430
|
model,
|
|
431
431
|
chassisNumber,
|
|
432
432
|
priceCalculationDate,
|
|
@@ -724,12 +724,12 @@ const InternalAppointmentForm = _ref => {
|
|
|
724
724
|
placeholder: "Maak een keuze",
|
|
725
725
|
errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelType']) || (errors === null || errors === void 0 ? void 0 : errors['channelId']),
|
|
726
726
|
initialValue: initialChannel,
|
|
727
|
-
onChange:
|
|
727
|
+
onChange: _ref2 => {
|
|
728
728
|
var _value$kanaalType;
|
|
729
729
|
let {
|
|
730
730
|
label,
|
|
731
731
|
value
|
|
732
|
-
} =
|
|
732
|
+
} = _ref2;
|
|
733
733
|
return dispatch({
|
|
734
734
|
type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
|
|
735
735
|
payload: {
|
|
@@ -1383,10 +1383,10 @@ const InternalAppointmentForm = _ref => {
|
|
|
1383
1383
|
placeholder: "Selecteer een land",
|
|
1384
1384
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
|
|
1385
1385
|
initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
|
|
1386
|
-
onChange:
|
|
1386
|
+
onChange: _ref3 => {
|
|
1387
1387
|
let {
|
|
1388
1388
|
value
|
|
1389
|
-
} =
|
|
1389
|
+
} = _ref3;
|
|
1390
1390
|
return dispatch({
|
|
1391
1391
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
|
|
1392
1392
|
payload: {
|
|
@@ -1487,10 +1487,10 @@ const InternalAppointmentForm = _ref => {
|
|
|
1487
1487
|
placeholder: "Selecteer een land",
|
|
1488
1488
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
|
|
1489
1489
|
initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
|
|
1490
|
-
onChange:
|
|
1490
|
+
onChange: _ref4 => {
|
|
1491
1491
|
let {
|
|
1492
1492
|
value
|
|
1493
|
-
} =
|
|
1493
|
+
} = _ref4;
|
|
1494
1494
|
return dispatch({
|
|
1495
1495
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
|
|
1496
1496
|
payload: {
|
|
@@ -1605,10 +1605,10 @@ const InternalAppointmentForm = _ref => {
|
|
|
1605
1605
|
placeholder: "Selecteer een land",
|
|
1606
1606
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
|
|
1607
1607
|
initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
|
|
1608
|
-
onChange:
|
|
1608
|
+
onChange: _ref5 => {
|
|
1609
1609
|
let {
|
|
1610
1610
|
value
|
|
1611
|
-
} =
|
|
1611
|
+
} = _ref5;
|
|
1612
1612
|
return dispatch({
|
|
1613
1613
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
|
|
1614
1614
|
payload: {
|
|
@@ -1654,26 +1654,26 @@ const InternalAppointmentForm = _ref => {
|
|
|
1654
1654
|
},
|
|
1655
1655
|
label: "Goedkeuringsnummer onbekend",
|
|
1656
1656
|
isDisabled: !!(vehicle !== null && vehicle !== void 0 && vehicle.leaseNumber)
|
|
1657
|
-
})),
|
|
1658
|
-
key: "licensePlate",
|
|
1659
|
-
placeholder: "",
|
|
1660
|
-
value: _licensePlate,
|
|
1661
|
-
name: "licensePlate",
|
|
1662
|
-
onChange: value => _setLicensePlate(value),
|
|
1663
|
-
isRequired: false,
|
|
1664
|
-
form: "quotation",
|
|
1665
|
-
label: "Kenteken:",
|
|
1666
|
-
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
1667
|
-
}), (licensePlate || licensePlateBrandModel) && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
1657
|
+
})), licensePlate && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
1668
1658
|
key: "licensePlateReadOnly",
|
|
1669
1659
|
placeholder: "",
|
|
1670
|
-
value: licensePlate
|
|
1660
|
+
value: licensePlate,
|
|
1671
1661
|
name: "licensePlateReadOnly",
|
|
1672
1662
|
onChange: () => {},
|
|
1673
1663
|
isRequired: false,
|
|
1674
1664
|
form: "quotation",
|
|
1675
1665
|
label: "Kenteken:",
|
|
1676
1666
|
isDisabled: true
|
|
1667
|
+
}), !licensePlate && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
1668
|
+
key: "licensePlate",
|
|
1669
|
+
placeholder: "",
|
|
1670
|
+
value: _licensePlate !== undefined ? _licensePlate : licensePlateBrandModel || '',
|
|
1671
|
+
name: "licensePlate",
|
|
1672
|
+
onChange: value => _setLicensePlate(value),
|
|
1673
|
+
isRequired: false,
|
|
1674
|
+
form: "quotation",
|
|
1675
|
+
label: "Kenteken:",
|
|
1676
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
1677
1677
|
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
1678
1678
|
key: "chassisNumber",
|
|
1679
1679
|
placeholder: "",
|
|
@@ -194,7 +194,7 @@ const InternalQuotationForm = _ref => {
|
|
|
194
194
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
195
195
|
const [companySearchTerm, setCompanySearchTerm] = (0, _react.useState)('');
|
|
196
196
|
const [isCompanyInputFocused, setIsCompanyInputFocused] = (0, _react.useState)(false);
|
|
197
|
-
const [_licensePlate, _setLicensePlate] = (0, _react.useState)(
|
|
197
|
+
const [_licensePlate, _setLicensePlate] = (0, _react.useState)();
|
|
198
198
|
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
199
199
|
const {
|
|
200
200
|
branchTypes
|
|
@@ -309,7 +309,7 @@ const InternalQuotationForm = _ref => {
|
|
|
309
309
|
*/
|
|
310
310
|
const handleSubmit = async () => {
|
|
311
311
|
try {
|
|
312
|
-
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName
|
|
312
|
+
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName;
|
|
313
313
|
setErrors(null);
|
|
314
314
|
if (!model) {
|
|
315
315
|
// Note: this does not throw on error.
|
|
@@ -367,7 +367,8 @@ const InternalQuotationForm = _ref => {
|
|
|
367
367
|
})),
|
|
368
368
|
chassisNumber: chassisNumber !== null && chassisNumber !== void 0 ? chassisNumber : undefined,
|
|
369
369
|
channel,
|
|
370
|
-
licensePlate:
|
|
370
|
+
licensePlate: licensePlate ? licensePlate.replace(/-/g, '') : undefined,
|
|
371
|
+
licensePlateBrandModel: !licensePlate && model && (_licensePlate || licensePlateBrandModel) ? (_licensePlate || licensePlateBrandModel).replace(/-/g, '') : undefined,
|
|
371
372
|
model,
|
|
372
373
|
answers: (0, _helpers__.removeNullishProps)({
|
|
373
374
|
duration: durationAnswer,
|
|
@@ -528,12 +529,12 @@ const InternalQuotationForm = _ref => {
|
|
|
528
529
|
placeholder: "Maak een keuze",
|
|
529
530
|
errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelId']) || (errors === null || errors === void 0 ? void 0 : errors['channelType']),
|
|
530
531
|
initialValue: initialChannel,
|
|
531
|
-
onChange:
|
|
532
|
+
onChange: _ref2 => {
|
|
532
533
|
var _value$kanaalType;
|
|
533
534
|
let {
|
|
534
535
|
label,
|
|
535
536
|
value
|
|
536
|
-
} =
|
|
537
|
+
} = _ref2;
|
|
537
538
|
return dispatch({
|
|
538
539
|
type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
|
|
539
540
|
payload: {
|
|
@@ -949,25 +950,25 @@ const InternalQuotationForm = _ref => {
|
|
|
949
950
|
},
|
|
950
951
|
label: "Goedkeuringsnummer onbekend",
|
|
951
952
|
isDisabled: !!(vehicle !== null && vehicle !== void 0 && vehicle.leaseNumber)
|
|
952
|
-
})),
|
|
953
|
-
placeholder: "",
|
|
954
|
-
value: _licensePlate,
|
|
955
|
-
name: "licensePlate",
|
|
956
|
-
onChange: value => _setLicensePlate(value),
|
|
957
|
-
isRequired: false,
|
|
958
|
-
form: "quotation",
|
|
959
|
-
label: "Kenteken:",
|
|
960
|
-
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
961
|
-
}), (licensePlate || licensePlateBrandModel) && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
953
|
+
})), licensePlate && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
962
954
|
key: "licensePlateReadOnly",
|
|
963
955
|
placeholder: "",
|
|
964
|
-
value: licensePlate
|
|
956
|
+
value: licensePlate,
|
|
965
957
|
name: "licensePlateReadOnly",
|
|
966
958
|
onChange: () => {},
|
|
967
959
|
isRequired: false,
|
|
968
960
|
form: "quotation",
|
|
969
961
|
label: "Kenteken:",
|
|
970
962
|
isDisabled: true
|
|
963
|
+
}), !licensePlate && /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
964
|
+
placeholder: "",
|
|
965
|
+
value: _licensePlate !== undefined ? _licensePlate : licensePlateBrandModel || '',
|
|
966
|
+
name: "licensePlate",
|
|
967
|
+
onChange: value => _setLicensePlate(value),
|
|
968
|
+
isRequired: false,
|
|
969
|
+
form: "quotation",
|
|
970
|
+
label: "Kenteken:",
|
|
971
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
971
972
|
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
972
973
|
placeholder: "",
|
|
973
974
|
value: vehicle === null || vehicle === void 0 ? void 0 : vehicle.chassisNumber,
|