sr-npm 1.7.634 → 1.7.636

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.634",
3
+ "version": "1.7.636",
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
@@ -30,8 +31,10 @@ async function careersMultiBoxesPageOnReady(_$w) {
30
31
 
31
32
  // Deselect this value from both the selected map and the multibox
32
33
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
34
+
33
35
  const fieldId = itemData.fieldId;
34
36
  const valueId = itemData.valueId;
37
+ dontUpdateThisCheckBox=fieldId;
35
38
  if (!fieldId || !valueId) return;
36
39
 
37
40
  const existing = selectedByField.get(fieldId) || [];
@@ -117,6 +120,7 @@ async function loadJobs(_$w) {
117
120
 
118
121
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).selectedIndices = []; // start empty
119
122
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).onChange(async (ev) => {
123
+ dontUpdateThisCheckBox=fieldId;
120
124
  const selected = ev.target.value; // array of selected value IDs
121
125
  if (selected && selected.length) {
122
126
  selectedByField.set(fieldId, selected);
@@ -179,6 +183,11 @@ async function loadJobs(_$w) {
179
183
  const countsMap = countsByFieldId.get(fieldId) || new Map();
180
184
  console.log("base before filtering: ",base)
181
185
  console.log("countsMap: ",countsMap)
186
+ if(dontUpdateThisCheckBox===fieldId)
187
+ {
188
+ dontUpdateThisCheckBox=null;
189
+ return;
190
+ }
182
191
  let filteredbase=[]
183
192
 
184
193