sr-npm 1.7.629 → 1.7.631

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.629",
3
+ "version": "1.7.631",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -175,24 +175,26 @@ 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
- let countsMapWithoutZero=new Map()
180
+ console.log("base before filtering: ",base)
181
181
  for (const element of countsMap)
182
182
  {
183
- if (element[1]!=0)
183
+ if (element[1]===0)
184
184
  {
185
- countsMapWithoutZero.set(element[0],element[1])
185
+ base= base.filter(o => o.value !== element[0])
186
186
  }
187
187
  }
188
+ console.log("base after filtering: ",base)
188
189
  // Build display options with counts
189
190
  const withCounts = base.map(o => {
190
- const count = countsMapWithoutZero.get(o.value)
191
+ const count = countsMap.get(o.value)
191
192
  return {
192
193
  label: `${o.label} (${count})`,
193
194
  value: o.value
194
195
  };
195
196
  });
197
+ console.log("withCounts: ",withCounts)
196
198
  // Apply search
197
199
  const filtered = searchQuery
198
200
  ? withCounts.filter(o => (o.label || '').toLowerCase().includes(searchQuery))
@@ -202,6 +204,8 @@ async function loadJobs(_$w) {
202
204
  const prevSelected = $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value || [];
203
205
  const visibleSet = new Set(filtered.map(o => o.value));
204
206
  const preserved = prevSelected.filter(v => visibleSet.has(v));
207
+ console.log("preserved: ",preserved)
208
+ console.log("filtered: ",filtered)
205
209
 
206
210
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).options = filtered;
207
211
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value = preserved;