ordering-components-external 13.2.20 → 13.2.21

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.
Files changed (14) hide show
  1. package/_bundles/{7.ordering-component.0a164d98b183999274c5.js → 7.ordering-component.8895567037064061f69d.js} +1 -1
  2. package/_bundles/{ordering-component.0a164d98b183999274c5.js → ordering-component.8895567037064061f69d.js} +2 -2
  3. package/_modules/components/BusinessAndProductList/index.js +22 -3
  4. package/package.json +1 -1
  5. package/src/components/BusinessAndProductList/index.js +22 -3
  6. /package/_bundles/{0.ordering-component.0a164d98b183999274c5.js → 0.ordering-component.8895567037064061f69d.js} +0 -0
  7. /package/_bundles/{1.ordering-component.0a164d98b183999274c5.js → 1.ordering-component.8895567037064061f69d.js} +0 -0
  8. /package/_bundles/{2.ordering-component.0a164d98b183999274c5.js → 2.ordering-component.8895567037064061f69d.js} +0 -0
  9. /package/_bundles/{4.ordering-component.0a164d98b183999274c5.js → 4.ordering-component.8895567037064061f69d.js} +0 -0
  10. /package/_bundles/{5.ordering-component.0a164d98b183999274c5.js → 5.ordering-component.8895567037064061f69d.js} +0 -0
  11. /package/_bundles/{6.ordering-component.0a164d98b183999274c5.js → 6.ordering-component.8895567037064061f69d.js} +0 -0
  12. /package/_bundles/{7.ordering-component.0a164d98b183999274c5.js.LICENSE.txt → 7.ordering-component.8895567037064061f69d.js.LICENSE.txt} +0 -0
  13. /package/_bundles/{8.ordering-component.0a164d98b183999274c5.js → 8.ordering-component.8895567037064061f69d.js} +0 -0
  14. /package/_bundles/{ordering-component.0a164d98b183999274c5.js.LICENSE.txt → ordering-component.8895567037064061f69d.js.LICENSE.txt} +0 -0
@@ -365,7 +365,13 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
365
365
  categoryState.products = productsFiltered || [];
366
366
  } else if (categorySelected.id === 'featured') {
367
367
  _productsFiltered = businessState === null || businessState === void 0 || (_businessState$busine8 = businessState.business) === null || _businessState$busine8 === void 0 || (_businessState$busine8 = _businessState$busine8.categories) === null || _businessState$busine8 === void 0 ? void 0 : _businessState$busine8.reduce(function (products, category) {
368
- return [].concat(_toConsumableArray(products), _toConsumableArray(category.products));
368
+ return [].concat(_toConsumableArray(products), _toConsumableArray(category.products.map(function (product) {
369
+ return _objectSpread(_objectSpread({}, product), category.slug ? {
370
+ category: _objectSpread(_objectSpread({}, product === null || product === void 0 ? void 0 : product.category), {}, {
371
+ slug: category.slug
372
+ })
373
+ } : {});
374
+ })));
369
375
  }, []).filter(function (product) {
370
376
  return isFeaturedSearch(product);
371
377
  });
@@ -381,7 +387,13 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
381
387
  }
382
388
  productsToFilter = avoidProductDuplicate ? _categoriesCustom : businessState === null || businessState === void 0 || (_businessState$busine10 = businessState.business) === null || _businessState$busine10 === void 0 ? void 0 : _businessState$busine10.categories;
383
389
  _productsFiltered2 = productsToFilter === null || productsToFilter === void 0 ? void 0 : productsToFilter.reduce(function (products, category) {
384
- return [].concat(_toConsumableArray(products), _toConsumableArray(category.products));
390
+ return [].concat(_toConsumableArray(products), _toConsumableArray(category.products.map(function (product) {
391
+ return _objectSpread(_objectSpread({}, product), category.slug ? {
392
+ category: _objectSpread(_objectSpread({}, product === null || product === void 0 ? void 0 : product.category), {}, {
393
+ slug: category.slug
394
+ })
395
+ } : {});
396
+ })));
385
397
  }, []).filter(function (product) {
386
398
  return isMatchSearch(product.name, product.description, product === null || product === void 0 ? void 0 : product.price);
387
399
  });
@@ -668,7 +680,14 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
668
680
  }
669
681
  if (!(categorySelected.id && categorySelected.id !== 'featured')) {
670
682
  productsList = searchValue ? _toConsumableArray(result) : (_ref9 = []).concat.apply(_ref9, _toConsumableArray(result.map(function (category) {
671
- return category === null || category === void 0 ? void 0 : category.products;
683
+ var _category$products2;
684
+ return category === null || category === void 0 || (_category$products2 = category.products) === null || _category$products2 === void 0 ? void 0 : _category$products2.map(function (product) {
685
+ return _objectSpread(_objectSpread({}, product), category !== null && category !== void 0 && category.slug ? {
686
+ category: _objectSpread(_objectSpread({}, product.category), {}, {
687
+ slug: category.slug
688
+ })
689
+ } : {});
690
+ });
672
691
  }))).filter(function (item) {
673
692
  return item;
674
693
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-components-external",
3
- "version": "13.2.20",
3
+ "version": "13.2.21",
4
4
  "description": "Ordering Internal Dashboard",
5
5
  "main": "./_modules/index.js",
6
6
  "scripts": {
@@ -269,7 +269,13 @@ export const BusinessAndProductList = (props) => {
269
269
  categoryState.products = productsFiltered || []
270
270
  } else if (categorySelected.id === 'featured') {
271
271
  const productsFiltered = businessState?.business?.categories?.reduce(
272
- (products, category) => [...products, ...category.products], []
272
+ (products, category) => [
273
+ ...products,
274
+ ...category.products.map(product => ({
275
+ ...product,
276
+ ...(category.slug ? { category: { ...product?.category, slug: category.slug } } : {})
277
+ }))
278
+ ], []
273
279
  ).filter(
274
280
  product => isFeaturedSearch(product)
275
281
  )
@@ -283,7 +289,13 @@ export const BusinessAndProductList = (props) => {
283
289
 
284
290
  const productsToFilter = avoidProductDuplicate ? _categoriesCustom : businessState?.business?.categories
285
291
  const productsFiltered = productsToFilter?.reduce(
286
- (products, category) => [...products, ...category.products], []
292
+ (products, category) => [
293
+ ...products,
294
+ ...category.products.map(product => ({
295
+ ...product,
296
+ ...(category.slug ? { category: { ...product?.category, slug: category.slug } } : {})
297
+ }))
298
+ ], []
287
299
  ).filter(
288
300
  product => isMatchSearch(product.name, product.description, product?.price)
289
301
  )
@@ -496,7 +508,14 @@ export const BusinessAndProductList = (props) => {
496
508
  }
497
509
 
498
510
  if (!(categorySelected.id && categorySelected.id !== 'featured')) {
499
- const productsList = searchValue ? [...result] : [].concat(...result.map(category => category?.products)).filter(item => item)
511
+ const productsList = searchValue
512
+ ? [...result]
513
+ : [].concat(...result.map(category =>
514
+ category?.products?.map(product => ({
515
+ ...product,
516
+ ...(category?.slug ? { category: { ...product.category, slug: category.slug } } : {})
517
+ }))
518
+ )).filter(item => item)
500
519
  const productsListFeatured = featuredRes?.content?.result ?? []
501
520
  const paginationData = categorySelected.id === 'featured'
502
521
  ? categoriesState?.featured?.pagination ?? {}