sr-npm 1.7.633 → 1.7.635

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.633",
3
+ "version": "1.7.635",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,7 @@ const { items: wixData } = require('@wix/data');
3
3
  const {CAREERS_MULTI_BOXES_PAGE_CONSTS} = require('../backend/careersMultiBoxesPageIds');
4
4
 
5
5
  let valuesByFieldIdGlobal = null;
6
+ let dontUpdateThisCheckBox;
6
7
  const selectedByField = new Map(); // fieldId -> array of selected value IDs
7
8
  const optionsByFieldId = new Map(); // fieldId -> [{label, value}] array of objects with label which is the valueLabel and value which is the valueId
8
9
  const countsByFieldId = new Map(); // fieldId -> {valueId: count} map of counts for each valueId
@@ -117,6 +118,7 @@ async function loadJobs(_$w) {
117
118
 
118
119
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).selectedIndices = []; // start empty
119
120
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).onChange(async (ev) => {
121
+ dontUpdateThisCheckBox=fieldId;
120
122
  const selected = ev.target.value; // array of selected value IDs
121
123
  if (selected && selected.length) {
122
124
  selectedByField.set(fieldId, selected);
@@ -179,17 +181,26 @@ async function loadJobs(_$w) {
179
181
  const countsMap = countsByFieldId.get(fieldId) || new Map();
180
182
  console.log("base before filtering: ",base)
181
183
  console.log("countsMap: ",countsMap)
182
- for (const element of countsMap)
184
+ if(dontUpdateThisCheckBox===fieldId)
185
+ {
186
+ dontUpdateThisCheckBox=null;
187
+ return;
188
+ }
189
+ let filteredbase=[]
190
+
191
+
192
+
193
+ for (const element of base)
183
194
  {
184
195
  console.log("element: ",element)
185
- if (element[1]===0)
196
+ if(countsMap.get(element.value))
186
197
  {
187
- base= base.filter(o => o.value !== element[0])
198
+ filteredbase.push(element)
188
199
  }
189
200
  }
190
- console.log("base after filtering: ",base)
201
+ console.log("base after filtering: ",filteredbase)
191
202
  // Build display options with counts
192
- const withCounts = base.map(o => {
203
+ const withCounts = filteredbase.map(o => {
193
204
  const count = countsMap.get(o.value)
194
205
  return {
195
206
  label: `${o.label} (${count})`,