sr-npm 1.7.627 → 1.7.629
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
|
@@ -72,6 +72,7 @@ async function loadJobs(_$w) {
|
|
|
72
72
|
|
|
73
73
|
function updateTotalJobsCountText(_$w) {
|
|
74
74
|
_$w('#totalJobsCountText').text = `${currentJobs.length} Jobs`;
|
|
75
|
+
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
async function loadFilters(_$w) {
|
|
@@ -176,9 +177,17 @@ async function loadJobs(_$w) {
|
|
|
176
177
|
function updateOptionsUI($item, fieldId, searchQuery) {
|
|
177
178
|
const base = optionsByFieldId.get(fieldId) || [];
|
|
178
179
|
const countsMap = countsByFieldId.get(fieldId) || new Map();
|
|
180
|
+
let countsMapWithoutZero=new Map()
|
|
181
|
+
for (const element of countsMap)
|
|
182
|
+
{
|
|
183
|
+
if (element[1]!=0)
|
|
184
|
+
{
|
|
185
|
+
countsMapWithoutZero.set(element[0],element[1])
|
|
186
|
+
}
|
|
187
|
+
}
|
|
179
188
|
// Build display options with counts
|
|
180
189
|
const withCounts = base.map(o => {
|
|
181
|
-
const count =
|
|
190
|
+
const count = countsMapWithoutZero.get(o.value)
|
|
182
191
|
return {
|
|
183
192
|
label: `${o.label} (${count})`,
|
|
184
193
|
value: o.value
|
|
@@ -252,17 +261,30 @@ async function refreshFacetCounts(_$w) {
|
|
|
252
261
|
const selectedItems = [];
|
|
253
262
|
for (const [fieldId, valueIds] of selectedByField.entries()) {
|
|
254
263
|
const opts = optionsByFieldId.get(fieldId) || [];
|
|
255
|
-
const byId = new Map(opts.map(o => [o.value, o.label]));
|
|
256
264
|
for (const id of valueIds) {
|
|
257
|
-
const
|
|
258
|
-
|
|
265
|
+
const found = opts.find((option) => option.value === id);
|
|
266
|
+
const label = found.label;
|
|
259
267
|
selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
|
|
260
|
-
}
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
|
|
264
271
|
}
|
|
265
272
|
|
|
273
|
+
// function updateSelectedValuesRepeater(_$w) {
|
|
274
|
+
// const selectedItems = [];
|
|
275
|
+
// for (const [fieldId, valueIds] of selectedByField.entries()) {
|
|
276
|
+
// const opts = optionsByFieldId.get(fieldId) || [];
|
|
277
|
+
// const byId = new Map(opts.map(o => [o.value, o.label]));
|
|
278
|
+
// for (const id of valueIds) {
|
|
279
|
+
// const label = byId.get(id);
|
|
280
|
+
// if (label) {
|
|
281
|
+
// selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
|
|
282
|
+
// }
|
|
283
|
+
// }
|
|
284
|
+
// }
|
|
285
|
+
// _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
|
|
286
|
+
// }
|
|
287
|
+
|
|
266
288
|
async function updateCurrentJobs(res) {
|
|
267
289
|
let newcurrentJobs = [];
|
|
268
290
|
newcurrentJobs.push(...res.items.map(job=>job._id));
|