sr-npm 1.7.636 → 1.7.637
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
|
@@ -82,8 +82,10 @@ async function loadJobs(_$w) {
|
|
|
82
82
|
try {
|
|
83
83
|
// 1) Load all categories (fields)
|
|
84
84
|
const fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
|
|
85
|
+
console.log("fields: ",fields)
|
|
85
86
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).data = fields;
|
|
86
|
-
|
|
87
|
+
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
88
|
+
console.log("cities: ",cities)
|
|
87
89
|
// 2) Load all values once and group them by referenced field
|
|
88
90
|
|
|
89
91
|
const valuesByFieldId = groupValuesByField(allvaluesobjects, CUSTOM_VALUES_COLLECTION_FIELDS.CUSTOM_FIELD);
|
|
@@ -181,26 +183,19 @@ async function loadJobs(_$w) {
|
|
|
181
183
|
function updateOptionsUI($item, fieldId, searchQuery) {
|
|
182
184
|
let base = optionsByFieldId.get(fieldId) || [];
|
|
183
185
|
const countsMap = countsByFieldId.get(fieldId) || new Map();
|
|
184
|
-
console.log("base before filtering: ",base)
|
|
185
|
-
console.log("countsMap: ",countsMap)
|
|
186
186
|
if(dontUpdateThisCheckBox===fieldId)
|
|
187
187
|
{
|
|
188
188
|
dontUpdateThisCheckBox=null;
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
let filteredbase=[]
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
192
|
for (const element of base)
|
|
196
193
|
{
|
|
197
|
-
console.log("element: ",element)
|
|
198
194
|
if(countsMap.get(element.value))
|
|
199
195
|
{
|
|
200
196
|
filteredbase.push(element)
|
|
201
197
|
}
|
|
202
198
|
}
|
|
203
|
-
console.log("base after filtering: ",filteredbase)
|
|
204
199
|
// Build display options with counts
|
|
205
200
|
const withCounts = filteredbase.map(o => {
|
|
206
201
|
const count = countsMap.get(o.value)
|
|
@@ -209,7 +204,6 @@ async function loadJobs(_$w) {
|
|
|
209
204
|
value: o.value
|
|
210
205
|
};
|
|
211
206
|
});
|
|
212
|
-
console.log("withCounts: ",withCounts)
|
|
213
207
|
// Apply search
|
|
214
208
|
const filtered = searchQuery
|
|
215
209
|
? withCounts.filter(o => (o.label || '').toLowerCase().includes(searchQuery))
|
|
@@ -219,8 +213,6 @@ async function loadJobs(_$w) {
|
|
|
219
213
|
const prevSelected = $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value || [];
|
|
220
214
|
const visibleSet = new Set(filtered.map(o => o.value));
|
|
221
215
|
const preserved = prevSelected.filter(v => visibleSet.has(v));
|
|
222
|
-
console.log("preserved: ",preserved)
|
|
223
|
-
console.log("filtered: ",filtered)
|
|
224
216
|
|
|
225
217
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).options = filtered;
|
|
226
218
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value = preserved;
|
|
@@ -290,21 +282,6 @@ async function refreshFacetCounts(_$w) {
|
|
|
290
282
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
|
|
291
283
|
}
|
|
292
284
|
|
|
293
|
-
// function updateSelectedValuesRepeater(_$w) {
|
|
294
|
-
// const selectedItems = [];
|
|
295
|
-
// for (const [fieldId, valueIds] of selectedByField.entries()) {
|
|
296
|
-
// const opts = optionsByFieldId.get(fieldId) || [];
|
|
297
|
-
// const byId = new Map(opts.map(o => [o.value, o.label]));
|
|
298
|
-
// for (const id of valueIds) {
|
|
299
|
-
// const label = byId.get(id);
|
|
300
|
-
// if (label) {
|
|
301
|
-
// selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
|
|
302
|
-
// }
|
|
303
|
-
// }
|
|
304
|
-
// }
|
|
305
|
-
// _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
|
|
306
|
-
// }
|
|
307
|
-
|
|
308
285
|
async function updateCurrentJobs(res) {
|
|
309
286
|
let newcurrentJobs = [];
|
|
310
287
|
newcurrentJobs.push(...res.items.map(job=>job._id));
|