thm-p3-configurator 0.0.401 → 0.0.403
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/public/assets/images/tm-logo.png +0 -0
- package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +4 -15
- package/dist/src/shared/__constants__/index.js +1 -6
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +12 -23
- package/package.json +1 -1
- package/dist/public/assets/images/tm-logo-old.png +0 -0
|
Binary file
|
|
@@ -263,15 +263,10 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
263
263
|
const needsCustomerDeliveryIdentity = isDirectDeliveryEnabled;
|
|
264
264
|
const isNetherlandsSelected = (0, _react.useMemo)(() => {
|
|
265
265
|
if (!(selectedCountry !== null && selectedCountry !== void 0 && selectedCountry.label)) return false;
|
|
266
|
-
return selectedCountry.label.toUpperCase() ===
|
|
266
|
+
return selectedCountry.label.toUpperCase() === 'NEDERLAND';
|
|
267
267
|
}, [selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.label]);
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const normalizedCountryLabel = selectedCountry.label.trim().toUpperCase();
|
|
271
|
-
return normalizedCountryLabel === _constants__.COUNTRY_NAMES.BELGIUM || normalizedCountryLabel === _constants__.COUNTRY_NAMES.BELGIUM_FALLBACK;
|
|
272
|
-
}, [selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.label]);
|
|
273
|
-
const shouldRequireKvkNumber = needsCustomerDeliveryIdentity && isBusinessOwnership && (isNetherlandsSelected || !isNetherlandsSelected && !isBelgiumSelected && !(customer !== null && customer !== void 0 && (_customer$vatNumber = customer.vatNumber) !== null && _customer$vatNumber !== void 0 && _customer$vatNumber.trim()));
|
|
274
|
-
const shouldRequireVatNumber = needsCustomerDeliveryIdentity && isBusinessOwnership && (isBelgiumSelected || !isNetherlandsSelected && !isBelgiumSelected && !(customer !== null && customer !== void 0 && (_customer$kvkNumber = customer.kvkNumber) !== null && _customer$kvkNumber !== void 0 && _customer$kvkNumber.trim()));
|
|
268
|
+
const shouldRequireKvkNumber = needsCustomerDeliveryIdentity && isBusinessOwnership && (isNetherlandsSelected || !(customer !== null && customer !== void 0 && (_customer$vatNumber = customer.vatNumber) !== null && _customer$vatNumber !== void 0 && _customer$vatNumber.trim()));
|
|
269
|
+
const shouldRequireVatNumber = needsCustomerDeliveryIdentity && isBusinessOwnership && !isNetherlandsSelected && !(customer !== null && customer !== void 0 && (_customer$kvkNumber = customer.kvkNumber) !== null && _customer$kvkNumber !== void 0 && _customer$kvkNumber.trim());
|
|
275
270
|
|
|
276
271
|
// Helper to update customer data for the active ownership type
|
|
277
272
|
const updateCustomerField = (0, _react.useCallback)((field, value) => {
|
|
@@ -531,13 +526,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
531
526
|
});
|
|
532
527
|
return false;
|
|
533
528
|
}
|
|
534
|
-
if (
|
|
535
|
-
onValidationError === null || onValidationError === void 0 || onValidationError({
|
|
536
|
-
vatNumber: 'BTW-nummer is verplicht voor zakelijke dossiers in België'
|
|
537
|
-
});
|
|
538
|
-
return false;
|
|
539
|
-
}
|
|
540
|
-
if (!isNetherlandsSelected && !isBelgiumSelected && !hasKvkNumber && !hasVatNumber) {
|
|
529
|
+
if (!isNetherlandsSelected && !hasKvkNumber && !hasVatNumber) {
|
|
541
530
|
onValidationError === null || onValidationError === void 0 || onValidationError({
|
|
542
531
|
kvkNumber: 'Vul een KVK- of BTW-nummer in',
|
|
543
532
|
vatNumber: 'Vul een KVK- of BTW-nummer in'
|
|
@@ -6,7 +6,7 @@ require("core-js/modules/es.string.trim.js");
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.mapBranchFormulaToConfiguratorFormula = exports.isThcFamilyFormula = exports.getThemeFormulaForConfiguratorFormula = exports.getConfiguratorFormulaCode = exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TOWMOTIVE_ORGANIZATION_TYPE = 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.EXECUTION_HELP_CONTACT_DETAILS_BY_FORMULA = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.
|
|
9
|
+
exports.mapBranchFormulaToConfiguratorFormula = exports.isThcFamilyFormula = exports.getThemeFormulaForConfiguratorFormula = exports.getConfiguratorFormulaCode = exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TOWMOTIVE_ORGANIZATION_TYPE = 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.EXECUTION_HELP_CONTACT_DETAILS_BY_FORMULA = 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.ApiStockStatus = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
10
10
|
require("core-js/modules/es.array.includes.js");
|
|
11
11
|
require("core-js/modules/es.string.includes.js");
|
|
12
12
|
require("core-js/modules/es.string.trim.js");
|
|
@@ -27,11 +27,6 @@ const FORM_ERROR_MESSAGES = exports.FORM_ERROR_MESSAGES = {
|
|
|
27
27
|
licensePlateMin: 'Kenteken moet minimaal 6 characters bevatten',
|
|
28
28
|
licensePlateMax: 'Kenteken mag maximaal 8 characters bevatten'
|
|
29
29
|
};
|
|
30
|
-
const COUNTRY_NAMES = exports.COUNTRY_NAMES = {
|
|
31
|
-
NETHERLANDS: 'NEDERLAND',
|
|
32
|
-
BELGIUM: 'BELGIË',
|
|
33
|
-
BELGIUM_FALLBACK: 'BELGIE'
|
|
34
|
-
};
|
|
35
30
|
const BRANCH_FORMULAS = exports.BRANCH_FORMULAS = {
|
|
36
31
|
Trekhaakcentrum: 'Trekhaakcentrum',
|
|
37
32
|
TowMotiveGroup: 'TowMotive Group',
|
|
@@ -217,7 +217,7 @@ const getBranchCity = function getBranchCity() {
|
|
|
217
217
|
return (branch === null || branch === void 0 ? void 0 : branch.city) || (branch === null || branch === void 0 ? void 0 : branch.gemeente) || '';
|
|
218
218
|
};
|
|
219
219
|
const InternalAppointmentForm = _ref => {
|
|
220
|
-
var _branchTypes$byId$aut, _authSession$branch,
|
|
220
|
+
var _branchTypes$byId$aut, _authSession$branch, _authSession$branch2, _contextCustomer$note2;
|
|
221
221
|
let {
|
|
222
222
|
onSubmit = payload => {},
|
|
223
223
|
isError = false,
|
|
@@ -456,15 +456,10 @@ const InternalAppointmentForm = _ref => {
|
|
|
456
456
|
const isLeaseOwnership = activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij;
|
|
457
457
|
const isNetherlandsSelected = (0, _react.useMemo)(() => {
|
|
458
458
|
if (!(selectedCountry !== null && selectedCountry !== void 0 && selectedCountry.label)) return false;
|
|
459
|
-
return selectedCountry.label.toUpperCase() ===
|
|
459
|
+
return selectedCountry.label.toUpperCase() === 'NEDERLAND';
|
|
460
460
|
}, [selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.label]);
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
const normalizedCountryLabel = selectedCountry.label.trim().toUpperCase();
|
|
464
|
-
return normalizedCountryLabel === _constants__.COUNTRY_NAMES.BELGIUM || normalizedCountryLabel === _constants__.COUNTRY_NAMES.BELGIUM_FALLBACK;
|
|
465
|
-
}, [selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.label]);
|
|
466
|
-
const shouldRequireKvkNumber = isBusinessOwnership && (isNetherlandsSelected || !isNetherlandsSelected && !isBelgiumSelected && !(customer !== null && customer !== void 0 && (_customer$vatNumber = customer.vatNumber) !== null && _customer$vatNumber !== void 0 && _customer$vatNumber.trim()));
|
|
467
|
-
const shouldRequireVatNumber = isBusinessOwnership && (isBelgiumSelected || !isNetherlandsSelected && !isBelgiumSelected && !(customer !== null && customer !== void 0 && (_customer$kvkNumber = customer.kvkNumber) !== null && _customer$kvkNumber !== void 0 && _customer$kvkNumber.trim()));
|
|
461
|
+
const shouldRequireKvkNumber = isBusinessOwnership && (isNetherlandsSelected || !isNetherlandsSelected && !(customer !== null && customer !== void 0 && customer.vatNumber));
|
|
462
|
+
const shouldRequireVatNumber = isBusinessOwnership && !isNetherlandsSelected && !(customer !== null && customer !== void 0 && customer.kvkNumber);
|
|
468
463
|
const {
|
|
469
464
|
branchById
|
|
470
465
|
} = (0, _queries.useBranchByIdOrWidgetId)(selectedBranch);
|
|
@@ -507,7 +502,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
507
502
|
const handleSubmit = async function handleSubmit() {
|
|
508
503
|
let appointmentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants__.DOSSIER_TYPES.PlannedAppointment;
|
|
509
504
|
try {
|
|
510
|
-
var _customer$
|
|
505
|
+
var _customer$kvkNumber, _customer$vatNumber, _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, _customer$kvkNumber2, _customer$vatNumber2, _ref4, _vehicle$leaseNumber, _vehicle$leaseNumberU, _customer$companyName2, _customer$kvkNumber3, _customer$vatNumber3;
|
|
511
506
|
setErrors({});
|
|
512
507
|
if (!model) {
|
|
513
508
|
// Note: this does not throw on error.
|
|
@@ -529,8 +524,8 @@ const InternalAppointmentForm = _ref => {
|
|
|
529
524
|
return;
|
|
530
525
|
}
|
|
531
526
|
}
|
|
532
|
-
const hasKvkNumber = !!(customer !== null && customer !== void 0 && (_customer$
|
|
533
|
-
const hasVatNumber = !!(customer !== null && customer !== void 0 && (_customer$
|
|
527
|
+
const hasKvkNumber = !!(customer !== null && customer !== void 0 && (_customer$kvkNumber = customer.kvkNumber) !== null && _customer$kvkNumber !== void 0 && _customer$kvkNumber.trim());
|
|
528
|
+
const hasVatNumber = !!(customer !== null && customer !== void 0 && (_customer$vatNumber = customer.vatNumber) !== null && _customer$vatNumber !== void 0 && _customer$vatNumber.trim());
|
|
534
529
|
if (isBusinessOwnership) {
|
|
535
530
|
if (isNetherlandsSelected && !hasKvkNumber) {
|
|
536
531
|
setErrors({
|
|
@@ -538,13 +533,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
538
533
|
});
|
|
539
534
|
return;
|
|
540
535
|
}
|
|
541
|
-
if (
|
|
542
|
-
setErrors({
|
|
543
|
-
vatNumber: 'BTW-nummer is verplicht voor zakelijke dossiers in België'
|
|
544
|
-
});
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
if (!isNetherlandsSelected && !isBelgiumSelected && !hasKvkNumber && !hasVatNumber) {
|
|
536
|
+
if (!isNetherlandsSelected && !hasKvkNumber && !hasVatNumber) {
|
|
548
537
|
setErrors({
|
|
549
538
|
kvkNumber: 'Vul een KVK- of BTW-nummer in',
|
|
550
539
|
vatNumber: 'Vul een KVK- of BTW-nummer in'
|
|
@@ -588,8 +577,8 @@ const InternalAppointmentForm = _ref => {
|
|
|
588
577
|
note: (_contextCustomer$note = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note !== void 0 ? _contextCustomer$note : undefined,
|
|
589
578
|
zipCode: (_customer$zipCode = customer === null || customer === void 0 ? void 0 : customer.zipCode) !== null && _customer$zipCode !== void 0 ? _customer$zipCode : undefined,
|
|
590
579
|
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,
|
|
591
|
-
kvkNumber: (_customer$
|
|
592
|
-
vatNumber: (_customer$
|
|
580
|
+
kvkNumber: (_customer$kvkNumber2 = customer === null || customer === void 0 ? void 0 : customer.kvkNumber) !== null && _customer$kvkNumber2 !== void 0 ? _customer$kvkNumber2 : undefined,
|
|
581
|
+
vatNumber: (_customer$vatNumber2 = customer === null || customer === void 0 ? void 0 : customer.vatNumber) !== null && _customer$vatNumber2 !== void 0 ? _customer$vatNumber2 : undefined
|
|
593
582
|
})),
|
|
594
583
|
customerAgreed,
|
|
595
584
|
appointment,
|
|
@@ -641,8 +630,8 @@ const InternalAppointmentForm = _ref => {
|
|
|
641
630
|
});
|
|
642
631
|
payload.customer = _objectSpread(_objectSpread({}, payload.customer || {}), {}, {
|
|
643
632
|
companyName: activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? (_customer$companyName2 = customer === null || customer === void 0 ? void 0 : customer.companyName) !== null && _customer$companyName2 !== void 0 ? _customer$companyName2 : '' : '',
|
|
644
|
-
kvkNumber: activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? (_customer$
|
|
645
|
-
vatNumber: activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? (_customer$
|
|
633
|
+
kvkNumber: activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? (_customer$kvkNumber3 = customer === null || customer === void 0 ? void 0 : customer.kvkNumber) !== null && _customer$kvkNumber3 !== void 0 ? _customer$kvkNumber3 : '' : '',
|
|
634
|
+
vatNumber: activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? (_customer$vatNumber3 = customer === null || customer === void 0 ? void 0 : customer.vatNumber) !== null && _customer$vatNumber3 !== void 0 ? _customer$vatNumber3 : '' : ''
|
|
646
635
|
});
|
|
647
636
|
if (existingDossierId && appointmentType === _constants__.DOSSIER_TYPES.PlannedAppointment && typeof invoicePaymentByLeaseCompany === 'boolean') {
|
|
648
637
|
payload.invoicePaymentByLeaseCompany = activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij ? invoicePaymentByLeaseCompany : false;
|
package/package.json
CHANGED
|
Binary file
|