sr-npm 1.7.628 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.628",
3
+ "version": "1.7.629",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -177,9 +177,17 @@ async function loadJobs(_$w) {
177
177
  function updateOptionsUI($item, fieldId, searchQuery) {
178
178
  const base = optionsByFieldId.get(fieldId) || [];
179
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
+ }
180
188
  // Build display options with counts
181
189
  const withCounts = base.map(o => {
182
- const count = countsMap.get(o.value) || 0;
190
+ const count = countsMapWithoutZero.get(o.value)
183
191
  return {
184
192
  label: `${o.label} (${count})`,
185
193
  value: o.value
@@ -253,17 +261,30 @@ async function refreshFacetCounts(_$w) {
253
261
  const selectedItems = [];
254
262
  for (const [fieldId, valueIds] of selectedByField.entries()) {
255
263
  const opts = optionsByFieldId.get(fieldId) || [];
256
- const byId = new Map(opts.map(o => [o.value, o.label]));
257
264
  for (const id of valueIds) {
258
- const label = byId.get(id);
259
- if (label) {
265
+ const found = opts.find((option) => option.value === id);
266
+ const label = found.label;
260
267
  selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
261
- }
262
268
  }
263
269
  }
264
270
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
265
271
  }
266
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
+
267
288
  async function updateCurrentJobs(res) {
268
289
  let newcurrentJobs = [];
269
290
  newcurrentJobs.push(...res.items.map(job=>job._id));