@websolutespa/bom-mixer-store 1.8.9 → 1.8.10
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/CHANGELOG.md +8 -0
- package/dist/index.js +7 -1
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
- package/src/decorators/menu.ts +1 -1
- package/src/mock/mock-page.service.ts +7 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -362,7 +362,7 @@ function itemsFilteredByMarket_(items, market) {
|
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
364
|
function itemHasMarket_(item, market) {
|
|
365
|
-
return Array.isArray(item.markets) ? item.markets.includes(market) : true;
|
|
365
|
+
return Array.isArray(item.markets) && item.markets.length > 0 ? item.markets.includes(market) : true;
|
|
366
366
|
}
|
|
367
367
|
function collectUndecoratedCategories(items, undecoratedCategories = []) {
|
|
368
368
|
items.forEach((item) => {
|
|
@@ -818,6 +818,12 @@ var MockPageService = class extends MockService {
|
|
|
818
818
|
locale: params.locale,
|
|
819
819
|
depth: params.depth
|
|
820
820
|
});
|
|
821
|
+
const invalidKeys = ["components"];
|
|
822
|
+
decoratedItems = decoratedItems.map((x) => Object.fromEntries(
|
|
823
|
+
Object.entries(x).filter(
|
|
824
|
+
([k, v]) => !invalidKeys.includes(k)
|
|
825
|
+
)
|
|
826
|
+
));
|
|
821
827
|
return decoratedItems;
|
|
822
828
|
}
|
|
823
829
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -257,7 +257,7 @@ function itemsFilteredByMarket_(items, market) {
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
function itemHasMarket_(item, market) {
|
|
260
|
-
return Array.isArray(item.markets) ? item.markets.includes(market) : true;
|
|
260
|
+
return Array.isArray(item.markets) && item.markets.length > 0 ? item.markets.includes(market) : true;
|
|
261
261
|
}
|
|
262
262
|
function collectUndecoratedCategories(items, undecoratedCategories = []) {
|
|
263
263
|
items.forEach((item) => {
|
|
@@ -713,6 +713,12 @@ var MockPageService = class extends MockService {
|
|
|
713
713
|
locale: params.locale,
|
|
714
714
|
depth: params.depth
|
|
715
715
|
});
|
|
716
|
+
const invalidKeys = ["components"];
|
|
717
|
+
decoratedItems = decoratedItems.map((x) => Object.fromEntries(
|
|
718
|
+
Object.entries(x).filter(
|
|
719
|
+
([k, v]) => !invalidKeys.includes(k)
|
|
720
|
+
)
|
|
721
|
+
));
|
|
716
722
|
return decoratedItems;
|
|
717
723
|
}
|
|
718
724
|
};
|
package/package.json
CHANGED
package/src/decorators/menu.ts
CHANGED
|
@@ -64,7 +64,7 @@ function itemsFilteredByMarket_(items: IUndecoratedMenuItem[], market: string):
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function itemHasMarket_(item: IUndecoratedMenuItem, market: string): boolean {
|
|
67
|
-
return Array.isArray(item.markets) ? item.markets.includes(market) : true;
|
|
67
|
+
return (Array.isArray(item.markets) && item.markets.length > 0) ? item.markets.includes(market) : true;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
function collectUndecoratedCategories(items: IUndecoratedMenuItem[], undecoratedCategories: IUndecoratedMenuCategory[] = []): IUndecoratedMenuCategory[] {
|
|
@@ -39,8 +39,14 @@ export class MockPageService<T extends ICategorized = ICategorized> extends Mock
|
|
|
39
39
|
locale: params.locale,
|
|
40
40
|
depth: params.depth,
|
|
41
41
|
});
|
|
42
|
+
// !!! optimization for index listing removing components
|
|
43
|
+
const invalidKeys = ['components'];
|
|
44
|
+
decoratedItems = decoratedItems.map(x => Object.fromEntries(
|
|
45
|
+
Object.entries(x).filter(
|
|
46
|
+
([k, v]) => !invalidKeys.includes(k)
|
|
47
|
+
)
|
|
48
|
+
)) as B[];
|
|
42
49
|
/*
|
|
43
|
-
// !!! optimization for index listing
|
|
44
50
|
decoratedItems = await decorateNavs_<B>(store, decoratedItems, params);
|
|
45
51
|
*/
|
|
46
52
|
return decoratedItems;
|