@websolutespa/bom-mixer-store 1.8.9 → 1.8.11
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 +14 -0
- package/dist/index.js +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
- package/src/decorators/menu.ts +1 -1
- package/src/mock/mock-page.service.ts +7 -1
- package/src/store/store.handler.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @websolutespa/bom-mixer-store
|
|
2
2
|
|
|
3
|
+
## 1.8.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Modified: StoreHandler sorting api collections
|
|
8
|
+
|
|
9
|
+
## 1.8.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f0d17f3: Modified: page market filtering
|
|
14
|
+
- Updated dependencies [f0d17f3]
|
|
15
|
+
- @websolutespa/bom-core@1.8.19
|
|
16
|
+
|
|
3
17
|
## 1.8.9
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
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
|
};
|
|
@@ -1989,6 +1995,7 @@ function storeIndexHandler() {
|
|
|
1989
1995
|
console.error("apiHome.collectionGet", "collections not found", COLLECTIONS);
|
|
1990
1996
|
return response.status(405).send("method not allowed");
|
|
1991
1997
|
}
|
|
1998
|
+
COLLECTIONS.sort((a, b) => a.localeCompare(b));
|
|
1992
1999
|
response.setHeader("Content-Type", "text/html; charset=UTF-8");
|
|
1993
2000
|
response.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
1994
2001
|
response.setHeader("X-Robots-Tag", "noindex, follow");
|
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
|
};
|
|
@@ -1884,6 +1890,7 @@ function storeIndexHandler() {
|
|
|
1884
1890
|
console.error("apiHome.collectionGet", "collections not found", COLLECTIONS);
|
|
1885
1891
|
return response.status(405).send("method not allowed");
|
|
1886
1892
|
}
|
|
1893
|
+
COLLECTIONS.sort((a, b) => a.localeCompare(b));
|
|
1887
1894
|
response.setHeader("Content-Type", "text/html; charset=UTF-8");
|
|
1888
1895
|
response.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
1889
1896
|
response.setHeader("X-Robots-Tag", "noindex, follow");
|
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;
|
|
@@ -257,6 +257,7 @@ export function storeIndexHandler() {
|
|
|
257
257
|
console.error('apiHome.collectionGet', 'collections not found', COLLECTIONS);
|
|
258
258
|
return response.status(405).send('method not allowed');
|
|
259
259
|
}
|
|
260
|
+
COLLECTIONS.sort((a, b) => a.localeCompare(b));
|
|
260
261
|
response.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
|
261
262
|
response.setHeader('X-Frame-Options', 'SAMEORIGIN');
|
|
262
263
|
response.setHeader('X-Robots-Tag', 'noindex, follow');
|