sr-npm 1.7.653 → 1.7.655
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
|
@@ -15,7 +15,6 @@ async function careersMultiBoxesPageOnReady(_$w) {
|
|
|
15
15
|
if(alljobs.length===0) {
|
|
16
16
|
alljobs=await getAllRecords(COLLECTIONS.JOBS);
|
|
17
17
|
currentJobs=alljobs;
|
|
18
|
-
console.log("alljobs: ",alljobs)
|
|
19
18
|
}
|
|
20
19
|
if(Object.keys(valueToJobs).length === 0){
|
|
21
20
|
allvaluesobjects=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
@@ -84,15 +83,15 @@ async function loadJobs(_$w) {
|
|
|
84
83
|
try {
|
|
85
84
|
// 1) Load all categories (fields)
|
|
86
85
|
let fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
|
|
87
|
-
fields.push({_id:"Location",title:"Location"});
|
|
88
|
-
console.log("fields: ",fields)
|
|
86
|
+
fields.push({_id:"Location",title:"Location"});
|
|
89
87
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).data = fields;
|
|
90
88
|
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
91
|
-
|
|
89
|
+
for(const city of cities) {
|
|
90
|
+
valueToJobs[city._id]=city.jobIds;
|
|
91
|
+
}
|
|
92
92
|
// 2) Load all values once and group them by referenced field
|
|
93
93
|
|
|
94
94
|
let valuesByFieldId = groupValuesByField(allvaluesobjects, CUSTOM_VALUES_COLLECTION_FIELDS.CUSTOM_FIELD);
|
|
95
|
-
console.log("valuesByFieldId: ",valuesByFieldId)
|
|
96
95
|
valuesByFieldId.set("Location",cities)
|
|
97
96
|
console.log("valuesByFieldId after addubg cities: ",valuesByFieldId)
|
|
98
97
|
valuesByFieldIdGlobal = valuesByFieldId; // store globally
|
|
@@ -107,13 +106,6 @@ async function loadJobs(_$w) {
|
|
|
107
106
|
|
|
108
107
|
// Set the filter label (category name)
|
|
109
108
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_LABEL).placeholder = itemData.title
|
|
110
|
-
|
|
111
|
-
// if(fieldId==="Location") {
|
|
112
|
-
// $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).options = cities.map(city=>({
|
|
113
|
-
// label: city.city,
|
|
114
|
-
// value: city._id
|
|
115
|
-
// }));
|
|
116
|
-
// }
|
|
117
109
|
|
|
118
110
|
// Build CheckboxGroup options for this field
|
|
119
111
|
const fieldValues = valuesByFieldId.get(fieldId) || [];
|
|
@@ -253,10 +245,15 @@ async function loadJobs(_$w) {
|
|
|
253
245
|
let tempFilteredJobs=[];
|
|
254
246
|
let finalFilteredJobs=alljobs;
|
|
255
247
|
let addedJobsIds=[]
|
|
248
|
+
console.log("filterByField: ",filterByField)
|
|
256
249
|
if(filterByField!="Location") {
|
|
257
250
|
filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
|
|
258
251
|
}
|
|
252
|
+
else{
|
|
253
|
+
filterByField=JOBS_COLLECTION_FIELDS.CITY_TEXT;
|
|
254
|
+
}
|
|
259
255
|
|
|
256
|
+
console.log("selectedByField: ",selectedByField)
|
|
260
257
|
// AND across categories, OR within each category
|
|
261
258
|
for (const [, values] of selectedByField.entries()) {
|
|
262
259
|
for(job of finalFilteredJobs) {
|