thm-p3-configurator 0.0.346 → 0.0.349

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.
@@ -103,7 +103,12 @@ const ANWBMembershipValidator = _ref => {
103
103
  }
104
104
  });
105
105
  }
106
- }, [anwbDiscountValidated, customer === null || customer === void 0 ? void 0 : customer.anwbId, discountCode, dispatch, selectedDiscountedProducts]);
106
+
107
+ // Show the success message when a validated ANWB dossier is hydrated.
108
+ if (isAnwbCode && hasPrefilledMembership && hasAnwbProducts && anwbDiscountValidated === true && isNumberValid == null) {
109
+ setIsNumberValid(true);
110
+ }
111
+ }, [anwbDiscountValidated, customer === null || customer === void 0 ? void 0 : customer.anwbId, discountCode, dispatch, isNumberValid, selectedDiscountedProducts]);
107
112
  const handleSubmit = number => {
108
113
  const isValid = _ANWBValidator.anwbValidator.validate(0, {
109
114
  number
@@ -481,7 +481,7 @@ const InternalAppointmentForm = _ref => {
481
481
  const handleSubmit = async function handleSubmit() {
482
482
  let appointmentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants__.DOSSIER_TYPES.PlannedAppointment;
483
483
  try {
484
- var _customer$kvkNumber, _customer$vatNumber, _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _contextCustomer$note, _customer$zipCode, _customer$companyName, _customer$kvkNumber2, _customer$vatNumber2, _ref3;
484
+ 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;
485
485
  setErrors({});
486
486
  if (!model) {
487
487
  // Note: this does not throw on error.
@@ -552,6 +552,7 @@ const InternalAppointmentForm = _ref => {
552
552
  countryId: (_customer$countryId = customer === null || customer === void 0 ? void 0 : customer.countryId) !== null && _customer$countryId !== void 0 ? _customer$countryId : undefined,
553
553
  city: (_customer$city = customer === null || customer === void 0 ? void 0 : customer.city) !== null && _customer$city !== void 0 ? _customer$city : undefined,
554
554
  email: (_customer$email = customer === null || customer === void 0 ? void 0 : customer.email) !== null && _customer$email !== void 0 ? _customer$email : undefined,
555
+ anwbId: discountCode !== null && discountCode !== void 0 && discountCode.toLocaleLowerCase().includes('anwb') ? (_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,
555
556
  note: (_contextCustomer$note = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note !== void 0 ? _contextCustomer$note : undefined,
556
557
  zipCode: (_customer$zipCode = customer === null || customer === void 0 ? void 0 : customer.zipCode) !== null && _customer$zipCode !== void 0 ? _customer$zipCode : undefined,
557
558
  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,
@@ -562,7 +563,7 @@ const InternalAppointmentForm = _ref => {
562
563
  appointment,
563
564
  appointmentType,
564
565
  channel,
565
- licensePlate: (_ref3 = licensePlate || _licensePlate) === null || _ref3 === void 0 ? void 0 : _ref3.replace(/-/g, ''),
566
+ licensePlate: (_ref4 = licensePlate || _licensePlate) === null || _ref4 === void 0 ? void 0 : _ref4.replace(/-/g, ''),
566
567
  model,
567
568
  chassisNumber,
568
569
  priceCalculationDate,
@@ -758,12 +759,12 @@ const InternalAppointmentForm = _ref => {
758
759
  placeholder: "Maak een keuze",
759
760
  errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelType']) || (errors === null || errors === void 0 ? void 0 : errors['channelId']),
760
761
  initialValue: initialChannel,
761
- onChange: _ref4 => {
762
+ onChange: _ref5 => {
762
763
  var _value$kanaalType, _value$kanaalType2;
763
764
  let {
764
765
  label,
765
766
  value
766
- } = _ref4;
767
+ } = _ref5;
767
768
  return dispatch({
768
769
  type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
769
770
  payload: {
@@ -1232,10 +1233,10 @@ const InternalAppointmentForm = _ref => {
1232
1233
  placeholder: "Selecteer een land",
1233
1234
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
1234
1235
  initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
1235
- onChange: _ref5 => {
1236
+ onChange: _ref6 => {
1236
1237
  let {
1237
1238
  value
1238
- } = _ref5;
1239
+ } = _ref6;
1239
1240
  return dispatch({
1240
1241
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
1241
1242
  payload: {
@@ -1341,10 +1342,10 @@ const InternalAppointmentForm = _ref => {
1341
1342
  placeholder: "Selecteer een land",
1342
1343
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
1343
1344
  initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
1344
- onChange: _ref6 => {
1345
+ onChange: _ref7 => {
1345
1346
  let {
1346
1347
  value
1347
- } = _ref6;
1348
+ } = _ref7;
1348
1349
  return dispatch({
1349
1350
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
1350
1351
  payload: {
@@ -1429,10 +1430,10 @@ const InternalAppointmentForm = _ref => {
1429
1430
  placeholder: "Selecteer een land",
1430
1431
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
1431
1432
  initialValue: (countryOptions === null || countryOptions === void 0 ? void 0 : countryOptions.find(option => option.value === (customer === null || customer === void 0 ? void 0 : customer.countryId))) || null,
1432
- onChange: _ref7 => {
1433
+ onChange: _ref8 => {
1433
1434
  let {
1434
1435
  value
1435
- } = _ref7;
1436
+ } = _ref8;
1436
1437
  return dispatch({
1437
1438
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
1438
1439
  payload: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.346",
3
+ "version": "0.0.349",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",