sr-npm 1.7.992 → 1.7.993

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.992",
3
+ "version": "1.7.993",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -68,6 +68,15 @@ async function handleUrlParams(_$w,urlParams) {
68
68
  if(urlParams.brand) {
69
69
  applyFiltering=await handleParams(_$w,"brand",urlParams.brand)
70
70
  }
71
+ if(urlParams.location) {
72
+ applyFiltering=await handleParams(_$w,"location",urlParams.location)
73
+ }
74
+ if(urlParams.employmentType) {
75
+ applyFiltering=await handleParams(_$w,"employmentType",urlParams.employmentType)
76
+ }
77
+ if(urlParams.contractType) {
78
+ applyFiltering=await handleParams(_$w,"contractType",urlParams.contractType)
79
+ }
71
80
  if(urlParams.visibility) {
72
81
  applyFiltering=await handleParams(_$w,"visibility",urlParams.visibility)
73
82
  }
@@ -76,6 +85,18 @@ async function handleUrlParams(_$w,urlParams) {
76
85
 
77
86
  applyFiltering=await handleParams(_$w,"category",urlParams.category)
78
87
  }
88
+ if(urlParams.companySegment) {
89
+ console.log("companySegment url param is present ",urlParams.companySegment);
90
+
91
+ applyFiltering=await handleParams(_$w,"companySegment",urlParams.companySegment)
92
+ }
93
+ if(urlParams.storeName) {
94
+ console.log("storeName url param is present ",urlParams.storeName);
95
+
96
+ applyFiltering=await handleParams(_$w,"storeName",urlParams.storeName)
97
+ }
98
+
99
+
79
100
 
80
101
  if(applyFiltering || keywordAllJobs) {
81
102
  await updateJobsAndNumbersAndFilters(_$w);
@@ -107,30 +128,18 @@ async function handleUrlParams(_$w,urlParams) {
107
128
  async function handleParams(_$w,param,values) {
108
129
  let applyFiltering=false;
109
130
  let valuesAsArray = values.split(',')
110
- console.log("values: ",values);
111
- console.log("valuesAsArray: ",valuesAsArray);
131
+ valuesAsArray=valuesAsArray.filter(value=>value.trim()!=='');
112
132
  let selectedIndices=[];
113
-
133
+ const field=getFieldByTitle(fieldTitlesInCMS[param],allfields);
134
+ let existing = selectedByField.get(field._id) || [];
114
135
  for(const value of valuesAsArray) {
115
136
  const decodedValue = decodeURIComponent(value);
116
- console.log("decodedValue: ",decodedValue);
117
- const field=getFieldByTitle(fieldTitlesInCMS[param],allfields);
118
- console.log("field: ",field);
119
137
  const options=optionsByFieldId.get(field._id);
120
- console.log("options: ",options);
121
138
  const option=getCorrectOption(decodedValue,options);
122
- console.log("option: ",option);
123
139
  if(option) {
124
140
  const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
125
- console.log("optionIndex: ",optionIndex);
126
- console.log("before {FiltersIds[field.title]}CheckBox).selectedIndices: ",_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices);
127
141
  selectedIndices.push(optionIndex);
128
- _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices=selectedIndices;
129
- console.log("selectedIndices: ",selectedIndices);
130
- console.log("after {FiltersIds[field.title]}CheckBox).selectedIndices: ",_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices);
131
- let existing = selectedByField.get(field._id) || [];
132
142
  existing.push(option.value);
133
- selectedByField.set(field._id, existing);
134
143
  applyFiltering=true;
135
144
  dontUpdateThisCheckBox=field._id;
136
145
  }
@@ -138,7 +147,8 @@ async function handleParams(_$w,param,values) {
138
147
  console.warn(`${param} value not found in dropdown options`);
139
148
  }
140
149
  }
141
-
150
+ selectedByField.set(field._id, existing);
151
+ _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices=selectedIndices;
142
152
 
143
153
  return applyFiltering;
144
154
  }