sr-npm 1.7.763 → 1.7.765
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { COLLECTIONS,CUSTOM_VALUES_COLLECTION_FIELDS,JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
|
|
2
|
-
const { queryParams } = require('wix-location-frontend');
|
|
2
|
+
const { queryParams,to } = require('wix-location-frontend');
|
|
3
3
|
const {CAREERS_MULTI_BOXES_PAGE_CONSTS,FiltersIds,fieldTitlesInCMS,CATEGORY_CUSTOM_FIELD_ID_IN_CMS} = require('../backend/careersMultiBoxesPageIds');
|
|
4
4
|
const { location } = require("@wix/site-location");
|
|
5
5
|
const { groupValuesByField, debounce, getAllRecords, getFieldById, getFieldByTitle,getCorrectOption,getOptionIndexFromCheckBox } = require('./pagesUtils');
|
|
@@ -23,6 +23,7 @@ const pagination = {
|
|
|
23
23
|
};
|
|
24
24
|
async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
25
25
|
originalQueryParamas=urlParams;
|
|
26
|
+
console.log("careersMultiBoxesPageOnReady urlParams: ", urlParams);
|
|
26
27
|
await loadData(_$w);
|
|
27
28
|
await loadJobsRepeater(_$w);
|
|
28
29
|
await loadPrimarySearchRepeater(_$w);
|
|
@@ -54,16 +55,22 @@ async function loadPrimarySearchRepeater(_$w) {
|
|
|
54
55
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
|
|
55
56
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).label = itemData.title || '';
|
|
56
57
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).onClick(async () => {
|
|
57
|
-
|
|
58
|
-
await location.to(`/search?category=${itemData._id}`);
|
|
59
|
-
|
|
60
|
-
//
|
|
58
|
+
// console.log("before location.to");
|
|
59
|
+
//await location.to(`/search?category=${itemData._id}`);
|
|
60
|
+
// console.log("after location to");
|
|
61
|
+
// to(`/search?category=${itemData._id}`);
|
|
62
|
+
console.log("before handling shit")
|
|
63
|
+
let encodedCategory=encodeURIComponent(itemData._id);
|
|
64
|
+
|
|
65
|
+
await handleUrlParams(_$w,{category:encodedCategory});
|
|
66
|
+
console.log("after handling url params");
|
|
61
67
|
});
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
async function handleUrlParams(_$w,urlParams) {
|
|
66
72
|
let applyFiltering=false;
|
|
73
|
+
console.log("handleUrlParams urlParams: ", urlParams);
|
|
67
74
|
if(urlParams.brand) {
|
|
68
75
|
applyFiltering=await handleParams(_$w,"brand",urlParams.brand)
|
|
69
76
|
}
|
|
@@ -99,7 +106,9 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
99
106
|
|
|
100
107
|
async function handleParams(_$w,param,value) {
|
|
101
108
|
let applyFiltering=false;
|
|
109
|
+
console.log("handleParams param: ", param, " value: ", value);
|
|
102
110
|
const decodedValue = decodeURIComponent(value);
|
|
111
|
+
console.log("decodedValue: ", decodedValue);
|
|
103
112
|
const field=getFieldByTitle(fieldTitlesInCMS[param],allfields);
|
|
104
113
|
const options=optionsByFieldId.get(field._id);
|
|
105
114
|
console.log("all options availbe for this field: ", field.title, " are ", options);
|