thm-p3-configurator 0.0.334 → 0.0.335
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/__api__/queries.js +0 -1
- package/dist/src/shared/__containers__/ANWBMembershipInput.js +24 -4
- package/dist/src/shared/__containers__/DiscountProductsSelector.js +1 -1
- package/dist/src/shared/__containers__/ProductDiscountCard.js +1 -1
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +1 -1
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +13 -4
- package/dist/src/shared/__context__/OrderSessionContext.js +11 -0
- package/dist/src/shared/__helpers__/dossier.js +7 -0
- package/dist/src/shared/__pages__/internal/InternalLicensePlatePage.js +1 -1
- package/dist/src/shared/__pages__/internal/InternalSessionEditPage.js +10 -2
- package/dist/src/shared/__services__/AuthRuntime.js +29 -0
- package/package.json +1 -1
|
@@ -38,7 +38,6 @@ var _FormulaContext = require("../__context__/FormulaContext");
|
|
|
38
38
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
39
39
|
var _helpers__ = require("../__helpers__");
|
|
40
40
|
var _singleOrderArticles = require("../__helpers__/singleOrderArticles");
|
|
41
|
-
var _AuthRuntime = require("../__services__/AuthRuntime");
|
|
42
41
|
var _authenticatedProxyApi = require("./authenticatedProxyApi");
|
|
43
42
|
var _orderApi = require("./orderApi");
|
|
44
43
|
var _publicProxyApi = require("./publicProxyApi");
|
|
@@ -51,17 +51,18 @@ function _interopRequireWildcard(e, r) {
|
|
|
51
51
|
return n.default = e, t && t.set(e, n), n;
|
|
52
52
|
}
|
|
53
53
|
const ANWBMembershipValidator = _ref => {
|
|
54
|
-
var _customer$
|
|
54
|
+
var _customer$anwbId2;
|
|
55
55
|
let {
|
|
56
56
|
discountProducts = []
|
|
57
57
|
} = _ref;
|
|
58
58
|
const [{
|
|
59
59
|
customer,
|
|
60
|
-
discountCode
|
|
60
|
+
discountCode,
|
|
61
|
+
anwbDiscountValidated,
|
|
62
|
+
selectedDiscountedProducts
|
|
61
63
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
62
64
|
const [isNumberValid, setIsNumberValid] = (0, _react.useState)();
|
|
63
65
|
const clearDiscountProducts = () => {
|
|
64
|
-
console.log('clearDiscountProducts');
|
|
65
66
|
dispatch({
|
|
66
67
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_DISCOUNT_PRODUCTS,
|
|
67
68
|
payload: {
|
|
@@ -76,6 +77,9 @@ const ANWBMembershipValidator = _ref => {
|
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
79
|
const handleMembershipChange = number => {
|
|
80
|
+
if (number === (customer === null || customer === void 0 ? void 0 : customer.anwbId)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
79
83
|
dispatch({
|
|
80
84
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ANWB_ID,
|
|
81
85
|
payload: {
|
|
@@ -84,6 +88,22 @@ const ANWBMembershipValidator = _ref => {
|
|
|
84
88
|
});
|
|
85
89
|
clearDiscountProducts();
|
|
86
90
|
};
|
|
91
|
+
(0, _react.useEffect)(() => {
|
|
92
|
+
var _selectedDiscountedPr, _customer$anwbId$leng, _customer$anwbId;
|
|
93
|
+
const hasAnwbProducts = ((_selectedDiscountedPr = selectedDiscountedProducts === null || selectedDiscountedProducts === void 0 ? void 0 : selectedDiscountedProducts.length) !== null && _selectedDiscountedPr !== void 0 ? _selectedDiscountedPr : 0) > 0;
|
|
94
|
+
const hasPrefilledMembership = ((_customer$anwbId$leng = customer === null || customer === void 0 || (_customer$anwbId = customer.anwbId) === null || _customer$anwbId === void 0 ? void 0 : _customer$anwbId.length) !== null && _customer$anwbId$leng !== void 0 ? _customer$anwbId$leng : 0) === 9;
|
|
95
|
+
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
96
|
+
|
|
97
|
+
// Keep a previously validated ANWB state active after hydration.
|
|
98
|
+
if (isAnwbCode && hasPrefilledMembership && hasAnwbProducts && anwbDiscountValidated !== true) {
|
|
99
|
+
dispatch({
|
|
100
|
+
type: _OrderSessionContext.orderSessionActions.SET_ANWB_DISCOUNT_VALIDATED,
|
|
101
|
+
payload: {
|
|
102
|
+
anwbDiscountValidated: true
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}, [anwbDiscountValidated, customer === null || customer === void 0 ? void 0 : customer.anwbId, discountCode, dispatch, selectedDiscountedProducts]);
|
|
87
107
|
const handleSubmit = number => {
|
|
88
108
|
const isValid = _ANWBValidator.anwbValidator.validate(0, {
|
|
89
109
|
number
|
|
@@ -136,7 +156,7 @@ const ANWBMembershipValidator = _ref => {
|
|
|
136
156
|
onClick: () => {
|
|
137
157
|
handleSubmit(customer === null || customer === void 0 ? void 0 : customer.anwbId);
|
|
138
158
|
},
|
|
139
|
-
isDisabled: (customer === null || customer === void 0 || (_customer$
|
|
159
|
+
isDisabled: (customer === null || customer === void 0 || (_customer$anwbId2 = customer.anwbId) === null || _customer$anwbId2 === void 0 ? void 0 : _customer$anwbId2.length) !== 9,
|
|
140
160
|
label: 'Verzilver!'
|
|
141
161
|
})), ' '), isNumberValid != null && /*#__PURE__*/_react.default.createElement("div", {
|
|
142
162
|
className: (0, _helpers__.withStyle)("alert w-100 ".concat(isNumberValid === true ? 'alert-success' : 'alert-danger'))
|
|
@@ -124,7 +124,7 @@ const DiscountProductsSelector = _ref => {
|
|
|
124
124
|
});
|
|
125
125
|
};
|
|
126
126
|
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
127
|
-
const inputsDisabled = isAnwbCode &&
|
|
127
|
+
const inputsDisabled = isAnwbCode && anwbDiscountValidated === false;
|
|
128
128
|
if (!(discountProducts !== null && discountProducts !== void 0 && discountProducts.length)) {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
@@ -87,7 +87,7 @@ const ProductDiscountCard = () => {
|
|
|
87
87
|
discountCode: code,
|
|
88
88
|
anwbDiscountValidated: validated
|
|
89
89
|
} = anwbStateRef.current;
|
|
90
|
-
if (code !== null && code !== void 0 && code.toLocaleLowerCase().includes('anwb') &&
|
|
90
|
+
if (code !== null && code !== void 0 && code.toLocaleLowerCase().includes('anwb') && validated === false) {
|
|
91
91
|
dispatch({
|
|
92
92
|
type: _OrderSessionContext.orderSessionActions.SET_DISCOUNT_CODE,
|
|
93
93
|
payload: {
|
|
@@ -1577,7 +1577,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
1577
1577
|
className: (0, _helpers__.withStyle)('col-12 col-md-6')
|
|
1578
1578
|
}, /*#__PURE__*/_react.default.createElement(_TextAreaInput.default, {
|
|
1579
1579
|
placeholder: "",
|
|
1580
|
-
|
|
1580
|
+
initialValue: contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note,
|
|
1581
1581
|
name: "note",
|
|
1582
1582
|
onChange: value => dispatch({
|
|
1583
1583
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.includes.js");
|
|
3
4
|
require("core-js/modules/es.promise.js");
|
|
4
5
|
require("core-js/modules/es.regexp.exec.js");
|
|
6
|
+
require("core-js/modules/es.string.includes.js");
|
|
5
7
|
require("core-js/modules/es.string.replace.js");
|
|
6
8
|
require("core-js/modules/es.weak-map.js");
|
|
7
9
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
@@ -16,8 +18,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
18
|
value: true
|
|
17
19
|
});
|
|
18
20
|
exports.default = void 0;
|
|
21
|
+
require("core-js/modules/es.array.includes.js");
|
|
19
22
|
require("core-js/modules/es.promise.js");
|
|
20
23
|
require("core-js/modules/es.regexp.exec.js");
|
|
24
|
+
require("core-js/modules/es.string.includes.js");
|
|
21
25
|
require("core-js/modules/es.string.replace.js");
|
|
22
26
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
23
27
|
require("core-js/modules/esnext.iterator.find.js");
|
|
@@ -130,6 +134,7 @@ const getEmptyCustomerState = () => ({
|
|
|
130
134
|
lastName: '',
|
|
131
135
|
email: '',
|
|
132
136
|
phoneNumber: '',
|
|
137
|
+
anwbId: '',
|
|
133
138
|
zipCode: '',
|
|
134
139
|
houseNumber: '',
|
|
135
140
|
houseNumberAddition: '',
|
|
@@ -239,6 +244,7 @@ const InternalQuotationForm = _ref => {
|
|
|
239
244
|
lastName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.lastName) || '',
|
|
240
245
|
email: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.email) || '',
|
|
241
246
|
phoneNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.phoneNumber) || '',
|
|
247
|
+
anwbId: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.anwbId) || '',
|
|
242
248
|
zipCode: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.zipCode) || '',
|
|
243
249
|
houseNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumber) || '',
|
|
244
250
|
houseNumberAddition: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumberAddition) || '',
|
|
@@ -301,6 +307,7 @@ const InternalQuotationForm = _ref => {
|
|
|
301
307
|
lastName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
|
|
302
308
|
email: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
|
|
303
309
|
phoneNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
|
|
310
|
+
anwbId: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ANWB_ID,
|
|
304
311
|
zipCode: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
305
312
|
houseNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
306
313
|
houseNumberAddition: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
|
|
@@ -449,7 +456,7 @@ const InternalQuotationForm = _ref => {
|
|
|
449
456
|
*/
|
|
450
457
|
const handleSubmit = async () => {
|
|
451
458
|
try {
|
|
452
|
-
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _contextCustomer$note, _customer$zipCode, _customer$companyName,
|
|
459
|
+
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _ref3, _contextCustomer$anwb, _contextCustomer$note, _customer$zipCode, _customer$companyName, _ref4;
|
|
453
460
|
setErrors(null);
|
|
454
461
|
if (!model) {
|
|
455
462
|
// Note: this does not throw on error.
|
|
@@ -488,6 +495,7 @@ const InternalQuotationForm = _ref => {
|
|
|
488
495
|
isTmg
|
|
489
496
|
}
|
|
490
497
|
});
|
|
498
|
+
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
491
499
|
const payload = (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({
|
|
492
500
|
vehicle,
|
|
493
501
|
customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
|
|
@@ -500,13 +508,14 @@ const InternalQuotationForm = _ref => {
|
|
|
500
508
|
countryId: (_customer$countryId = customer === null || customer === void 0 ? void 0 : customer.countryId) !== null && _customer$countryId !== void 0 ? _customer$countryId : undefined,
|
|
501
509
|
city: (_customer$city = customer === null || customer === void 0 ? void 0 : customer.city) !== null && _customer$city !== void 0 ? _customer$city : undefined,
|
|
502
510
|
email: (_customer$email = customer === null || customer === void 0 ? void 0 : customer.email) !== null && _customer$email !== void 0 ? _customer$email : undefined,
|
|
511
|
+
anwbId: isAnwbCode ? (_ref3 = (_contextCustomer$anwb = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.anwbId) !== null && _contextCustomer$anwb !== void 0 ? _contextCustomer$anwb : customer === null || customer === void 0 ? void 0 : customer.anwbId) !== null && _ref3 !== void 0 ? _ref3 : undefined : undefined,
|
|
503
512
|
note: (_contextCustomer$note = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note !== void 0 ? _contextCustomer$note : undefined,
|
|
504
513
|
zipCode: (_customer$zipCode = customer === null || customer === void 0 ? void 0 : customer.zipCode) !== null && _customer$zipCode !== void 0 ? _customer$zipCode : undefined,
|
|
505
514
|
companyName: activeOwnershipType !== _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij ? (_customer$companyName = customer === null || customer === void 0 ? void 0 : customer.companyName) !== null && _customer$companyName !== void 0 ? _customer$companyName : undefined : undefined
|
|
506
515
|
})),
|
|
507
516
|
chassisNumber: chassisNumber !== null && chassisNumber !== void 0 ? chassisNumber : undefined,
|
|
508
517
|
channel,
|
|
509
|
-
licensePlate: (
|
|
518
|
+
licensePlate: (_ref4 = licensePlate || _licensePlate) === null || _ref4 === void 0 ? void 0 : _ref4.replace(/-/g, ''),
|
|
510
519
|
model,
|
|
511
520
|
answers: (0, _helpers__.removeNullishProps)({
|
|
512
521
|
duration: durationAnswer,
|
|
@@ -619,12 +628,12 @@ const InternalQuotationForm = _ref => {
|
|
|
619
628
|
placeholder: "Maak een keuze",
|
|
620
629
|
errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelId']) || (errors === null || errors === void 0 ? void 0 : errors['channelType']),
|
|
621
630
|
initialValue: initialChannel,
|
|
622
|
-
onChange:
|
|
631
|
+
onChange: _ref5 => {
|
|
623
632
|
var _value$kanaalType, _value$kanaalType2;
|
|
624
633
|
let {
|
|
625
634
|
label,
|
|
626
635
|
value
|
|
627
|
-
} =
|
|
636
|
+
} = _ref5;
|
|
628
637
|
return dispatch({
|
|
629
638
|
type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
|
|
630
639
|
payload: {
|
|
@@ -1371,6 +1371,9 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1371
1371
|
(0, _react.useLayoutEffect)(() => {
|
|
1372
1372
|
var _ref;
|
|
1373
1373
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1374
|
+
if (APP_CONFIG.internal) {
|
|
1375
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1376
|
+
}
|
|
1374
1377
|
return;
|
|
1375
1378
|
}
|
|
1376
1379
|
_AuthRuntime.authRuntime.setActiveBranchId((_ref = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref !== void 0 ? _ref : null);
|
|
@@ -1378,11 +1381,15 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1378
1381
|
(0, _react.useEffect)(() => {
|
|
1379
1382
|
var _ref2;
|
|
1380
1383
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1384
|
+
if (APP_CONFIG.internal) {
|
|
1385
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1386
|
+
}
|
|
1381
1387
|
return;
|
|
1382
1388
|
}
|
|
1383
1389
|
const branchId = (_ref2 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
1384
1390
|
if (!authenticated || !branchId || !formula) {
|
|
1385
1391
|
lastSyncedContextRef.current = null;
|
|
1392
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1386
1393
|
return;
|
|
1387
1394
|
}
|
|
1388
1395
|
const normalizedFormula = formula === _constants__.CONFIGURATOR_FORMULAS.THM ? _constants__.CONFIGURATOR_FORMULAS.TM : formula;
|
|
@@ -1392,9 +1399,11 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1392
1399
|
module: module !== null && module !== void 0 ? module : null
|
|
1393
1400
|
});
|
|
1394
1401
|
if (lastSyncedContextRef.current === nextContextKey) {
|
|
1402
|
+
_AuthRuntime.authRuntime.setSessionContextReady(true);
|
|
1395
1403
|
return;
|
|
1396
1404
|
}
|
|
1397
1405
|
let isCancelled = false;
|
|
1406
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1398
1407
|
_authenticatedProxyApi.authenticatedProxyApi.putSessionContext({
|
|
1399
1408
|
branchEntityId: branchId,
|
|
1400
1409
|
formula: normalizedFormula,
|
|
@@ -1402,9 +1411,11 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1402
1411
|
}).then(() => {
|
|
1403
1412
|
if (!isCancelled) {
|
|
1404
1413
|
lastSyncedContextRef.current = nextContextKey;
|
|
1414
|
+
_AuthRuntime.authRuntime.setSessionContextReady(true);
|
|
1405
1415
|
}
|
|
1406
1416
|
}).catch(error => {
|
|
1407
1417
|
console.warn('Failed to sync authenticated session context', error);
|
|
1418
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1408
1419
|
});
|
|
1409
1420
|
return () => {
|
|
1410
1421
|
isCancelled = true;
|
|
@@ -69,6 +69,10 @@ function _toPrimitive(t, r) {
|
|
|
69
69
|
}
|
|
70
70
|
return ("string" === r ? String : Number)(t);
|
|
71
71
|
}
|
|
72
|
+
const isAnwbDiscountCode = function isAnwbDiscountCode() {
|
|
73
|
+
let discountCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
74
|
+
return discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
75
|
+
};
|
|
72
76
|
const getDossierPrimaryEmail = exports.getDossierPrimaryEmail = function getDossierPrimaryEmail() {
|
|
73
77
|
var _dossier$email, _ref, _dossier$klant$email, _dossier$klant, _dossier$klant2;
|
|
74
78
|
let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -98,6 +102,8 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
98
102
|
let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
99
103
|
// Detect meerprijs (extra price) line from dossier lines
|
|
100
104
|
const meerprijsLine = dossier === null || dossier === void 0 || (_dossier$lines = dossier.lines) === null || _dossier$lines === void 0 ? void 0 : _dossier$lines.find(line => line.articleNumber === 'MEERPRIJS' && line.activeArticle);
|
|
105
|
+
const hasAnwbMembershipId = Boolean(dossier === null || dossier === void 0 ? void 0 : dossier.anwbId);
|
|
106
|
+
const anwbDiscountValidated = isAnwbDiscountCode(dossier === null || dossier === void 0 ? void 0 : dossier.discountCode) && hasAnwbMembershipId;
|
|
101
107
|
return {
|
|
102
108
|
canAlterQuantity: (dossier === null || dossier === void 0 || (_dossier$statusBeoord = dossier.statusBeoordeling) === null || _dossier$statusBeoord === void 0 ? void 0 : _dossier$statusBeoord.title) === _constants__.STATUS_ASSESSMENT.Open,
|
|
103
109
|
licensePlate: dossier === null || dossier === void 0 ? void 0 : dossier.kenteken,
|
|
@@ -137,6 +143,7 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
137
143
|
})) !== null && _dossier$lines$some !== void 0 ? _dossier$lines$some : false,
|
|
138
144
|
selectedBranch: dossier === null || dossier === void 0 || (_dossier$vestiging = dossier.vestiging) === null || _dossier$vestiging === void 0 ? void 0 : _dossier$vestiging.entityId,
|
|
139
145
|
discountCode: dossier === null || dossier === void 0 ? void 0 : dossier.discountCode,
|
|
146
|
+
anwbDiscountValidated,
|
|
140
147
|
chassisNumber: (_dossier$chassisnumme = dossier === null || dossier === void 0 ? void 0 : dossier.chassisnummer) !== null && _dossier$chassisnumme !== void 0 ? _dossier$chassisnumme : null,
|
|
141
148
|
vehicle: {
|
|
142
149
|
ownershipType: dossier === null || dossier === void 0 || (_dossier$typeEigendom = dossier.typeEigendomAuto) === null || _dossier$typeEigendom === void 0 ? void 0 : _dossier$typeEigendom.title,
|
|
@@ -134,7 +134,7 @@ const InternalLicensePlatePage = () => {
|
|
|
134
134
|
}, /*#__PURE__*/_react.default.createElement(_Card.default, {
|
|
135
135
|
isCentered: true,
|
|
136
136
|
isScrollable: true,
|
|
137
|
-
title: 'Wij zoeken naar de
|
|
137
|
+
title: 'Wij zoeken naar de beste oplossing'
|
|
138
138
|
}, notFound === 'true' && /*#__PURE__*/_react.default.createElement("div", {
|
|
139
139
|
className: (0, _helpers__.withStyle)('alert alert-danger mb-3')
|
|
140
140
|
}, /*#__PURE__*/_react.default.createElement("small", null, "Het opgegeven kenteken kon niet worden gevonden. Probeer een ander kenteken of zoek via merk.")), Steps[activeStep], /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.includes.js");
|
|
3
4
|
require("core-js/modules/es.promise.js");
|
|
4
5
|
require("core-js/modules/es.regexp.exec.js");
|
|
5
6
|
require("core-js/modules/es.regexp.to-string.js");
|
|
7
|
+
require("core-js/modules/es.string.includes.js");
|
|
6
8
|
require("core-js/modules/es.string.match.js");
|
|
7
9
|
require("core-js/modules/es.weak-map.js");
|
|
8
10
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
@@ -18,9 +20,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
18
20
|
value: true
|
|
19
21
|
});
|
|
20
22
|
exports.default = void 0;
|
|
23
|
+
require("core-js/modules/es.array.includes.js");
|
|
21
24
|
require("core-js/modules/es.promise.js");
|
|
22
25
|
require("core-js/modules/es.regexp.exec.js");
|
|
23
26
|
require("core-js/modules/es.regexp.to-string.js");
|
|
27
|
+
require("core-js/modules/es.string.includes.js");
|
|
24
28
|
require("core-js/modules/es.string.match.js");
|
|
25
29
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
30
|
require("core-js/modules/web.url-search-params.js");
|
|
@@ -124,7 +128,7 @@ const InternalSessionEditPage = props => {
|
|
|
124
128
|
const history = (0, _reactRouter.useHistory)();
|
|
125
129
|
const hydrateOrderSessionByDossier = (0, _react.useCallback)(async dossierById => {
|
|
126
130
|
try {
|
|
127
|
-
var _dossierById$akkoordO, _orderRes$data, _orderRes$data2;
|
|
131
|
+
var _dossierById$akkoordO, _orderRes$data, _orderRes$data2, _session$discountCode, _session$customer, _sessionProducts$sele;
|
|
128
132
|
const session = (0, _dossier.parseDossierToOrderSession)(dossierById);
|
|
129
133
|
session.customerAgreed = (_dossierById$akkoordO = dossierById === null || dossierById === void 0 ? void 0 : dossierById.akkoordOpmerkingen) !== null && _dossierById$akkoordO !== void 0 ? _dossierById$akkoordO : false;
|
|
130
134
|
const orderRes = await _authenticatedProxyApi.authenticatedProxyApi.getOrder(new URLSearchParams((0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, session), {}, {
|
|
@@ -138,10 +142,14 @@ const InternalSessionEditPage = props => {
|
|
|
138
142
|
orderProducts: orderRes === null || orderRes === void 0 || (_orderRes$data = orderRes.data) === null || _orderRes$data === void 0 || (_orderRes$data = _orderRes$data.data) === null || _orderRes$data === void 0 ? void 0 : _orderRes$data.articles,
|
|
139
143
|
boardComputerUpdate: orderRes === null || orderRes === void 0 || (_orderRes$data2 = orderRes.data) === null || _orderRes$data2 === void 0 || (_orderRes$data2 = _orderRes$data2.data) === null || _orderRes$data2 === void 0 || (_orderRes$data2 = _orderRes$data2.articles) === null || _orderRes$data2 === void 0 ? void 0 : _orderRes$data2.boardComputerUpdate
|
|
140
144
|
});
|
|
145
|
+
const isAnwbCode = session === null || session === void 0 || (_session$discountCode = session.discountCode) === null || _session$discountCode === void 0 ? void 0 : _session$discountCode.toLocaleLowerCase().includes('anwb');
|
|
146
|
+
const shouldKeepAnwbValidated = isAnwbCode && Boolean((session === null || session === void 0 || (_session$customer = session.customer) === null || _session$customer === void 0 ? void 0 : _session$customer.anwbId) || (sessionProducts === null || sessionProducts === void 0 || (_sessionProducts$sele = sessionProducts.selectedDiscountedProducts) === null || _sessionProducts$sele === void 0 ? void 0 : _sessionProducts$sele.length));
|
|
141
147
|
dispatch({
|
|
142
148
|
type: _OrderSessionContext.orderSessionActions.INITIALIZE_EXISTING_ORDER,
|
|
143
149
|
payload: {
|
|
144
|
-
existingOrder: _objectSpread(_objectSpread({}, session), sessionProducts),
|
|
150
|
+
existingOrder: _objectSpread(_objectSpread(_objectSpread({}, session), sessionProducts), {}, {
|
|
151
|
+
anwbDiscountValidated: shouldKeepAnwbValidated
|
|
152
|
+
}),
|
|
145
153
|
existingDossierId: dossierById === null || dossierById === void 0 ? void 0 : dossierById.entityId,
|
|
146
154
|
existingDossierType: dossierType
|
|
147
155
|
}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
4
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
5
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
6
|
Object.defineProperty(exports, "__esModule", {
|
|
4
7
|
value: true
|
|
5
8
|
});
|
|
6
9
|
exports.authRuntime = void 0;
|
|
10
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
11
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
12
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
7
13
|
let csrfToken = null;
|
|
8
14
|
let activeBranchEntityId = null;
|
|
15
|
+
let sessionContextReady = false;
|
|
16
|
+
const sessionContextListeners = new Set();
|
|
17
|
+
const notifySessionContextListeners = () => {
|
|
18
|
+
sessionContextListeners.forEach(listener => {
|
|
19
|
+
listener(sessionContextReady);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
9
22
|
const authRuntime = exports.authRuntime = {
|
|
10
23
|
getCsrfToken() {
|
|
11
24
|
return csrfToken;
|
|
12
25
|
},
|
|
26
|
+
isSessionContextReady() {
|
|
27
|
+
return sessionContextReady;
|
|
28
|
+
},
|
|
13
29
|
setCsrfToken() {
|
|
14
30
|
let nextToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
15
31
|
csrfToken = nextToken || null;
|
|
@@ -21,8 +37,21 @@ const authRuntime = exports.authRuntime = {
|
|
|
21
37
|
let entityId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
22
38
|
activeBranchEntityId = entityId || null;
|
|
23
39
|
},
|
|
40
|
+
setSessionContextReady() {
|
|
41
|
+
let nextReadyState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
42
|
+
sessionContextReady = Boolean(nextReadyState);
|
|
43
|
+
notifySessionContextListeners();
|
|
44
|
+
},
|
|
45
|
+
subscribeSessionContextReady(listener) {
|
|
46
|
+
sessionContextListeners.add(listener);
|
|
47
|
+
return () => {
|
|
48
|
+
sessionContextListeners.delete(listener);
|
|
49
|
+
};
|
|
50
|
+
},
|
|
24
51
|
clear() {
|
|
25
52
|
csrfToken = null;
|
|
26
53
|
activeBranchEntityId = null;
|
|
54
|
+
sessionContextReady = false;
|
|
55
|
+
notifySessionContextListeners();
|
|
27
56
|
}
|
|
28
57
|
};
|