thm-p3-configurator 0.0.433 → 0.0.434

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.
@@ -109,8 +109,7 @@ const ProductCartSide = () => {
109
109
  montageRate,
110
110
  extraPriceAmount,
111
111
  discountCode,
112
- priceCalculationDate,
113
- skipFilters
112
+ priceCalculationDate
114
113
  } = order;
115
114
  const isTmg = (0, _useIsTmg.useIsTmg)();
116
115
  const isTowmotive = (0, _useIsTowmotive.useIsTowmotive)();
@@ -129,9 +128,7 @@ const ProductCartSide = () => {
129
128
  consumerDiscounts,
130
129
  touchedConsumerDiscounts
131
130
  });
132
- // Use the session skipFilters so this query matches the product page's;
133
- // an unfiltered request can return a different catalogue than the page.
134
- const shouldRequestUnfilteredProducts = skipFilters || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
131
+ const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput) || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
135
132
  const {
136
133
  cart,
137
134
  totals,
@@ -280,8 +280,7 @@ const ProductCartTable = () => {
280
280
  touchedConsumerDiscounts,
281
281
  montageRate,
282
282
  isMontageTariffFixed,
283
- extraPriceAmount,
284
- skipFilters
283
+ extraPriceAmount
285
284
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
286
285
 
287
286
  // Determine display mode
@@ -355,9 +354,10 @@ const ProductCartTable = () => {
355
354
  consumerDiscounts,
356
355
  touchedConsumerDiscounts
357
356
  });
358
- // Use the session skipFilters so this query matches the product page's;
359
- // an unfiltered request can return a different catalogue than the page.
360
- const shouldRequestUnfilteredProducts = skipFilters || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
357
+ // Also request unfiltered products when editing an existing dossier with
358
+ // article numbers that could not be classified into selectedTowbar etc. during
359
+ // hydration (e.g. formula-specific articles not in the TM catalogue).
360
+ const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput) || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
361
361
  const durationAnswerForQuery = durationAnswerIsPrefilled ? undefined : durationAnswer;
362
362
  const {
363
363
  cart,
@@ -9,11 +9,12 @@ require("core-js/modules/esnext.iterator.filter.js");
9
9
  require("core-js/modules/esnext.iterator.flat-map.js");
10
10
  require("core-js/modules/esnext.iterator.for-each.js");
11
11
  require("core-js/modules/esnext.iterator.map.js");
12
+ require("core-js/modules/esnext.iterator.some.js");
12
13
  require("core-js/modules/web.dom-collections.iterator.js");
13
14
  Object.defineProperty(exports, "__esModule", {
14
15
  value: true
15
16
  });
16
- exports.validateCartInput = exports.shouldSelectBoardComputerUpdate = exports.resolveSingleOrderArticlePrices = exports.parseProductSpecifications = exports.getEffectiveBoardComputerSelection = exports.formatHyperDescription = exports.extractProductSpecsArray = exports.checkIfTowbarIsRecommended = exports.buildCartInput = void 0;
17
+ exports.validateCartInput = exports.shouldSelectBoardComputerUpdate = exports.shouldRequestUnfilteredProductsForCart = exports.resolveSingleOrderArticlePrices = exports.parseProductSpecifications = exports.getEffectiveBoardComputerSelection = exports.formatHyperDescription = exports.extractProductSpecsArray = exports.checkIfTowbarIsRecommended = exports.buildCartInput = void 0;
17
18
  require("core-js/modules/es.array.flat-map.js");
18
19
  require("core-js/modules/es.array.includes.js");
19
20
  require("core-js/modules/es.array.unscopables.flat-map.js");
@@ -23,6 +24,7 @@ require("core-js/modules/esnext.iterator.filter.js");
23
24
  require("core-js/modules/esnext.iterator.flat-map.js");
24
25
  require("core-js/modules/esnext.iterator.for-each.js");
25
26
  require("core-js/modules/esnext.iterator.map.js");
27
+ require("core-js/modules/esnext.iterator.some.js");
26
28
  require("core-js/modules/web.dom-collections.iterator.js");
27
29
  var _constants__ = require("../__constants__");
28
30
  function ownKeys(e, r) {
@@ -96,6 +98,16 @@ const validateCartInput = exports.validateCartInput = function validateCartInput
96
98
  }
97
99
  return;
98
100
  };
101
+
102
+ /**
103
+ * @description Cart overviews resolve selected articles from the order article lists.
104
+ * If the user selected an article that only appears with skipFilters enabled,
105
+ * those read-only lookups must request the unfiltered product list too.
106
+ */
107
+ const shouldRequestUnfilteredProductsForCart = exports.shouldRequestUnfilteredProductsForCart = function shouldRequestUnfilteredProductsForCart() {
108
+ let cart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
109
+ return Array.isArray(cart) && cart.some(lineItem => (lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber) != null);
110
+ };
99
111
  const getEffectiveBoardComputerSelection = exports.getEffectiveBoardComputerSelection = function getEffectiveBoardComputerSelection() {
100
112
  var _ref3;
101
113
  let {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.433",
3
+ "version": "0.0.434",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",