Skip to content

Commit c3c96cd

Browse files
authored
Split ZoomArray by Id and by URL. Remove items in navigationFormZoomArrayById (#677)
1 parent 7482fba commit c3c96cd

File tree

1 file changed

+27
-51
lines changed

1 file changed

+27
-51
lines changed

src/components/src/utils/CortexLookup.js

Lines changed: 27 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,7 @@ import { cortexFetch } from './Cortex';
2525
import Config from '../../../ep.config.json';
2626

2727
// Array of zoom parameters to pass to Cortex for navigationForm
28-
const navigationFormZoomArray = [
29-
'items',
30-
'items:element',
31-
'items:element:code',
32-
'items:element:availability',
33-
'items:element:definition',
34-
'items:element:definition:assets:element',
35-
'items:element:price',
36-
'items:element:rate',
37-
'items:next',
28+
const navigationFormZoomArrayById = [
3829
'offers',
3930
'offers:next',
4031
'offers:element',
@@ -49,23 +40,43 @@ const navigationFormZoomArray = [
4940
'offers:element:items:element:definition',
5041
'offers:element:items:element:definition:assets:element',
5142
'offers:element:items:element:price',
52-
'offers:element:items:element:rate',
5343
'offers:element:items:element:code',
54-
'offers:element:rate',
44+
'offers:facets',
45+
'offers:facets:element',
46+
'offers:facets:element:facetselector',
47+
'offers:facets:element:facetselector:choice:description',
48+
'offers:facets:element:facetselector:choice:selector',
49+
'offers:facets:element:facetselector:choice:selectaction',
50+
'offers:facets:element:facetselector:chosen:description',
51+
'offers:facets:element:facetselector:chosen:selector',
52+
'offers:facets:element:facetselector:chosen:selectaction',
53+
'offers:sortattributes',
54+
'offers:sortattributes:choice',
55+
'offers:sortattributes:choice:description',
56+
'offers:sortattributes:choice:selectaction',
57+
'offers:sortattributes:choice:selector',
58+
'offers:sortattributes:chosen',
59+
'offers:sortattributes:chosen:description',
60+
'offers:sortattributes:chosen:selectaction',
61+
'offers:sortattributes:chosen:selector',
62+
'offers:sortattributes:offersearchresult',
63+
'parent',
64+
'next',
65+
];
66+
67+
const navigationFormZoomArrayByUri = [
5568
'element',
5669
'element:availability',
5770
'element:definition',
5871
'element:definition:assets:element',
5972
'element:price',
60-
'element:rate',
6173
'element:code',
6274
'element:items',
6375
'element:items:element',
6476
'element:items:element:availability',
6577
'element:items:element:definition',
6678
'element:items:element:definition:assets:element',
6779
'element:items:element:price',
68-
'element:items:element:rate',
6980
'element:items:element:code',
7081
'facets',
7182
'facets:element',
@@ -76,41 +87,6 @@ const navigationFormZoomArray = [
7687
'facets:element:facetselector:chosen:description',
7788
'facets:element:facetselector:chosen:selector',
7889
'facets:element:facetselector:chosen:selectaction',
79-
'offers:facets',
80-
'offers:facets:element',
81-
'offers:facets:element:facetselector',
82-
'offers:facets:element:facetselector:choice:description',
83-
'offers:facets:element:facetselector:choice:selector',
84-
'offers:facets:element:facetselector:choice:selectaction',
85-
'offers:facets:element:facetselector:chosen:description',
86-
'offers:facets:element:facetselector:chosen:selector',
87-
'offers:facets:element:facetselector:chosen:selectaction',
88-
'offers:sortattributes',
89-
'offers:sortattributes:choice',
90-
'offers:sortattributes:choice:description',
91-
'offers:sortattributes:choice:selectaction',
92-
'offers:sortattributes:choice:selector',
93-
'offers:sortattributes:chosen',
94-
'offers:sortattributes:chosen:description',
95-
'offers:sortattributes:chosen:selectaction',
96-
'offers:sortattributes:chosen:selector',
97-
'offers:sortattributes:offersearchresult',
98-
'featuredoffers',
99-
'featuredoffers:element',
100-
'featuredoffers:element:availability',
101-
'featuredoffers:element:definition',
102-
'featuredoffers:element:definition:assets:element',
103-
'featuredoffers:element:price',
104-
'featuredoffers:element:rate',
105-
'featuredoffers:element:code',
106-
'featuredoffers:element:items',
107-
'featuredoffers:element:items:element',
108-
'featuredoffers:element:items:element:availability',
109-
'featuredoffers:element:items:element:definition',
110-
'featuredoffers:element:items:element:definition:assets:element',
111-
'featuredoffers:element:items:element:price',
112-
'featuredoffers:element:items:element:rate',
113-
'featuredoffers:element:items:element:code',
11490
'parent',
11591
'sortattributes',
11692
'sortattributes:choice',
@@ -420,7 +396,7 @@ export function cortexFetchPurchaseLookupForm() {
420396
export function navigationLookup(navigationLookupCode) {
421397
return new Promise(((resolve, reject) => {
422398
if (navigationLookupCode.includes('/') && navigationLookupCode.includes(Config.cortexApi.scope.toLowerCase())) {
423-
cortexFetch(`/${navigationLookupCode}?zoom=${navigationFormZoomArray.join()}`,
399+
cortexFetch(`/${navigationLookupCode}?zoom=${navigationFormZoomArrayByUri.join()}`,
424400
{
425401
headers: {
426402
'Content-Type': 'application/json',
@@ -437,7 +413,7 @@ export function navigationLookup(navigationLookupCode) {
437413
reject(error);
438414
});
439415
} else {
440-
cortexFetch(`${localStorage.getItem(`${Config.cortexApi.scope}_navigationLookupForm`)}?zoom=${navigationFormZoomArray.join()}&followlocation=true`,
416+
cortexFetch(`${localStorage.getItem(`${Config.cortexApi.scope}_navigationLookupForm`)}?zoom=${navigationFormZoomArrayById.join()}&followlocation=true`,
441417
{
442418
method: 'post',
443419
headers: {

0 commit comments

Comments
 (0)