sr-npm 1.7.652 → 1.7.654
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
|
@@ -89,11 +89,14 @@ async function loadJobs(_$w) {
|
|
|
89
89
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).data = fields;
|
|
90
90
|
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
91
91
|
console.log("cities: ",cities)
|
|
92
|
+
for(const city of cities) {
|
|
93
|
+
valueToJobs[city._id]=city.jobIds;
|
|
94
|
+
}
|
|
92
95
|
// 2) Load all values once and group them by referenced field
|
|
93
96
|
|
|
94
97
|
let valuesByFieldId = groupValuesByField(allvaluesobjects, CUSTOM_VALUES_COLLECTION_FIELDS.CUSTOM_FIELD);
|
|
95
98
|
console.log("valuesByFieldId: ",valuesByFieldId)
|
|
96
|
-
valuesByFieldId
|
|
99
|
+
valuesByFieldId.set("Location",cities)
|
|
97
100
|
console.log("valuesByFieldId after addubg cities: ",valuesByFieldId)
|
|
98
101
|
valuesByFieldIdGlobal = valuesByFieldId; // store globally
|
|
99
102
|
|
|
@@ -126,11 +129,15 @@ async function loadJobs(_$w) {
|
|
|
126
129
|
}));
|
|
127
130
|
}
|
|
128
131
|
else{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
originalOptions=fieldValues
|
|
133
|
+
}
|
|
134
|
+
console.log("originalOptions: ",originalOptions)
|
|
135
|
+
// else{
|
|
136
|
+
// originalOptions = fieldValues.map(v => ({
|
|
137
|
+
// label: v.title ,
|
|
138
|
+
// value: v._id
|
|
139
|
+
// }));
|
|
140
|
+
// }
|
|
134
141
|
optionsByFieldId.set(fieldId, originalOptions);
|
|
135
142
|
const counter={}
|
|
136
143
|
|
|
@@ -300,9 +307,11 @@ async function refreshFacetCounts(_$w) {
|
|
|
300
307
|
const map = new Map();
|
|
301
308
|
for (const v of values) {
|
|
302
309
|
const ref = v[refKey]; // should be the _id of the CustomFields item
|
|
303
|
-
if (!ref) continue;
|
|
304
310
|
if (!map.has(ref)) map.set(ref, []);
|
|
305
|
-
map.get(ref).push(
|
|
311
|
+
map.get(ref).push({
|
|
312
|
+
label: v.title ,
|
|
313
|
+
value: v._id
|
|
314
|
+
});
|
|
306
315
|
}
|
|
307
316
|
return map;
|
|
308
317
|
}
|