thm-p3-configurator 0.0.248 → 0.0.249
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/__api__/queries.js +1 -1
- package/dist/src/shared/__constants__/index.js +41 -2
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +8 -4
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +8 -4
- package/dist/src/shared/__helpers__/singleOrderArticles.js +9 -4
- package/dist/src/shared/__hooks__/useBranchTheme.js +5 -0
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +8 -4
- package/package.json +1 -1
package/dist/src/shared/App.js
CHANGED
|
@@ -75,6 +75,6 @@ const App = () => {
|
|
|
75
75
|
defaultCountry: APP_CONFIG.country
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
|
|
77
77
|
client: _queryClient.default
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), /*#__PURE__*/_react.default.createElement(
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), APP_CONFIG.nodeEnv === 'development' && APP_CONFIG.internal === true && /*#__PURE__*/_react.default.createElement(_TEST_ONLY_INTERNAL_ROUTES.default, null))))))))));
|
|
79
79
|
};
|
|
80
80
|
var _default = exports.default = App;
|
|
@@ -690,7 +690,7 @@ const useMyBranches = formula => {
|
|
|
690
690
|
const authSession = _LocalStorageWorker.lsw.get(_constants__.AUTH_SESSION_KEY);
|
|
691
691
|
const myBranchesQuery = (0, _reactQuery.useQuery)({
|
|
692
692
|
queryKey: ['me', 'branches', authSession, formula],
|
|
693
|
-
queryFn: () => _authenticatedProxyApi.authenticatedProxyApi.getMyBranchesByFormula(formula).then(userRes => userRes.data),
|
|
693
|
+
queryFn: () => _authenticatedProxyApi.authenticatedProxyApi.getMyBranchesByFormula(formula === _constants__.CONFIGURATOR_FORMULAS.THM ? _constants__.CONFIGURATOR_FORMULAS.TM : formula).then(userRes => userRes.data),
|
|
694
694
|
enabled: !!authSession && !!formula
|
|
695
695
|
});
|
|
696
696
|
return {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_CHANNEL_TITLE = exports.ORDER_SESSION_KEY = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BRANCH_THEME_BY_FORMULA = exports.BRANCH_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
6
|
+
exports.mapBranchFormulaToConfiguratorFormula = exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_CHANNEL_TITLE = exports.ORDER_SESSION_KEY = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BRANCH_THEME_BY_FORMULA = exports.BRANCH_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
7
7
|
const DOSSIER_TYPES = exports.DOSSIER_TYPES = {
|
|
8
8
|
Quotation: 'quotation',
|
|
9
9
|
AppointmentRequest: 'appointment-request',
|
|
@@ -212,7 +212,10 @@ const StockStatus = exports.StockStatus = {
|
|
|
212
212
|
const CONFIGURATOR_FORMULAS = exports.CONFIGURATOR_FORMULAS = {
|
|
213
213
|
THM: 'THM',
|
|
214
214
|
THC: 'THC',
|
|
215
|
-
TMG: 'TMG'
|
|
215
|
+
TMG: 'TMG',
|
|
216
|
+
TM: 'TMG',
|
|
217
|
+
TH: 'TH',
|
|
218
|
+
TowMotive: 'TowMotive'
|
|
216
219
|
};
|
|
217
220
|
const NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = {
|
|
218
221
|
[CONFIGURATOR_FORMULAS.THM]: {
|
|
@@ -235,10 +238,46 @@ const NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NO_PRODUCTS_CONTACT_DETAI
|
|
|
235
238
|
phoneHref: 'tel:+31852030167',
|
|
236
239
|
companyName: 'TowMotive Group',
|
|
237
240
|
logoAltText: 'TowMotive Group Logo'
|
|
241
|
+
},
|
|
242
|
+
[CONFIGURATOR_FORMULAS.TH]: {
|
|
243
|
+
email: 'order@towmotivegroup.com',
|
|
244
|
+
phoneDisplay: '+31 85 - 203 0167',
|
|
245
|
+
phoneHref: 'tel:+31852030167',
|
|
246
|
+
companyName: 'TowMotive Group',
|
|
247
|
+
logoAltText: 'TowMotive Group Logo'
|
|
248
|
+
},
|
|
249
|
+
[CONFIGURATOR_FORMULAS.TowMotive]: {
|
|
250
|
+
email: 'order@towmotivegroup.com',
|
|
251
|
+
phoneDisplay: '+31 85 - 203 0167',
|
|
252
|
+
phoneHref: 'tel:+31852030167',
|
|
253
|
+
companyName: 'TowMotive Group',
|
|
254
|
+
logoAltText: 'TowMotive Group Logo'
|
|
238
255
|
}
|
|
239
256
|
};
|
|
240
257
|
const LOCATION_CHANGE_BUTTON_LABEL = exports.LOCATION_CHANGE_BUTTON_LABEL = 'Wijzig de locatie';
|
|
241
258
|
const TMG_ORGANIZATION_TYPE = exports.TMG_ORGANIZATION_TYPE = 'TowMotive Group';
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Maps branch formula values to CONFIGURATOR_FORMULAS
|
|
262
|
+
*/
|
|
263
|
+
const mapBranchFormulaToConfiguratorFormula = branchFormula => {
|
|
264
|
+
if (!branchFormula) return CONFIGURATOR_FORMULAS.THM;
|
|
265
|
+
switch (branchFormula.toLowerCase()) {
|
|
266
|
+
case 'towmotive':
|
|
267
|
+
case 'th':
|
|
268
|
+
return CONFIGURATOR_FORMULAS.TowMotive;
|
|
269
|
+
case 'tmg':
|
|
270
|
+
return CONFIGURATOR_FORMULAS.TMG;
|
|
271
|
+
case 'thc':
|
|
272
|
+
return CONFIGURATOR_FORMULAS.THC;
|
|
273
|
+
case 'thm':
|
|
274
|
+
case 'trekhaakmontage':
|
|
275
|
+
return CONFIGURATOR_FORMULAS.THM;
|
|
276
|
+
default:
|
|
277
|
+
return CONFIGURATOR_FORMULAS.THM;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
exports.mapBranchFormulaToConfiguratorFormula = mapBranchFormulaToConfiguratorFormula;
|
|
242
281
|
const LOCATION_TYPE = exports.LOCATION_TYPE = 'Vestiging';
|
|
243
282
|
const ANWB_DISCOUNT_CODE = exports.ANWB_DISCOUNT_CODE = 'ANWBTHC25';
|
|
244
283
|
const AUTH_SESSION_KEY = exports.AUTH_SESSION_KEY = '__authSession';
|
|
@@ -361,7 +361,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
361
361
|
isTmg: isTmg
|
|
362
362
|
}
|
|
363
363
|
});
|
|
364
|
-
await onSubmit((0, _helpers__.removeNullishProps)({
|
|
364
|
+
await onSubmit((0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({
|
|
365
365
|
vehicle,
|
|
366
366
|
customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
|
|
367
367
|
firstName: (_customer$firstName = customer === null || customer === void 0 ? void 0 : customer.firstName) !== null && _customer$firstName !== void 0 ? _customer$firstName : undefined,
|
|
@@ -397,8 +397,12 @@ const InternalAppointmentForm = _ref => {
|
|
|
397
397
|
code: discountCode,
|
|
398
398
|
amount: discountAmount,
|
|
399
399
|
percentage: discountPercentage
|
|
400
|
-
})
|
|
401
|
-
|
|
400
|
+
})
|
|
401
|
+
}, formula === _constants__.CONFIGURATOR_FORMULAS.THM ? {
|
|
402
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.TM
|
|
403
|
+
} : {
|
|
404
|
+
formula
|
|
405
|
+
}), {}, {
|
|
402
406
|
branchId: selectedBranch,
|
|
403
407
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
404
408
|
cart: (0, _product.validateCartInput)([{
|
|
@@ -417,7 +421,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
417
421
|
quantity: extraQuantity
|
|
418
422
|
};
|
|
419
423
|
}), ...selectedDiscountedProducts])
|
|
420
|
-
}));
|
|
424
|
+
})));
|
|
421
425
|
} catch (ex) {
|
|
422
426
|
console.error("handleSubmit(): ".concat(ex));
|
|
423
427
|
setErrors(function () {
|
|
@@ -339,7 +339,7 @@ const InternalQuotationForm = _ref => {
|
|
|
339
339
|
isTmg
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
-
await onSubmit((0, _helpers__.removeNullishProps)({
|
|
342
|
+
await onSubmit((0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({
|
|
343
343
|
vehicle,
|
|
344
344
|
customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
|
|
345
345
|
firstName: (_customer$firstName = customer === null || customer === void 0 ? void 0 : customer.firstName) !== null && _customer$firstName !== void 0 ? _customer$firstName : undefined,
|
|
@@ -369,8 +369,12 @@ const InternalQuotationForm = _ref => {
|
|
|
369
369
|
amount: discountAmount,
|
|
370
370
|
percentage: discountPercentage
|
|
371
371
|
}),
|
|
372
|
-
priceCalculationDate
|
|
373
|
-
|
|
372
|
+
priceCalculationDate
|
|
373
|
+
}, formula === _constants__.CONFIGURATOR_FORMULAS.THM ? {
|
|
374
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.TM
|
|
375
|
+
} : {
|
|
376
|
+
formula
|
|
377
|
+
}), {}, {
|
|
374
378
|
branchId: selectedBranch,
|
|
375
379
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
376
380
|
cart: (0, _product.validateCartInput)([{
|
|
@@ -389,7 +393,7 @@ const InternalQuotationForm = _ref => {
|
|
|
389
393
|
quantity: extraQuantity
|
|
390
394
|
};
|
|
391
395
|
}), ...selectedDiscountedProducts])
|
|
392
|
-
}));
|
|
396
|
+
})));
|
|
393
397
|
} catch (ex) {
|
|
394
398
|
console.error("handleSubmit(): ".concat(ex));
|
|
395
399
|
setErrors(function () {
|
|
@@ -187,11 +187,15 @@ const fetchArticlesByArticleNumbers = exports.fetchArticlesByArticleNumbers = as
|
|
|
187
187
|
const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetchPartStockLevels(part, branchId) {
|
|
188
188
|
var _response$data$data;
|
|
189
189
|
let formula = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
190
|
-
const partParamsString = new URLSearchParams((0, _index.removeNullishProps)({
|
|
191
|
-
branchId
|
|
192
|
-
|
|
190
|
+
const partParamsString = new URLSearchParams((0, _index.removeNullishProps)(_objectSpread(_objectSpread({
|
|
191
|
+
branchId
|
|
192
|
+
}, formula != undefined && formula === _index2.CONFIGURATOR_FORMULAS.THM ? {
|
|
193
|
+
formula: _index2.CONFIGURATOR_FORMULAS.TM
|
|
194
|
+
} : {
|
|
195
|
+
formula
|
|
196
|
+
}), {}, {
|
|
193
197
|
parts: JSON.stringify([part])
|
|
194
|
-
})).toString();
|
|
198
|
+
}))).toString();
|
|
195
199
|
const response = await _authenticatedProxyApi.authenticatedProxyApi.getArticlePrices(partParamsString);
|
|
196
200
|
if (!(response !== null && response !== void 0 && response.data)) {
|
|
197
201
|
throw new Error('No response from the API');
|
|
@@ -213,6 +217,7 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
|
|
|
213
217
|
const articleBrandQueryString = new URLSearchParams({
|
|
214
218
|
articleNumbers: JSON.stringify(articleNumbers)
|
|
215
219
|
}).toString();
|
|
220
|
+
formula = formula === _index2.CONFIGURATOR_FORMULAS.THM ? _index2.CONFIGURATOR_FORMULAS.TM : formula;
|
|
216
221
|
const brandResponse = await _authenticatedProxyApi.authenticatedProxyApi.getBrandsByArticleNumbers(articleBrandQueryString);
|
|
217
222
|
if (!(brandResponse !== null && brandResponse !== void 0 && brandResponse.data)) {
|
|
218
223
|
throw new Error('Failed to fetch the brands of the articles');
|
|
@@ -23,14 +23,19 @@ const useBranchTheme = () => {
|
|
|
23
23
|
}
|
|
24
24
|
switch (formula) {
|
|
25
25
|
case _constants__.BRANCH_FORMULAS.Trekhaakmontage:
|
|
26
|
+
case _constants__.CONFIGURATOR_FORMULAS.THM:
|
|
26
27
|
{
|
|
27
28
|
return _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakmontage;
|
|
28
29
|
}
|
|
29
30
|
case _constants__.BRANCH_FORMULAS.Trekhaakcentrum:
|
|
31
|
+
case _constants__.CONFIGURATOR_FORMULAS.THC:
|
|
30
32
|
{
|
|
31
33
|
return _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum;
|
|
32
34
|
}
|
|
33
35
|
case _constants__.BRANCH_FORMULAS.TowMotiveGroup:
|
|
36
|
+
case _constants__.CONFIGURATOR_FORMULAS.TMG:
|
|
37
|
+
case _constants__.CONFIGURATOR_FORMULAS.TH:
|
|
38
|
+
case _constants__.CONFIGURATOR_FORMULAS.TowMotive:
|
|
34
39
|
{
|
|
35
40
|
return _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup;
|
|
36
41
|
}
|
|
@@ -349,18 +349,22 @@ const InternalSingleOrderPage = () => {
|
|
|
349
349
|
var _response$data2;
|
|
350
350
|
// Regular flow for offline orders
|
|
351
351
|
const preferredDateTime = appointment !== null && appointment !== void 0 && appointment.date && appointment !== null && appointment !== void 0 && appointment.time ? (0, _helpers__.parseDateAndTimeToTimestamp)(appointment === null || appointment === void 0 ? void 0 : appointment.date, appointment === null || appointment === void 0 ? void 0 : appointment.time) : null;
|
|
352
|
-
const response = await createSingleOrder({
|
|
352
|
+
const response = await createSingleOrder(_objectSpread(_objectSpread({
|
|
353
353
|
licensePlate: filters.licensePlate,
|
|
354
354
|
model: filters.model,
|
|
355
355
|
cart: singleOrderCart,
|
|
356
356
|
vehicle: vehiclePayload,
|
|
357
|
-
customer
|
|
358
|
-
|
|
357
|
+
customer
|
|
358
|
+
}, formula === _constants__.CONFIGURATOR_FORMULAS.THM ? {
|
|
359
|
+
formula: _constants__.CONFIGURATOR_FORMULAS.TM
|
|
360
|
+
} : {
|
|
361
|
+
formula
|
|
362
|
+
}), {}, {
|
|
359
363
|
branchId: selectedBranch,
|
|
360
364
|
channel,
|
|
361
365
|
preferredDateTime,
|
|
362
366
|
internalNote: internalNote === null || internalNote === void 0 ? void 0 : internalNote.internalNote
|
|
363
|
-
});
|
|
367
|
+
}));
|
|
364
368
|
if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2 = _response$data2.data) !== null && _response$data2 !== void 0 && _response$data2.entityId) {
|
|
365
369
|
setCreatedEntityId(response.data.data.entityId);
|
|
366
370
|
}
|