sr-npm 1.7.658 → 1.7.659
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 +1 -1
- package/pages/careersMultiBoxesPage.js +10 -17
package/package.json
CHANGED
|
@@ -93,7 +93,6 @@ async function loadJobs(_$w) {
|
|
|
93
93
|
|
|
94
94
|
let valuesByFieldId = groupValuesByField(allvaluesobjects, CUSTOM_VALUES_COLLECTION_FIELDS.CUSTOM_FIELD);
|
|
95
95
|
valuesByFieldId.set("Location",cities)
|
|
96
|
-
console.log("valuesByFieldId after addubg cities: ",valuesByFieldId)
|
|
97
96
|
valuesByFieldIdGlobal = valuesByFieldId; // store globally
|
|
98
97
|
|
|
99
98
|
|
|
@@ -109,7 +108,6 @@ async function loadJobs(_$w) {
|
|
|
109
108
|
|
|
110
109
|
// Build CheckboxGroup options for this field
|
|
111
110
|
const fieldValues = valuesByFieldId.get(fieldId) || [];
|
|
112
|
-
console.log("fieldValues: ",fieldValues)
|
|
113
111
|
let originalOptions=[];
|
|
114
112
|
if(fieldId==="Location") {
|
|
115
113
|
originalOptions=fieldValues.map(city=>({
|
|
@@ -120,13 +118,7 @@ async function loadJobs(_$w) {
|
|
|
120
118
|
else{
|
|
121
119
|
originalOptions=fieldValues
|
|
122
120
|
}
|
|
123
|
-
|
|
124
|
-
// else{
|
|
125
|
-
// originalOptions = fieldValues.map(v => ({
|
|
126
|
-
// label: v.title ,
|
|
127
|
-
// value: v._id
|
|
128
|
-
// }));
|
|
129
|
-
// }
|
|
121
|
+
|
|
130
122
|
optionsByFieldId.set(fieldId, originalOptions);
|
|
131
123
|
const counter={}
|
|
132
124
|
|
|
@@ -245,7 +237,6 @@ async function loadJobs(_$w) {
|
|
|
245
237
|
let tempFilteredJobs=[];
|
|
246
238
|
let finalFilteredJobs=alljobs;
|
|
247
239
|
let addedJobsIds=[]
|
|
248
|
-
console.log("filterByField: ",filterByField)
|
|
249
240
|
if(filterByField!="Location") {
|
|
250
241
|
filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
|
|
251
242
|
}
|
|
@@ -257,16 +248,18 @@ async function loadJobs(_$w) {
|
|
|
257
248
|
// AND across categories, OR within each category
|
|
258
249
|
for (const [, values] of selectedByField.entries()) {
|
|
259
250
|
for(job of finalFilteredJobs) {
|
|
260
|
-
let jobVal;
|
|
261
251
|
if(filterByField===JOBS_COLLECTION_FIELDS.CITY_TEXT){
|
|
262
|
-
|
|
252
|
+
//if it is location then we check if selecred values (which is an array) have job city text
|
|
253
|
+
if(values.includes(job[filterByField])) {
|
|
254
|
+
if(!addedJobsIds.includes(job._id)) {
|
|
255
|
+
tempFilteredJobs.push(job);
|
|
256
|
+
addedJobsIds.push(job._id);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
263
259
|
}
|
|
264
260
|
else{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
console.log("jobVal: ",jobVal)
|
|
268
|
-
console.log("jobVal.some(value=>values.includes(value._id)): ",jobVal.some(value=>values.includes(value._id)))
|
|
269
|
-
if(jobVal.some(value=>values.includes(value._id))) {
|
|
261
|
+
//if it is not location then we check if selecred values (which is an array) have one of the job values (whcih is also an array)
|
|
262
|
+
if(job[filterByField].some(value=>values.includes(value._id))) {
|
|
270
263
|
if(!addedJobsIds.includes(job._id)) {
|
|
271
264
|
tempFilteredJobs.push(job);
|
|
272
265
|
addedJobsIds.push(job._id);
|