thm-p3-configurator 0.0.178 → 0.0.181

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.
@@ -70,7 +70,7 @@ const App = () => {
70
70
  (0, _Experiments.default)();
71
71
  });
72
72
  return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
73
- defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THC
73
+ defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THM
74
74
  }, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
75
75
  defaultCountry: APP_CONFIG.country
76
76
  }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
@@ -36,7 +36,7 @@ authenticateClient.interceptors.request.use(async config => {
36
36
  var _authSession$branch;
37
37
  const authSession = _LocalStorageWorker.lsw.getJson(_constants__.AUTH_SESSION_KEY);
38
38
  let accessToken = (0, _cookieManager.getAccessToken)();
39
- if (!accessToken) {
39
+ if (!accessToken && APP_CONFIG.internal) {
40
40
  try {
41
41
  const refreshResponse = await refreshClient('api/v1/auth', {
42
42
  method: 'PUT'
@@ -202,6 +202,9 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
202
202
  });
203
203
  },
204
204
  getArticlePrices: partsQueryString => {
205
+ if (!APP_CONFIG.internal) {
206
+ return null;
207
+ }
205
208
  const basePath = APP_CONFIG.internal ? 'api/v1' : 'api/public/v1';
206
209
  return authenticateClient("".concat(basePath, "/configurator/prices?").concat(partsQueryString), {
207
210
  method: 'GET'
@@ -414,6 +414,9 @@ const useProductsQuery = orderParameters => {
414
414
  model,
415
415
  formula
416
416
  } = orderParameters;
417
+ if (!APP_CONFIG.internal) {
418
+ delete orderParameters.priceCalculationDate;
419
+ }
417
420
  const productsSearchParams = new URLSearchParams((0, _helpers__.removeNullishProps)(orderParameters)).toString();
418
421
  const productsQuery = (0, _reactQuery.useQuery)(['products', productsSearchParams], {
419
422
  enabled: (licensePlate === null || licensePlate === void 0 ? void 0 : licensePlate.length) > 5 || !!(model !== null && model !== void 0 && model.length),
@@ -57,11 +57,11 @@ const DiscountProductsSelector = () => {
57
57
  licensePlate,
58
58
  model,
59
59
  durationAnswer,
60
+ canAlterQuantity,
60
61
  executionAnswer1,
61
62
  executionAnswer2,
62
63
  priceCalculationDate,
63
64
  discountCode,
64
- canAlterQuantity,
65
65
  selectedDiscountedProducts,
66
66
  discountsInitialized
67
67
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
@@ -119,9 +119,6 @@ const DiscountProductsSelector = () => {
119
119
  if (!(discountProducts !== null && discountProducts !== void 0 && discountProducts.length)) {
120
120
  return null;
121
121
  }
122
- if (!canAlterQuantity) {
123
- return /*#__PURE__*/_react.default.createElement("p", null, "Kan niet meer gekozen worden als de afspraak al verwerkt wordt.");
124
- }
125
122
  return /*#__PURE__*/_react.default.createElement("ol", null, discountProducts === null || discountProducts === void 0 ? void 0 : discountProducts.map(product => {
126
123
  const selectedProductAmount = selectedDiscountedProducts.find(selectedProduct => (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.articleNumber) === (product === null || product === void 0 ? void 0 : product.articleNumber));
127
124
  return /*#__PURE__*/_react.default.createElement("li", {
@@ -185,10 +185,10 @@ const ExitIntentModal = () => {
185
185
  discount: discountCode ? {
186
186
  code: discountCode
187
187
  } : null,
188
- customer: _objectSpread(_objectSpread({}, customer), {}, {
188
+ customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
189
189
  firstName: (_customer$firstName = customer === null || customer === void 0 ? void 0 : customer.firstName) !== null && _customer$firstName !== void 0 ? _customer$firstName : undefined,
190
190
  lastName: (_customer$lastName = customer === null || customer === void 0 ? void 0 : customer.lastName) !== null && _customer$lastName !== void 0 ? _customer$lastName : undefined
191
- }),
191
+ })),
192
192
  branchId: selectedBranch,
193
193
  selectBoardComputerUpdate: selectedBoardComputer != null,
194
194
  cart: (0, _product.validateCartInput)([{
@@ -18,6 +18,7 @@ function _interopRequireDefault(e) {
18
18
  };
19
19
  }
20
20
  const InternalCancelDossierEdit = () => {
21
+ var _dossierById$vestigin;
21
22
  const [{
22
23
  existingDossierId,
23
24
  existingDossierType
@@ -55,7 +56,7 @@ const InternalCancelDossierEdit = () => {
55
56
  className: (0, _helpers__.withStyle)('col-12 col-md-8 mb-1 mb-md-0')
56
57
  }, /*#__PURE__*/_react.default.createElement("p", {
57
58
  className: (0, _helpers__.withStyle)('mb-0')
58
- }, ' ', "U bewerkt het dossier", ' ', /*#__PURE__*/_react.default.createElement("strong", null, dossierById === null || dossierById === void 0 ? void 0 : dossierById.title.split(' - ')[0], " - ", dossierById === null || dossierById === void 0 ? void 0 : dossierById.voornaam, ' ', dossierById === null || dossierById === void 0 ? void 0 : dossierById.tussenvoegsel, " ", dossierById === null || dossierById === void 0 ? void 0 : dossierById.achternaam, " -", ' ', dossierById === null || dossierById === void 0 ? void 0 : dossierById.vestiging.name))), /*#__PURE__*/_react.default.createElement("div", {
59
+ }, ' ', "U bewerkt het dossier", ' ', /*#__PURE__*/_react.default.createElement("strong", null, dossierById === null || dossierById === void 0 ? void 0 : dossierById.title.split(' - ')[0], " - ", dossierById === null || dossierById === void 0 ? void 0 : dossierById.voornaam, ' ', dossierById === null || dossierById === void 0 ? void 0 : dossierById.tussenvoegsel, " ", dossierById === null || dossierById === void 0 ? void 0 : dossierById.achternaam, " -", ' ', dossierById === null || dossierById === void 0 || (_dossierById$vestigin = dossierById.vestiging) === null || _dossierById$vestigin === void 0 ? void 0 : _dossierById$vestigin.name))), /*#__PURE__*/_react.default.createElement("div", {
59
60
  className: (0, _helpers__.withStyle)('col-12 col-md-4')
60
61
  }, /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
61
62
  type: "button",
@@ -112,8 +112,8 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
112
112
  discountPercentage: dossier === null || dossier === void 0 ? void 0 : dossier.kortingspercentage,
113
113
  discountAmount: (dossier === null || dossier === void 0 ? void 0 : dossier.kortingsbedragInclBtw) || null,
114
114
  appointment: {
115
- date: dossier !== null && dossier !== void 0 && dossier.geplandeTijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd) : dossier !== null && dossier !== void 0 && dossier.voorkeurstijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.voorkeurstijd) : new Date(),
116
- time: dossier !== null && dossier !== void 0 && dossier.geplandeTijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd) : dossier !== null && dossier !== void 0 && dossier.voorkeurstijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.voorkeurstijd) : new Date(),
115
+ date: dossier !== null && dossier !== void 0 && dossier.geplandeTijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd) : dossier !== null && dossier !== void 0 && dossier.voorkeurstijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.voorkeurstijd) : null,
116
+ time: dossier !== null && dossier !== void 0 && dossier.geplandeTijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.geplandeTijd) : dossier !== null && dossier !== void 0 && dossier.voorkeurstijd ? new Date().setTime(dossier === null || dossier === void 0 ? void 0 : dossier.voorkeurstijd) : null,
117
117
  note: dossier === null || dossier === void 0 ? void 0 : dossier.opmerkingKlant
118
118
  },
119
119
  priceCalculationDate: dossier !== null && dossier !== void 0 && dossier.prijsberekeningsdatum ? dossier === null || dossier === void 0 ? void 0 : dossier.prijsberekeningsdatum : new Date().getTime(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.178",
3
+ "version": "0.0.181",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",