thm-p3-configurator 0.0.37 → 0.0.38
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/App.js +1 -1
- package/dist/src/shared/__components__/Form/ErrorMessage.js +1 -0
- package/dist/src/shared/__containers__/AppointmentForm.js +1 -1
- package/dist/src/shared/__containers__/ExitIntentModal.js +3 -13
- package/dist/src/shared/__containers__/ManualSelectionForm.js +12 -14
- package/dist/src/shared/__containers__/ProductsOverview.js +2 -2
- package/dist/src/shared/__containers__/QuotationForm.js +4 -13
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +17 -20
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +10 -15
- package/dist/src/shared/__helpers__/dossier.js +4 -3
- package/dist/src/shared/__helpers__/ui.js +21 -2
- package/dist/src/shared/__pages__/index.js +15 -10
- package/package.json +1 -1
package/dist/src/shared/App.js
CHANGED
|
@@ -69,7 +69,7 @@ const App = () => {
|
|
|
69
69
|
(0, _Experiments.default)();
|
|
70
70
|
});
|
|
71
71
|
return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
|
|
72
|
-
defaultFormula: _constants__.CONFIGURATOR_FORMULAS.
|
|
72
|
+
defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THC
|
|
73
73
|
}, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
|
|
74
74
|
defaultCountry: APP_CONFIG.country
|
|
75
75
|
}, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
|
|
@@ -333,7 +333,7 @@ const AppointmentForm = () => {
|
|
|
333
333
|
}), /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
|
|
334
334
|
onClick: handleSubmit,
|
|
335
335
|
isDisabled: isCreatingAppointmentRequest,
|
|
336
|
-
label: 'Afspraak
|
|
336
|
+
label: 'Afspraak maaken'
|
|
337
337
|
}))));
|
|
338
338
|
};
|
|
339
339
|
var _default = exports.default = AppointmentForm;
|
|
@@ -25,7 +25,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
25
25
|
var _reactRouter = require("react-router");
|
|
26
26
|
var _yup = require("yup");
|
|
27
27
|
var _mutations = require("../__api__/mutations");
|
|
28
|
-
var _queries = require("../__api__/queries");
|
|
29
28
|
var _LinkButton = _interopRequireDefault(require("../__components__/Buttons/LinkButton"));
|
|
30
29
|
var _PrimaryButton = _interopRequireDefault(require("../__components__/Buttons/PrimaryButton"));
|
|
31
30
|
var _Card = _interopRequireDefault(require("../__components__/Cards/Card"));
|
|
@@ -138,18 +137,9 @@ const ExitIntentModal = () => {
|
|
|
138
137
|
selectedDiscountedProducts = []
|
|
139
138
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
140
139
|
const formula = (0, _FormulaContext.useFormula)();
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
licensePlate,
|
|
145
|
-
model,
|
|
146
|
-
executionAnswer1,
|
|
147
|
-
executionAnswer2,
|
|
148
|
-
durationAnswer: durationAnswer,
|
|
149
|
-
formula,
|
|
150
|
-
discountCode,
|
|
151
|
-
priceCalculationDate
|
|
152
|
-
});
|
|
140
|
+
(0, _react.useEffect)(() => {
|
|
141
|
+
(0, _ui.scrollToFirstErrorMessage)();
|
|
142
|
+
}, [errors]);
|
|
153
143
|
const handleMouseLeave = event => {
|
|
154
144
|
if (document.cookie.includes('exitIntentModalShown=true')) {
|
|
155
145
|
return;
|
|
@@ -58,11 +58,7 @@ function _interopRequireWildcard(e, r) {
|
|
|
58
58
|
const ManualSelectionForm = _ref => {
|
|
59
59
|
let {
|
|
60
60
|
onSubmit,
|
|
61
|
-
initialValues =
|
|
62
|
-
brand: null,
|
|
63
|
-
model: null,
|
|
64
|
-
buildYear: null
|
|
65
|
-
}
|
|
61
|
+
initialValues = null
|
|
66
62
|
} = _ref;
|
|
67
63
|
const [{
|
|
68
64
|
brand,
|
|
@@ -104,15 +100,17 @@ const ManualSelectionForm = _ref => {
|
|
|
104
100
|
);
|
|
105
101
|
};
|
|
106
102
|
(0, _react.useEffect)(() => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
if (initialValues) {
|
|
104
|
+
handleBrandChange({
|
|
105
|
+
value: initialValues.brand
|
|
106
|
+
});
|
|
107
|
+
handleBuildYearChange({
|
|
108
|
+
value: initialValues.buildYear
|
|
109
|
+
});
|
|
110
|
+
handleModelChange({
|
|
111
|
+
value: initialValues.model
|
|
112
|
+
});
|
|
113
|
+
}
|
|
116
114
|
}, [initialValues]);
|
|
117
115
|
const handleBrandChange = brandOption => {
|
|
118
116
|
dispatch({
|
|
@@ -203,7 +203,7 @@ const ProductsOverview = () => {
|
|
|
203
203
|
key: product.articleNumber,
|
|
204
204
|
id: product.articleNumber,
|
|
205
205
|
description: (0, _product.formatHyperDescription)(product === null || product === void 0 ? void 0 : product.description),
|
|
206
|
-
title: product === null || product === void 0 ? void 0 : product.
|
|
206
|
+
title: product === null || product === void 0 ? void 0 : product.subgroupName,
|
|
207
207
|
price: product === null || product === void 0 ? void 0 : product.price
|
|
208
208
|
});
|
|
209
209
|
}
|
|
@@ -212,7 +212,7 @@ const ProductsOverview = () => {
|
|
|
212
212
|
hasCheckbox: (productsPerCategory === null || productsPerCategory === void 0 ? void 0 : productsPerCategory.length) > 1,
|
|
213
213
|
isRecommended: isRecommended,
|
|
214
214
|
productId: product === null || product === void 0 ? void 0 : product.articleNumber,
|
|
215
|
-
productTitle: product === null || product === void 0 ? void 0 : product.
|
|
215
|
+
productTitle: product === null || product === void 0 ? void 0 : product.subgroupName,
|
|
216
216
|
productDescription: product === null || product === void 0 ? void 0 : product.productDescription,
|
|
217
217
|
productUsps: [{
|
|
218
218
|
type: 'excl',
|
|
@@ -20,7 +20,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
20
20
|
var _reactRouter = require("react-router");
|
|
21
21
|
var _yup = require("yup");
|
|
22
22
|
var _mutations = require("../__api__/mutations");
|
|
23
|
-
var _queries = require("../__api__/queries");
|
|
24
23
|
var _NavigationButton = _interopRequireDefault(require("../__components__/Buttons/NavigationButton"));
|
|
25
24
|
var _PrimaryButton = _interopRequireDefault(require("../__components__/Buttons/PrimaryButton"));
|
|
26
25
|
var _Card = _interopRequireDefault(require("../__components__/Cards/Card"));
|
|
@@ -32,6 +31,7 @@ var _FormulaContext = require("../__context__/FormulaContext");
|
|
|
32
31
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
33
32
|
var _helpers__ = require("../__helpers__");
|
|
34
33
|
var _product = require("../__helpers__/product");
|
|
34
|
+
var _ui = require("../__helpers__/ui");
|
|
35
35
|
function _interopRequireDefault(e) {
|
|
36
36
|
return e && e.__esModule ? e : {
|
|
37
37
|
default: e
|
|
@@ -138,18 +138,9 @@ const QuotationForm = () => {
|
|
|
138
138
|
isCreatingQuotation
|
|
139
139
|
} = (0, _mutations.useCreateQuotationMutation)();
|
|
140
140
|
const formula = (0, _FormulaContext.useFormula)();
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
} = (0, _queries.useProductsQuery)({
|
|
145
|
-
licensePlate,
|
|
146
|
-
model,
|
|
147
|
-
executionAnswer1,
|
|
148
|
-
executionAnswer2,
|
|
149
|
-
durationAnswer: durationAnswer,
|
|
150
|
-
formula,
|
|
151
|
-
discountCode
|
|
152
|
-
});
|
|
141
|
+
(0, _react.useEffect)(() => {
|
|
142
|
+
(0, _ui.scrollToFirstErrorMessage)();
|
|
143
|
+
}, [errors]);
|
|
153
144
|
const handleSubmit = async () => {
|
|
154
145
|
try {
|
|
155
146
|
setErrors(null);
|
|
@@ -44,6 +44,7 @@ var _FormulaContext = require("../../__context__/FormulaContext");
|
|
|
44
44
|
var _OrderSessionContext = require("../../__context__/OrderSessionContext");
|
|
45
45
|
var _helpers__ = require("../../__helpers__");
|
|
46
46
|
var _product = require("../../__helpers__/product");
|
|
47
|
+
var _ui = require("../../__helpers__/ui");
|
|
47
48
|
var _LicensePlateValidator = _interopRequireDefault(require("../../__services__/LicensePlateValidator"));
|
|
48
49
|
var _LocalStorageWorker = require("../../__services__/LocalStorageWorker");
|
|
49
50
|
var _InternalAppointmentSuccessModal = _interopRequireDefault(require("./InternalAppointmentSuccessModal"));
|
|
@@ -183,18 +184,9 @@ const InternalAppointmentForm = _ref => {
|
|
|
183
184
|
} = (0, _queries.useBranchByIdOrWidgetId)(selectedBranch);
|
|
184
185
|
const history = (0, _reactRouter.useHistory)();
|
|
185
186
|
const formula = (0, _FormulaContext.useFormula)();
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
licensePlate,
|
|
190
|
-
model,
|
|
191
|
-
executionAnswer1,
|
|
192
|
-
executionAnswer2,
|
|
193
|
-
durationAnswer: durationAnswer,
|
|
194
|
-
formula,
|
|
195
|
-
discountCode,
|
|
196
|
-
priceCalculationDate
|
|
197
|
-
});
|
|
187
|
+
(0, _react.useEffect)(() => {
|
|
188
|
+
(0, _ui.scrollToFirstErrorMessage)();
|
|
189
|
+
}, [errors]);
|
|
198
190
|
|
|
199
191
|
/**
|
|
200
192
|
* @description Handles the validation of the license plate, if the session has not been started with a license plate
|
|
@@ -211,7 +203,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
211
203
|
const handleSubmit = async () => {
|
|
212
204
|
try {
|
|
213
205
|
var _ref2;
|
|
214
|
-
setErrors(
|
|
206
|
+
setErrors([]);
|
|
215
207
|
|
|
216
208
|
// Note: this does not throw on error.
|
|
217
209
|
const licensePlateErrors = validateLicensePlate();
|
|
@@ -223,9 +215,14 @@ const InternalAppointmentForm = _ref => {
|
|
|
223
215
|
}
|
|
224
216
|
|
|
225
217
|
// Note: this throws on error.
|
|
226
|
-
internalAppointmentFormSchema.validateSync(_objectSpread(_objectSpread(_objectSpread(
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
internalAppointmentFormSchema.validateSync(_objectSpread(_objectSpread(_objectSpread({}, vehicle), customer), {}, {
|
|
219
|
+
// Note: add string fallback here to prevent null check in Yup throwing weird errors
|
|
220
|
+
// However: dont submit empty strings to the API because the API doesnt accept empty strings in place of `undefined`
|
|
221
|
+
// Rule in custom API: a field can be optional (can be undefined), but once you fill it in with a value, that value has to be truthy.
|
|
222
|
+
date: (appointment === null || appointment === void 0 ? void 0 : appointment.date) || '',
|
|
223
|
+
time: (appointment === null || appointment === void 0 ? void 0 : appointment.time) || '',
|
|
224
|
+
channelType: (channel === null || channel === void 0 ? void 0 : channel.channelType) || '',
|
|
225
|
+
channelId: (channel === null || channel === void 0 ? void 0 : channel.channelId) || ''
|
|
229
226
|
}), {
|
|
230
227
|
strict: false,
|
|
231
228
|
abortEarly: false
|
|
@@ -531,7 +528,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
531
528
|
initialValue: _licensePlate,
|
|
532
529
|
name: "licensePlate",
|
|
533
530
|
onChange: value => _setLicensePlate(value),
|
|
534
|
-
isRequired:
|
|
531
|
+
isRequired: false,
|
|
535
532
|
form: "quotation",
|
|
536
533
|
label: "Kenteken:",
|
|
537
534
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
@@ -573,10 +570,10 @@ const InternalAppointmentForm = _ref => {
|
|
|
573
570
|
className: (0, _helpers__.withStyle)('col-12 col-md-6')
|
|
574
571
|
}, /*#__PURE__*/_react.default.createElement(_TextAreaInput.default, {
|
|
575
572
|
placeholder: "",
|
|
576
|
-
initialValue:
|
|
573
|
+
initialValue: customer === null || customer === void 0 ? void 0 : customer.note,
|
|
577
574
|
name: "note",
|
|
578
575
|
onChange: value => dispatch({
|
|
579
|
-
type: _OrderSessionContext.orderSessionActions.
|
|
576
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
|
|
580
577
|
payload: {
|
|
581
578
|
note: value
|
|
582
579
|
}
|
|
@@ -601,7 +598,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
601
598
|
}), /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
|
|
602
599
|
onClick: handleSubmit,
|
|
603
600
|
isDisabled: isLoading,
|
|
604
|
-
label: 'Afspraak
|
|
601
|
+
label: 'Afspraak maaken'
|
|
605
602
|
}))), /*#__PURE__*/_react.default.createElement(_InternalAppointmentSuccessModal.default, {
|
|
606
603
|
isOpen: isSuccess
|
|
607
604
|
}));
|
|
@@ -39,6 +39,7 @@ var _FormulaContext = require("../../__context__/FormulaContext");
|
|
|
39
39
|
var _OrderSessionContext = require("../../__context__/OrderSessionContext");
|
|
40
40
|
var _helpers__ = require("../../__helpers__");
|
|
41
41
|
var _product = require("../../__helpers__/product");
|
|
42
|
+
var _ui = require("../../__helpers__/ui");
|
|
42
43
|
var _LicensePlateValidator = _interopRequireDefault(require("../../__services__/LicensePlateValidator"));
|
|
43
44
|
var _LocalStorageWorker = require("../../__services__/LocalStorageWorker");
|
|
44
45
|
var _InternalQuotationSuccessModal = _interopRequireDefault(require("./InternalQuotationSuccessModal"));
|
|
@@ -167,18 +168,9 @@ const InternalQuotationForm = _ref => {
|
|
|
167
168
|
isLoadingMarketingChannels
|
|
168
169
|
} = (0, _queries.useMarketingChannels)(branchType);
|
|
169
170
|
const formula = (0, _FormulaContext.useFormula)();
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
licensePlate,
|
|
174
|
-
model,
|
|
175
|
-
executionAnswer1,
|
|
176
|
-
executionAnswer2,
|
|
177
|
-
durationAnswer: durationAnswer,
|
|
178
|
-
formula,
|
|
179
|
-
discountCode,
|
|
180
|
-
priceCalculationDate
|
|
181
|
-
});
|
|
171
|
+
(0, _react.useEffect)(() => {
|
|
172
|
+
(0, _ui.scrollToFirstErrorMessage)();
|
|
173
|
+
}, [errors]);
|
|
182
174
|
|
|
183
175
|
/**
|
|
184
176
|
* @description Handles the validation of the license plate, if the session has not been started with a license plate
|
|
@@ -211,8 +203,11 @@ const InternalQuotationForm = _ref => {
|
|
|
211
203
|
|
|
212
204
|
// Note: this throws on error.
|
|
213
205
|
internalQuotationFormSchema.validateSync(_objectSpread(_objectSpread(_objectSpread({}, vehicle), customer), {}, {
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
// Note: add string fallback here to prevent null check in Yup throwing weird errors
|
|
207
|
+
// However: dont submit empty strings to the API because the API doesnt accept empty strings in place of `undefined`
|
|
208
|
+
// Rule in custom API: a field can be optional (can be undefined), but once you fill it in with a value, that value has to be truthy.
|
|
209
|
+
channelType: (channel === null || channel === void 0 ? void 0 : channel.channelType) || '',
|
|
210
|
+
channelId: (channel === null || channel === void 0 ? void 0 : channel.channelId) || ''
|
|
216
211
|
}), {
|
|
217
212
|
strict: false,
|
|
218
213
|
abortEarly: false
|
|
@@ -411,7 +406,7 @@ const InternalQuotationForm = _ref => {
|
|
|
411
406
|
initialValue: _licensePlate,
|
|
412
407
|
name: "licensePlate",
|
|
413
408
|
onChange: value => _setLicensePlate(value),
|
|
414
|
-
isRequired:
|
|
409
|
+
isRequired: false,
|
|
415
410
|
form: "quotation",
|
|
416
411
|
label: "Kenteken:",
|
|
417
412
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['licensePlate']
|
|
@@ -67,7 +67,7 @@ function _toPrimitive(t, r) {
|
|
|
67
67
|
* @description Covnerts an existing hyper dossier object into a local order session
|
|
68
68
|
*/
|
|
69
69
|
const parseDossierToOrderSession = exports.parseDossierToOrderSession = function parseDossierToOrderSession() {
|
|
70
|
-
var _dossier$kanaal, _dossier$kanaalPartne, _dossier$vestiging, _dossier$typeEigendom, _Date, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant6, _dossier$klant7, _dossier$klant8, _dossier$klant9;
|
|
70
|
+
var _dossier$kanaal, _dossier$kanaalPartne, _dossier$kanaalHoofka, _dossier$vestiging, _dossier$typeEigendom, _Date, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant6, _dossier$klant7, _dossier$klant8, _dossier$klant9;
|
|
71
71
|
let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
72
72
|
return {
|
|
73
73
|
licensePlate: dossier === null || dossier === void 0 ? void 0 : dossier.kenteken,
|
|
@@ -75,7 +75,7 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
75
75
|
// Note: only fill in when license plate is empty
|
|
76
76
|
channel: {
|
|
77
77
|
channelType: dossier === null || dossier === void 0 || (_dossier$kanaal = dossier.kanaal) === null || _dossier$kanaal === void 0 ? void 0 : _dossier$kanaal.entityId,
|
|
78
|
-
channelId: dossier === null || dossier === void 0 || (_dossier$kanaalPartne = dossier.kanaalPartner) === null || _dossier$kanaalPartne === void 0 ? void 0 : _dossier$kanaalPartne.entityId
|
|
78
|
+
channelId: (dossier === null || dossier === void 0 || (_dossier$kanaalPartne = dossier.kanaalPartner) === null || _dossier$kanaalPartne === void 0 ? void 0 : _dossier$kanaalPartne.entityId) || (dossier === null || dossier === void 0 || (_dossier$kanaalHoofka = dossier.kanaalHoofkantoor) === null || _dossier$kanaalHoofka === void 0 ? void 0 : _dossier$kanaalHoofka.entityId)
|
|
79
79
|
},
|
|
80
80
|
durationAnswer: dossier === null || dossier === void 0 ? void 0 : dossier.looptijd,
|
|
81
81
|
executionAnswer1: dossier === null || dossier === void 0 ? void 0 : dossier.uitvoeringTrekhaakExecuton1,
|
|
@@ -112,10 +112,11 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
112
112
|
appointment: {
|
|
113
113
|
date: !(dossier !== null && dossier !== void 0 && dossier.geplandeTijd) ? new Date() : new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd),
|
|
114
114
|
time: !(dossier !== null && dossier !== void 0 && dossier.geplandeTijd) ? new Date() : (_Date = new Date()) === null || _Date === void 0 ? void 0 : _Date.setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd),
|
|
115
|
-
note: dossier === null || dossier === void 0 ? void 0 : dossier.
|
|
115
|
+
note: dossier === null || dossier === void 0 ? void 0 : dossier.opmerkingKlant
|
|
116
116
|
},
|
|
117
117
|
priceCalculationDate: dossier !== null && dossier !== void 0 && dossier.prijsberekeningsdatum ? dossier === null || dossier === void 0 ? void 0 : dossier.prijsberekeningsdatum : new Date().getTime(),
|
|
118
118
|
customer: {
|
|
119
|
+
note: dossier === null || dossier === void 0 ? void 0 : dossier.opmerkingKlant,
|
|
119
120
|
firstName: (dossier === null || dossier === void 0 || (_dossier$klant = dossier.klant) === null || _dossier$klant === void 0 ? void 0 : _dossier$klant.firstName) || '',
|
|
120
121
|
lastName: (dossier === null || dossier === void 0 || (_dossier$klant2 = dossier.klant) === null || _dossier$klant2 === void 0 ? void 0 : _dossier$klant2.lastName) || '',
|
|
121
122
|
infix: (dossier === null || dossier === void 0 || (_dossier$klant3 = dossier.klant) === null || _dossier$klant3 === void 0 ? void 0 : _dossier$klant3.tussenvoegsel) || '',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.checkIfMouseOutsideWindow = void 0;
|
|
6
|
+
exports.scrollToFirstErrorMessage = exports.checkIfMouseOutsideWindow = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* @description Checks whether the mouse inside the view
|
|
9
9
|
* @param {Number} mouseY the "Y" coordinate of the mouse
|
|
@@ -17,4 +17,23 @@ const checkIfMouseOutsideWindow = _ref => {
|
|
|
17
17
|
} = _ref;
|
|
18
18
|
return mouseY > window.innerHeight - offset || mouseY < offset;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @description Finds the first instance of `error-message` on the DOM and scrolls to it
|
|
23
|
+
*/
|
|
24
|
+
exports.checkIfMouseOutsideWindow = checkIfMouseOutsideWindow;
|
|
25
|
+
const scrollToFirstErrorMessage = () => {
|
|
26
|
+
if (typeof window === 'undefined') {
|
|
27
|
+
console.warn("scrollToFirstErrorMessage() should only run in browser");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const errorMessage = window.document.querySelector("[name=\"error-message\"]");
|
|
31
|
+
if (!errorMessage) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
errorMessage.scrollIntoView({
|
|
35
|
+
behavior: 'smooth',
|
|
36
|
+
block: 'center'
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
exports.scrollToFirstErrorMessage = scrollToFirstErrorMessage;
|
|
@@ -90,6 +90,7 @@ var _OverviewPage = _interopRequireDefault(require("./OverviewPage"));
|
|
|
90
90
|
var _ProductsPage = _interopRequireDefault(require("./ProductsPage"));
|
|
91
91
|
var _QuotationPage = _interopRequireDefault(require("./QuotationPage"));
|
|
92
92
|
var _QuotationThanksPage = _interopRequireDefault(require("./QuotationThanksPage"));
|
|
93
|
+
var _internal = require("./internal");
|
|
93
94
|
function _interopRequireDefault(e) {
|
|
94
95
|
return e && e.__esModule ? e : {
|
|
95
96
|
default: e
|
|
@@ -101,7 +102,7 @@ const Routes = () => {
|
|
|
101
102
|
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Switch, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
102
103
|
exact: true,
|
|
103
104
|
path: "/",
|
|
104
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
105
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalLicensePlatePage, props)
|
|
105
106
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
106
107
|
exact: true,
|
|
107
108
|
path: "/configurator/geen-producten",
|
|
@@ -109,40 +110,44 @@ const Routes = () => {
|
|
|
109
110
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
110
111
|
exact: true,
|
|
111
112
|
path: "/configurator/montagelocatie",
|
|
112
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
113
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalLocationsPage, props)
|
|
113
114
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
114
115
|
exact: true,
|
|
115
116
|
path: "/configurator/gegevens/bedankt",
|
|
116
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
117
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalAppointmentPage, props)
|
|
117
118
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
118
119
|
exact: true,
|
|
119
120
|
path: "/configurator/offerte/bedankt",
|
|
120
121
|
render: props => /*#__PURE__*/_react.default.createElement(_QuotationThanksPage.default, props)
|
|
121
122
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
122
123
|
path: "/configurator/trekhaakpakket",
|
|
123
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
124
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalProductsPage, null)
|
|
124
125
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
125
126
|
path: "/configurator/manual",
|
|
126
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
127
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalManualSelectionPage, props)
|
|
127
128
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
128
129
|
exact: true,
|
|
129
130
|
path: "/configurator/overzicht",
|
|
130
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
131
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalOverviewPage, null)
|
|
131
132
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
132
133
|
exact: true,
|
|
133
134
|
path: "/configurator/offerte",
|
|
134
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
135
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalQuotationPage, null)
|
|
135
136
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
136
137
|
exact: true,
|
|
137
138
|
path: "/configurator/gegevens",
|
|
138
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
139
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalAppointmentPage, null)
|
|
139
140
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
140
141
|
exact: true,
|
|
141
142
|
path: "/configurator/toebehoren",
|
|
142
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
143
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalExtraProductsPage, null)
|
|
144
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
145
|
+
exact: true,
|
|
146
|
+
path: "/configurator/:id",
|
|
147
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalSessionEditPage, props)
|
|
143
148
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
144
149
|
path: "/configurator",
|
|
145
|
-
render: props => /*#__PURE__*/_react.default.createElement(
|
|
150
|
+
render: props => /*#__PURE__*/_react.default.createElement(_internal.InternalLicensePlatePage, null)
|
|
146
151
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
147
152
|
path: "/niet-gevonden",
|
|
148
153
|
render: () => /*#__PURE__*/_react.default.createElement(_NotFoundPage.default, null)
|