thm-p3-configurator 0.0.25 → 0.0.27
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/index.js +12 -0
- package/dist/src/shared/__api__/authenticatedProxyApi.js +40 -5
- package/dist/src/shared/__api__/mutations.js +107 -9
- package/dist/src/shared/__api__/queries.js +50 -2
- package/dist/src/shared/__components__/Form/DatePickerInput.js +1 -1
- package/dist/src/shared/__components__/Header.js +1 -1
- package/dist/src/shared/__components__/ProductCard/ProductCardUsps.js +3 -0
- package/dist/src/shared/__components__/Spinners/FullPageSpinner.js +8 -3
- package/dist/src/shared/__constants__/index.js +6 -1
- package/dist/src/shared/__containers__/ANWBMembershipInput.js +4 -2
- package/dist/src/shared/__containers__/AppointmentForm.js +4 -2
- package/dist/src/shared/__containers__/BottomNavigationBar.js +4 -1
- package/dist/src/shared/__containers__/DiscountProductsSelector.js +2 -0
- package/dist/src/shared/__containers__/ExitIntentModal.js +4 -2
- package/dist/src/shared/__containers__/ProductCartSide.js +1 -0
- package/dist/src/shared/__containers__/ProductDiscountCard.js +4 -2
- package/dist/src/shared/__containers__/ProductsOverview.js +4 -2
- package/dist/src/shared/__containers__/QuestionsForm.js +12 -12
- package/dist/src/shared/__containers__/QuotationForm.js +1 -1
- package/dist/src/shared/__containers__/VehicleData.js +4 -2
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +31 -27
- package/dist/src/shared/__containers__/internal/InternalAppointmentSuccessModal.js +23 -3
- package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +3 -1
- package/dist/src/shared/__containers__/internal/InternalCancelDossierEdit.js +61 -0
- package/dist/src/shared/__containers__/internal/InternalPriceCalculationSelector.js +48 -0
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +28 -22
- package/dist/src/shared/__containers__/internal/InternalQuotationSuccessModal.js +23 -3
- package/dist/src/shared/__containers__/internal/index.js +14 -0
- package/dist/src/shared/__context__/OrderSessionContext.js +83 -10
- package/dist/src/shared/__helpers__/dossier.js +206 -0
- package/dist/src/shared/__pages__/LicensePlatePage.js +1 -1
- package/dist/src/shared/__pages__/ManualSelectionPage.js +1 -1
- package/dist/src/shared/__pages__/QuotationThanksPage.js +1 -1
- package/dist/src/shared/__pages__/internal/InternalAppointmentPage.js +38 -2
- package/dist/src/shared/__pages__/internal/InternalExtraProductsPage.js +5 -2
- package/dist/src/shared/__pages__/internal/InternalLicensePlatePage.js +7 -4
- package/dist/src/shared/__pages__/internal/InternalLocationsPage.js +4 -1
- package/dist/src/shared/__pages__/internal/InternalManualSelectionPage.js +6 -3
- package/dist/src/shared/__pages__/internal/InternalNoDossierPage.js +83 -0
- package/dist/src/shared/__pages__/internal/InternalNoProductsPage.js +5 -2
- package/dist/src/shared/__pages__/internal/InternalOverviewPage.js +5 -2
- package/dist/src/shared/__pages__/internal/InternalProductsPage.js +3 -2
- package/dist/src/shared/__pages__/internal/InternalQuotationPage.js +38 -2
- package/dist/src/shared/__pages__/internal/InternalSessionEditPage.js +168 -0
- package/dist/src/shared/__pages__/internal/index.js +14 -0
- package/dist/src/shared/__style__/components/_cancel-edit.scss +9 -0
- package/dist/src/shared/__style__/components/_loader.scss +1 -7
- package/dist/src/shared/__style__/main-external.scss +1 -0
- package/dist/src/shared/__style__/main.module.scss +1 -0
- package/dist/src/shared/__style__/main.scss +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "InternalManualSelectionPage", {
|
|
|
57
57
|
return _index.InternalManualSelectionPage;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "InternalNoDossierPage", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _index.InternalNoDossierPage;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "InternalNoProductsPage", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function get() {
|
|
@@ -81,6 +87,12 @@ Object.defineProperty(exports, "InternalQuotationPage", {
|
|
|
81
87
|
return _index.InternalQuotationPage;
|
|
82
88
|
}
|
|
83
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "InternalSessionEditPage", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _index.InternalSessionEditPage;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
84
96
|
Object.defineProperty(exports, "OrderSessionController", {
|
|
85
97
|
enumerable: true,
|
|
86
98
|
get: function get() {
|
|
@@ -41,18 +41,53 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
|
|
|
41
41
|
getBranchById: id => authenticateClient("api/v1/branches/".concat(id), {
|
|
42
42
|
method: 'GET'
|
|
43
43
|
}),
|
|
44
|
-
|
|
44
|
+
getQuotationById: id => authenticateClient("api/v1/quotations/".concat(id), {
|
|
45
|
+
method: 'GET'
|
|
46
|
+
}),
|
|
47
|
+
getPlannedAppointmentById: id => authenticateClient("api/v1/appointments/".concat(id), {
|
|
48
|
+
method: 'GET'
|
|
49
|
+
}),
|
|
50
|
+
getAppointmentRequestById: id => authenticateClient("api/v1/appointment-requests/".concat(id), {
|
|
51
|
+
method: 'GET'
|
|
52
|
+
}),
|
|
53
|
+
postQuotation: quotationPayload => authenticateClient("api/v1/quotations", {
|
|
45
54
|
method: 'POST',
|
|
46
|
-
data:
|
|
55
|
+
data: quotationPayload,
|
|
47
56
|
headers: {
|
|
48
57
|
'Content-Type': 'application/json'
|
|
49
58
|
}
|
|
50
59
|
}),
|
|
51
|
-
postAppointment:
|
|
60
|
+
postAppointment: appointmentPayload => authenticateClient("api/v1/appointments", {
|
|
52
61
|
method: 'POST',
|
|
53
|
-
data:
|
|
62
|
+
data: appointmentPayload,
|
|
54
63
|
headers: {
|
|
55
64
|
'Content-Type': 'application/json'
|
|
56
65
|
}
|
|
57
|
-
})
|
|
66
|
+
}),
|
|
67
|
+
putQuotationById: _ref => {
|
|
68
|
+
let {
|
|
69
|
+
payload,
|
|
70
|
+
id
|
|
71
|
+
} = _ref;
|
|
72
|
+
return authenticateClient("api/v1/quotations/".concat(id), {
|
|
73
|
+
method: 'PUT',
|
|
74
|
+
data: payload,
|
|
75
|
+
headers: {
|
|
76
|
+
'Content-Type': 'application/json'
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
putAppointmentById: _ref2 => {
|
|
81
|
+
let {
|
|
82
|
+
payload,
|
|
83
|
+
id
|
|
84
|
+
} = _ref2;
|
|
85
|
+
return authenticateClient("api/v1/appointments/".concat(id), {
|
|
86
|
+
method: 'PUT',
|
|
87
|
+
data: payload,
|
|
88
|
+
headers: {
|
|
89
|
+
'Content-Type': 'application/json'
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
58
93
|
};
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.useUpdatePrivateQuotationByIdMutation = exports.useUpdatePrivateAppointmentByIdMutation = exports.useCreateQuotationMutation = exports.useCreatePrivateQuotationMutation = exports.useCreatePrivateAppointmentMutation = exports.useCreateAppointmentRequestMutation = void 0;
|
|
7
7
|
var _reactQuery = require("react-query");
|
|
8
8
|
var _authenticatedProxyApi = require("./authenticatedProxyApi");
|
|
9
9
|
var _publicProxyApi = require("./publicProxyApi");
|
|
10
10
|
/**
|
|
11
11
|
* @description Creates a quotation
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const useCreateQuotationMutation = () => {
|
|
14
14
|
const createQuotationMutation = (0, _reactQuery.useMutation)(_ref => {
|
|
15
15
|
let {
|
|
16
16
|
licensePlate,
|
|
@@ -51,8 +51,8 @@ const useSubmitQuotationMutation = () => {
|
|
|
51
51
|
/**
|
|
52
52
|
* @description Creates an appointment request
|
|
53
53
|
*/
|
|
54
|
-
exports.
|
|
55
|
-
const
|
|
54
|
+
exports.useCreateQuotationMutation = useCreateQuotationMutation;
|
|
55
|
+
const useCreateAppointmentRequestMutation = () => {
|
|
56
56
|
const createAppointmentRequestMutation = (0, _reactQuery.useMutation)(_ref2 => {
|
|
57
57
|
let {
|
|
58
58
|
licensePlate,
|
|
@@ -92,8 +92,8 @@ const useSubmitAppointmentRequestMutation = () => {
|
|
|
92
92
|
* @description Creates a quotation within the private order API
|
|
93
93
|
* Signs the request with the accessToken
|
|
94
94
|
*/
|
|
95
|
-
exports.
|
|
96
|
-
const
|
|
95
|
+
exports.useCreateAppointmentRequestMutation = useCreateAppointmentRequestMutation;
|
|
96
|
+
const useCreatePrivateQuotationMutation = () => {
|
|
97
97
|
const createQuotationMutation = (0, _reactQuery.useMutation)(_ref3 => {
|
|
98
98
|
let {
|
|
99
99
|
vehicle,
|
|
@@ -137,8 +137,8 @@ const useSubmitPrivateQuotationMutation = () => {
|
|
|
137
137
|
* @description Creates a planned appointment within the private order API
|
|
138
138
|
* Signs the request with the accessToken
|
|
139
139
|
*/
|
|
140
|
-
exports.
|
|
141
|
-
const
|
|
140
|
+
exports.useCreatePrivateQuotationMutation = useCreatePrivateQuotationMutation;
|
|
141
|
+
const useCreatePrivateAppointmentMutation = () => {
|
|
142
142
|
const createPlannedAppointmentMutation = (0, _reactQuery.useMutation)(_ref4 => {
|
|
143
143
|
let {
|
|
144
144
|
vehicle,
|
|
@@ -177,4 +177,102 @@ const useSubmitPrivateAppointmentMutation = () => {
|
|
|
177
177
|
createPlannedAppointment: createPlannedAppointmentMutation.mutate
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
-
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @description Updates an existing quotation within the private order API
|
|
183
|
+
* Signs the request with the accessToken
|
|
184
|
+
*/
|
|
185
|
+
exports.useCreatePrivateAppointmentMutation = useCreatePrivateAppointmentMutation;
|
|
186
|
+
const useUpdatePrivateQuotationByIdMutation = id => {
|
|
187
|
+
const updateQuotationMutation = (0, _reactQuery.useMutation)(_ref5 => {
|
|
188
|
+
let {
|
|
189
|
+
vehicle,
|
|
190
|
+
customer,
|
|
191
|
+
channel,
|
|
192
|
+
licensePlate,
|
|
193
|
+
model,
|
|
194
|
+
answers,
|
|
195
|
+
cart,
|
|
196
|
+
selectBoardComputerUpdate,
|
|
197
|
+
branchId,
|
|
198
|
+
formula,
|
|
199
|
+
discount,
|
|
200
|
+
priceCalculationDate
|
|
201
|
+
} = _ref5;
|
|
202
|
+
return _authenticatedProxyApi.authenticatedProxyApi.putQuotationById({
|
|
203
|
+
id,
|
|
204
|
+
payload: {
|
|
205
|
+
model,
|
|
206
|
+
vehicle,
|
|
207
|
+
licensePlate,
|
|
208
|
+
channel,
|
|
209
|
+
formula,
|
|
210
|
+
discount,
|
|
211
|
+
answers,
|
|
212
|
+
cart,
|
|
213
|
+
selectBoardComputerUpdate,
|
|
214
|
+
customer,
|
|
215
|
+
branchId,
|
|
216
|
+
priceCalculationDate
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
return {
|
|
221
|
+
isUpdatingQuotation: updateQuotationMutation.isLoading,
|
|
222
|
+
isUpdateQuotationError: updateQuotationMutation.isError,
|
|
223
|
+
isUpdateQuotationSuccess: updateQuotationMutation.isSuccess,
|
|
224
|
+
resetQuotationUpdate: updateQuotationMutation.reset,
|
|
225
|
+
updateQuotation: updateQuotationMutation.mutate
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @description Updates an existing appointment within the private order API
|
|
231
|
+
* Signs the request with the accessToken
|
|
232
|
+
*/
|
|
233
|
+
exports.useUpdatePrivateQuotationByIdMutation = useUpdatePrivateQuotationByIdMutation;
|
|
234
|
+
const useUpdatePrivateAppointmentByIdMutation = id => {
|
|
235
|
+
const updateAppointmentByIdMutation = (0, _reactQuery.useMutation)(_ref6 => {
|
|
236
|
+
let {
|
|
237
|
+
vehicle,
|
|
238
|
+
customer,
|
|
239
|
+
channel,
|
|
240
|
+
appointment,
|
|
241
|
+
licensePlate,
|
|
242
|
+
model,
|
|
243
|
+
answers,
|
|
244
|
+
cart,
|
|
245
|
+
selectBoardComputerUpdate,
|
|
246
|
+
branchId,
|
|
247
|
+
formula,
|
|
248
|
+
discount,
|
|
249
|
+
priceCalculationDate
|
|
250
|
+
} = _ref6;
|
|
251
|
+
return _authenticatedProxyApi.authenticatedProxyApi.putAppointmentById({
|
|
252
|
+
id,
|
|
253
|
+
payload: {
|
|
254
|
+
appointment,
|
|
255
|
+
model,
|
|
256
|
+
vehicle,
|
|
257
|
+
licensePlate,
|
|
258
|
+
channel,
|
|
259
|
+
formula,
|
|
260
|
+
discount,
|
|
261
|
+
answers,
|
|
262
|
+
cart,
|
|
263
|
+
selectBoardComputerUpdate,
|
|
264
|
+
customer,
|
|
265
|
+
branchId,
|
|
266
|
+
priceCalculationDate
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
isUpdatingAppointment: updateAppointmentByIdMutation.isLoading,
|
|
272
|
+
isUpdateAppointmentError: updateAppointmentByIdMutation.isError,
|
|
273
|
+
isUpdateAppointmentSuccess: updateAppointmentByIdMutation.isSuccess,
|
|
274
|
+
resetAppointmentUpdate: updateAppointmentByIdMutation.reset,
|
|
275
|
+
updateAppointment: updateAppointmentByIdMutation.mutate
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
exports.useUpdatePrivateAppointmentByIdMutation = useUpdatePrivateAppointmentByIdMutation;
|
|
@@ -8,7 +8,7 @@ require("core-js/modules/web.url-search-params.js");
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
-
exports.useQuestionsQuery = exports.useProductsQuery = exports.useProductFieldLabels = exports.useMyBranches = exports.useModelsQuery = exports.useMarketingChannels = exports.useBuildYearsQuery = exports.useBrandsQuery = exports.useBranchesQuery = exports.useBranchTypes = exports.useBranchByIdOrWidgetId = void 0;
|
|
11
|
+
exports.useQuestionsQuery = exports.useProductsQuery = exports.useProductFieldLabels = exports.usePrivateDossierByTypeAndIdQuery = exports.useMyBranches = exports.useModelsQuery = exports.useMarketingChannels = exports.useBuildYearsQuery = exports.useBrandsQuery = exports.useBranchesQuery = exports.useBranchTypes = exports.useBranchByIdOrWidgetId = void 0;
|
|
12
12
|
require("core-js/modules/es.symbol.description.js");
|
|
13
13
|
require("core-js/modules/es.json.stringify.js");
|
|
14
14
|
require("core-js/modules/es.regexp.to-string.js");
|
|
@@ -275,4 +275,52 @@ const useBranchTypes = () => {
|
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
-
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @description retrieves a private dossier by the provided Id and its type
|
|
281
|
+
* Available types: Quotation, appointment request and planned appointment.
|
|
282
|
+
*/
|
|
283
|
+
exports.useBranchTypes = useBranchTypes;
|
|
284
|
+
const usePrivateDossierByTypeAndIdQuery = _ref3 => {
|
|
285
|
+
let {
|
|
286
|
+
dossierId,
|
|
287
|
+
dossierType
|
|
288
|
+
} = _ref3;
|
|
289
|
+
const dossierByIdQuery = (0, _reactQuery.useQuery)([dossierType, dossierId], {
|
|
290
|
+
enabled: !!dossierId && !!dossierType,
|
|
291
|
+
queryFn: () => {
|
|
292
|
+
let dossierFetchFn;
|
|
293
|
+
|
|
294
|
+
// Note: Get the handler of the dossier by its type
|
|
295
|
+
switch (dossierType) {
|
|
296
|
+
case _constants__.DOSSIER_TYPES.Quotation:
|
|
297
|
+
{
|
|
298
|
+
dossierFetchFn = _authenticatedProxyApi.authenticatedProxyApi.getQuotationById;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
case _constants__.DOSSIER_TYPES.AppointmentRequest:
|
|
302
|
+
{
|
|
303
|
+
dossierFetchFn = _authenticatedProxyApi.authenticatedProxyApi.getAppointmentRequestById;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
case _constants__.DOSSIER_TYPES.PlannedAppointment:
|
|
307
|
+
{
|
|
308
|
+
dossierFetchFn = _authenticatedProxyApi.authenticatedProxyApi.getPlannedAppointmentById;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
default:
|
|
312
|
+
{
|
|
313
|
+
console.error('Unsupported dossier type: ', dossierType);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return dossierFetchFn(dossierId).then(res => res.data);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
return {
|
|
321
|
+
isDossierByIdError: dossierByIdQuery.isError,
|
|
322
|
+
isLoadingDossier: dossierByIdQuery.isLoading,
|
|
323
|
+
dossierById: dossierByIdQuery === null || dossierByIdQuery === void 0 ? void 0 : dossierByIdQuery.data
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
exports.usePrivateDossierByTypeAndIdQuery = usePrivateDossierByTypeAndIdQuery;
|
|
@@ -72,7 +72,7 @@ const DatePickerInput = _ref => {
|
|
|
72
72
|
className: (0, _helpers__.withStyle)('form-group')
|
|
73
73
|
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
74
74
|
htmlFor: name,
|
|
75
|
-
className: (0, _helpers__.withStyle)('form-label')
|
|
75
|
+
className: (0, _helpers__.withStyle)('form-label text-black')
|
|
76
76
|
}, label, isRequired && /*#__PURE__*/_react.default.createElement("span", null, "*")), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
77
|
className: "".concat((0, _helpers__.withStyle)('form-group__icon'), " ").concat(isTouched && errorMessage ? (0, _helpers__.withStyle)('is-invalid') : '')
|
|
78
78
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
@@ -27,7 +27,7 @@ const Header = _ref => {
|
|
|
27
27
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
28
|
className: (0, _helpers__.withStyle)('row')
|
|
29
29
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
-
className: (0, _helpers__.withStyle)('col')
|
|
30
|
+
className: (0, _helpers__.withStyle)('col hero__logo-container')
|
|
31
31
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
32
32
|
className: (0, _helpers__.withStyle)('hero__logo'),
|
|
33
33
|
src: formula === _constants__.CONFIGURATOR_FORMULAS.THC ? _logoThcWhite.default : _logoPrimaryIcon.default,
|
|
@@ -54,12 +54,14 @@ const ProductCardUSPS = _ref4 => {
|
|
|
54
54
|
case 'incl':
|
|
55
55
|
{
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(ProductCardUspInclude, {
|
|
57
|
+
key: text,
|
|
57
58
|
text: text
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
case 'excl':
|
|
61
62
|
{
|
|
62
63
|
return /*#__PURE__*/_react.default.createElement(ProductCardUspExclude, {
|
|
64
|
+
key: text,
|
|
63
65
|
text: text
|
|
64
66
|
});
|
|
65
67
|
}
|
|
@@ -67,6 +69,7 @@ const ProductCardUSPS = _ref4 => {
|
|
|
67
69
|
case 'remark':
|
|
68
70
|
{
|
|
69
71
|
return /*#__PURE__*/_react.default.createElement(ProductCardUspRemark, {
|
|
72
|
+
key: text,
|
|
70
73
|
text: text
|
|
71
74
|
});
|
|
72
75
|
}
|
|
@@ -44,13 +44,18 @@ function _interopRequireWildcard(e, r) {
|
|
|
44
44
|
}
|
|
45
45
|
return n.default = e, t && t.set(e, n), n;
|
|
46
46
|
}
|
|
47
|
-
const FullPageSpinner =
|
|
47
|
+
const FullPageSpinner = _ref => {
|
|
48
|
+
let {
|
|
49
|
+
children
|
|
50
|
+
} = _ref;
|
|
48
51
|
const [hasRendered, setHasRendered] = (0, _react.useState)();
|
|
49
52
|
const formula = (0, _FormulaContext.useFormula)();
|
|
50
53
|
(0, _react.useEffect)(() => {
|
|
51
54
|
setHasRendered(true);
|
|
52
55
|
}, []);
|
|
53
56
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: (0, _helpers__.withStyle)('thm-configurator')
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
54
59
|
className: (0, _helpers__.withStyle)("loader ".concat(formula === _constants__.CONFIGURATOR_FORMULAS.THC ? 'thc' : ''))
|
|
55
60
|
}, hasRendered !== true ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("i", {
|
|
56
61
|
className: (0, _helpers__.withStyle)('loader__icon')
|
|
@@ -58,10 +63,10 @@ const FullPageSpinner = () => {
|
|
|
58
63
|
className: (0, _helpers__.withStyle)('loader__icon')
|
|
59
64
|
}, ' ', /*#__PURE__*/_react.default.createElement("i", {
|
|
60
65
|
className: "fas fa-cog fa-spin"
|
|
61
|
-
}), ' '), /*#__PURE__*/_react.default.createElement("img", {
|
|
66
|
+
}), ' '), children ? children : /*#__PURE__*/_react.default.createElement("img", {
|
|
62
67
|
className: (0, _helpers__.withStyle)('loader__logo'),
|
|
63
68
|
src: formula === _constants__.CONFIGURATOR_FORMULAS.THC ? _logoThcWhite.default : _logoWhite.default,
|
|
64
69
|
alt: "Trekhaak Montage - Configurator"
|
|
65
|
-
}));
|
|
70
|
+
})), ' ');
|
|
66
71
|
};
|
|
67
72
|
var _default = exports.default = FullPageSpinner;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VEHICLE_OWNERSHIP_TYPE = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.PRODUCT_CATEGORIES = exports.ORDER_SESSION_KEY = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCALE = exports.FORM_ERROR_MESSAGES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
6
|
+
exports.VEHICLE_OWNERSHIP_TYPE = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.PRODUCT_CATEGORIES = exports.ORDER_SESSION_KEY = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCALE = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
7
7
|
const USER_GEOLOCATION_KEY = exports.USER_GEOLOCATION_KEY = '_userGeolocation';
|
|
8
8
|
const FORM_ERROR_MESSAGES = exports.FORM_ERROR_MESSAGES = {
|
|
9
9
|
required: 'Verplicht',
|
|
@@ -126,4 +126,9 @@ const VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = {
|
|
|
126
126
|
const DISCOUNT_TYPES = exports.DISCOUNT_TYPES = {
|
|
127
127
|
Percentage: '%',
|
|
128
128
|
Amount: '€'
|
|
129
|
+
};
|
|
130
|
+
const DOSSIER_TYPES = exports.DOSSIER_TYPES = {
|
|
131
|
+
Quotation: 'quotation',
|
|
132
|
+
AppointmentRequest: 'appointment-request',
|
|
133
|
+
PlannedAppointment: 'appointment'
|
|
129
134
|
};
|
|
@@ -64,7 +64,8 @@ const ANWBMembershipValidator = () => {
|
|
|
64
64
|
selectedTowbar,
|
|
65
65
|
discountCode,
|
|
66
66
|
executionAnswer1,
|
|
67
|
-
executionAnswer2
|
|
67
|
+
executionAnswer2,
|
|
68
|
+
priceCalculationDate
|
|
68
69
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
69
70
|
const [isNumberValid, setIsNumberValid] = (0, _react.useState)();
|
|
70
71
|
const formula = (0, _FormulaContext.useFormula)();
|
|
@@ -89,7 +90,8 @@ const ANWBMembershipValidator = () => {
|
|
|
89
90
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
90
91
|
cart: cartInput ? JSON.stringify(cartInput) : undefined,
|
|
91
92
|
formula,
|
|
92
|
-
discountCode
|
|
93
|
+
discountCode,
|
|
94
|
+
priceCalculationDate
|
|
93
95
|
});
|
|
94
96
|
const handleMembershipChange = number => {
|
|
95
97
|
dispatch({
|
|
@@ -132,6 +132,7 @@ const AppointmentForm = () => {
|
|
|
132
132
|
discountCode,
|
|
133
133
|
executionAnswer1,
|
|
134
134
|
executionAnswer2,
|
|
135
|
+
priceCalculationDate,
|
|
135
136
|
selectedDiscountedProducts = []
|
|
136
137
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
137
138
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
@@ -141,7 +142,7 @@ const AppointmentForm = () => {
|
|
|
141
142
|
isCreatingAppointmentRequest,
|
|
142
143
|
isCreateAppointmentRequestError,
|
|
143
144
|
createAppointmentRequest
|
|
144
|
-
} = (0, _mutations.
|
|
145
|
+
} = (0, _mutations.useCreateAppointmentRequestMutation)();
|
|
145
146
|
const formula = (0, _FormulaContext.useFormula)();
|
|
146
147
|
const history = (0, _reactRouter.useHistory)();
|
|
147
148
|
const {
|
|
@@ -154,7 +155,8 @@ const AppointmentForm = () => {
|
|
|
154
155
|
executionAnswer2,
|
|
155
156
|
durationAnswer: durationAnswer,
|
|
156
157
|
formula,
|
|
157
|
-
discountCode
|
|
158
|
+
discountCode,
|
|
159
|
+
priceCalculationDate
|
|
158
160
|
});
|
|
159
161
|
const handleSubmit = async () => {
|
|
160
162
|
try {
|
|
@@ -14,6 +14,7 @@ var _NavigationButton = _interopRequireDefault(require("../__components__/Button
|
|
|
14
14
|
var _constants__ = require("../__constants__");
|
|
15
15
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
16
16
|
var _helpers__ = require("../__helpers__");
|
|
17
|
+
var _InternalPriceCalculationSelector = _interopRequireDefault(require("./internal/InternalPriceCalculationSelector"));
|
|
17
18
|
const _excluded = ["type"];
|
|
18
19
|
function _interopRequireDefault(obj) {
|
|
19
20
|
return obj && obj.__esModule ? obj : {
|
|
@@ -107,7 +108,9 @@ const BottomNavigationBar = () => {
|
|
|
107
108
|
className: (0, _helpers__.withStyle)('container justify-content-center')
|
|
108
109
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
110
|
className: (0, _helpers__.withStyle)('row justify-content-center')
|
|
110
|
-
},
|
|
111
|
+
}, APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: (0, _helpers__.withStyle)('col-12 mt-2 mb-1')
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_InternalPriceCalculationSelector.default, null)), buttons.map(_ref2 => {
|
|
111
114
|
var _history$location2;
|
|
112
115
|
let {
|
|
113
116
|
to,
|
|
@@ -24,6 +24,7 @@ const DiscountProductsSelector = () => {
|
|
|
24
24
|
durationAnswer,
|
|
25
25
|
executionAnswer1,
|
|
26
26
|
executionAnswer2,
|
|
27
|
+
priceCalculationDate,
|
|
27
28
|
discountCode,
|
|
28
29
|
selectedDiscountedProducts
|
|
29
30
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
@@ -37,6 +38,7 @@ const DiscountProductsSelector = () => {
|
|
|
37
38
|
executionAnswer2,
|
|
38
39
|
durationAnswer: durationAnswer,
|
|
39
40
|
formula,
|
|
41
|
+
priceCalculationDate,
|
|
40
42
|
discountCode
|
|
41
43
|
});
|
|
42
44
|
const handleProductUpdated = _ref => {
|
|
@@ -118,7 +118,7 @@ const ExitIntentModal = () => {
|
|
|
118
118
|
createQuotation,
|
|
119
119
|
isCreateQuotationSuccess,
|
|
120
120
|
isCreatingQuotation
|
|
121
|
-
} = (0, _mutations.
|
|
121
|
+
} = (0, _mutations.useCreateQuotationMutation)();
|
|
122
122
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
123
123
|
const [errors, setErrors] = (0, _react.useState)(null);
|
|
124
124
|
const [{
|
|
@@ -134,6 +134,7 @@ const ExitIntentModal = () => {
|
|
|
134
134
|
discountCode,
|
|
135
135
|
executionAnswer1,
|
|
136
136
|
executionAnswer2,
|
|
137
|
+
priceCalculationDate,
|
|
137
138
|
selectedDiscountedProducts = []
|
|
138
139
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
139
140
|
const formula = (0, _FormulaContext.useFormula)();
|
|
@@ -146,7 +147,8 @@ const ExitIntentModal = () => {
|
|
|
146
147
|
executionAnswer2,
|
|
147
148
|
durationAnswer: durationAnswer,
|
|
148
149
|
formula,
|
|
149
|
-
discountCode
|
|
150
|
+
discountCode,
|
|
151
|
+
priceCalculationDate
|
|
150
152
|
});
|
|
151
153
|
const handleMouseLeave = event => {
|
|
152
154
|
if (document.cookie.includes('exitIntentModalShown=true')) {
|
|
@@ -70,6 +70,7 @@ const ProductCartSide = () => {
|
|
|
70
70
|
return /*#__PURE__*/_react.default.createElement(_ProductTableEditableRow.default, {
|
|
71
71
|
productTitle: title,
|
|
72
72
|
productImage: image,
|
|
73
|
+
key: title,
|
|
73
74
|
extraCells: [{}, {
|
|
74
75
|
text: (0, _helpers__.formatPrice)(price),
|
|
75
76
|
className: 'cart__table-purchase-price text-end'
|
|
@@ -58,7 +58,8 @@ const ProductDiscountCard = () => {
|
|
|
58
58
|
durationAnswer,
|
|
59
59
|
executionAnswer1,
|
|
60
60
|
executionAnswer2,
|
|
61
|
-
discountCode
|
|
61
|
+
discountCode,
|
|
62
|
+
priceCalculationDate
|
|
62
63
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
63
64
|
const formula = (0, _FormulaContext.useFormula)();
|
|
64
65
|
const {
|
|
@@ -71,7 +72,8 @@ const ProductDiscountCard = () => {
|
|
|
71
72
|
executionAnswer2,
|
|
72
73
|
durationAnswer: durationAnswer,
|
|
73
74
|
formula,
|
|
74
|
-
discountCode
|
|
75
|
+
discountCode,
|
|
76
|
+
priceCalculationDate
|
|
75
77
|
});
|
|
76
78
|
|
|
77
79
|
/**
|
|
@@ -72,7 +72,8 @@ const ProductsOverview = () => {
|
|
|
72
72
|
selectedCombiset,
|
|
73
73
|
selectedBoardComputer,
|
|
74
74
|
isBoardComputerDeselected,
|
|
75
|
-
discountCode
|
|
75
|
+
discountCode,
|
|
76
|
+
priceCalculationDate
|
|
76
77
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
77
78
|
const cartInput = (0, _product.validateCartInput)([{
|
|
78
79
|
articleNumber: selectedCableset,
|
|
@@ -97,7 +98,8 @@ const ProductsOverview = () => {
|
|
|
97
98
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
98
99
|
cart: cartInput ? JSON.stringify(cartInput) : undefined,
|
|
99
100
|
formula,
|
|
100
|
-
discountCode
|
|
101
|
+
discountCode,
|
|
102
|
+
priceCalculationDate
|
|
101
103
|
});
|
|
102
104
|
if (isLoadingProducts && isProductsInitialLoad.current === true) {
|
|
103
105
|
isProductsInitialLoad.current = false;
|
|
@@ -63,7 +63,8 @@ const QuestionsForm = _ref => {
|
|
|
63
63
|
discountCode,
|
|
64
64
|
execution1Options,
|
|
65
65
|
execution2Options,
|
|
66
|
-
durationOptions
|
|
66
|
+
durationOptions,
|
|
67
|
+
priceCalculationDate
|
|
67
68
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
68
69
|
const formula = (0, _FormulaContext.useFormula)();
|
|
69
70
|
const {
|
|
@@ -81,20 +82,19 @@ const QuestionsForm = _ref => {
|
|
|
81
82
|
executionAnswer2,
|
|
82
83
|
durationAnswer: durationAnswer
|
|
83
84
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
(0, _queries.useProductsQuery)({
|
|
86
|
+
licensePlate,
|
|
87
|
+
model,
|
|
88
|
+
executionAnswer1,
|
|
89
|
+
executionAnswer2,
|
|
90
|
+
durationAnswer,
|
|
91
|
+
formula,
|
|
92
|
+
discountCode,
|
|
93
|
+
priceCalculationDate
|
|
94
|
+
}); // Prefetch
|
|
94
95
|
|
|
95
96
|
(0, _react.useEffect)(() => {
|
|
96
97
|
if (durationQuestion !== null && durationQuestion !== void 0 && durationQuestion.length) {
|
|
97
|
-
console.log('Retry');
|
|
98
98
|
dispatch({
|
|
99
99
|
type: _OrderSessionContext.orderSessionActions.SET_DURATION_OPTIONS,
|
|
100
100
|
payload: {
|
|
@@ -136,7 +136,7 @@ const QuotationForm = () => {
|
|
|
136
136
|
isCreateQuotationSuccess,
|
|
137
137
|
isCreateQuotationError,
|
|
138
138
|
isCreatingQuotation
|
|
139
|
-
} = (0, _mutations.
|
|
139
|
+
} = (0, _mutations.useCreateQuotationMutation)();
|
|
140
140
|
const formula = (0, _FormulaContext.useFormula)();
|
|
141
141
|
const {
|
|
142
142
|
vehicleDetails,
|
|
@@ -29,7 +29,8 @@ const VehicleData = () => {
|
|
|
29
29
|
executionAnswer1,
|
|
30
30
|
executionAnswer2,
|
|
31
31
|
durationAnswer,
|
|
32
|
-
discountCode
|
|
32
|
+
discountCode,
|
|
33
|
+
priceCalculationDate
|
|
33
34
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
34
35
|
const formula = (0, _FormulaContext.useFormula)();
|
|
35
36
|
const {
|
|
@@ -42,7 +43,8 @@ const VehicleData = () => {
|
|
|
42
43
|
executionAnswer2,
|
|
43
44
|
durationAnswer: durationAnswer,
|
|
44
45
|
formula,
|
|
45
|
-
discountCode
|
|
46
|
+
discountCode,
|
|
47
|
+
priceCalculationDate
|
|
46
48
|
});
|
|
47
49
|
const history = (0, _reactRouter.useHistory)();
|
|
48
50
|
return /*#__PURE__*/_react.default.createElement(_ExpandableCard.default, {
|