sr-npm 1.7.628 → 1.7.630

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.628",
3
+ "version": "1.7.630",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -175,11 +175,18 @@ async function loadJobs(_$w) {
175
175
  };
176
176
 
177
177
  function updateOptionsUI($item, fieldId, searchQuery) {
178
- const base = optionsByFieldId.get(fieldId) || [];
178
+ let base = optionsByFieldId.get(fieldId) || [];
179
179
  const countsMap = countsByFieldId.get(fieldId) || new Map();
180
+ for (const element of countsMap)
181
+ {
182
+ if (element[1]===0)
183
+ {
184
+ base= base.filter(o => o.value !== element[0])
185
+ }
186
+ }
180
187
  // Build display options with counts
181
188
  const withCounts = base.map(o => {
182
- const count = countsMap.get(o.value) || 0;
189
+ const count = countsMap.get(o.value)
183
190
  return {
184
191
  label: `${o.label} (${count})`,
185
192
  value: o.value
@@ -253,17 +260,30 @@ async function refreshFacetCounts(_$w) {
253
260
  const selectedItems = [];
254
261
  for (const [fieldId, valueIds] of selectedByField.entries()) {
255
262
  const opts = optionsByFieldId.get(fieldId) || [];
256
- const byId = new Map(opts.map(o => [o.value, o.label]));
257
263
  for (const id of valueIds) {
258
- const label = byId.get(id);
259
- if (label) {
264
+ const found = opts.find((option) => option.value === id);
265
+ const label = found.label;
260
266
  selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
261
- }
262
267
  }
263
268
  }
264
269
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
265
270
  }
266
271
 
272
+ // function updateSelectedValuesRepeater(_$w) {
273
+ // const selectedItems = [];
274
+ // for (const [fieldId, valueIds] of selectedByField.entries()) {
275
+ // const opts = optionsByFieldId.get(fieldId) || [];
276
+ // const byId = new Map(opts.map(o => [o.value, o.label]));
277
+ // for (const id of valueIds) {
278
+ // const label = byId.get(id);
279
+ // if (label) {
280
+ // selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
281
+ // }
282
+ // }
283
+ // }
284
+ // _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
285
+ // }
286
+
267
287
  async function updateCurrentJobs(res) {
268
288
  let newcurrentJobs = [];
269
289
  newcurrentJobs.push(...res.items.map(job=>job._id));