sr-npm 1.7.848 → 1.7.850

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.
@@ -46,6 +46,7 @@ const FiltersIds={
46
46
  "Employment Type": 'employmentType',
47
47
  "Contract Type": 'contractType',
48
48
  Brands: 'Brands',
49
+ Visibility: 'visibility',
49
50
  }
50
51
 
51
52
 
package/backend/data.js CHANGED
@@ -201,7 +201,7 @@ async function insertJobsReference(valueId) {
201
201
  async function populateCustomFieldsCollection(customFields) {
202
202
  let fieldstoinsert=[]
203
203
  customFields["employmentType"] = "Employment Type";
204
- customFields["visibility"] = "Visibility";
204
+ customFields["Visibility"] = "Visibility";
205
205
  for(const ID of Object.keys(customFields)){
206
206
  fieldstoinsert.push({
207
207
  title: customFields[ID],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.848",
3
+ "version": "1.7.850",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -271,6 +271,7 @@ async function loadJobsRepeater(_$w) {
271
271
  console.log("countsByFieldId: ", countsByFieldId);
272
272
  console.log("optionsByFieldId: ", optionsByFieldId);
273
273
  updateOptionsUI(_$w,field.title, field._id, ''); // no search query
274
+ console.log("after updateoptionUI");
274
275
  _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
275
276
  console.log("i am here 1 , field.title: ", field.title);
276
277
  _$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
@@ -315,7 +316,13 @@ console.log("i am here 5 ");
315
316
 
316
317
  function updateOptionsUI(_$w,fieldTitle, fieldId, searchQuery,clearAll=false) {
317
318
  let base = optionsByFieldId.get(fieldId) || [];
319
+ console.log("fieldTitle :", fieldTitle);
320
+ console.log("fieldId :", fieldId);
321
+ console.log("base :", base);
318
322
  const countsMap = countsByFieldId.get(fieldId) || new Map();
323
+ console.log("countsMap :", countsMap);
324
+ console.log("searchQuery :", searchQuery);
325
+ console.log("clearAll :", clearAll);
319
326
  if(dontUpdateThisCheckBox===fieldId && !clearAll)
320
327
  {
321
328
  dontUpdateThisCheckBox=null;
@@ -337,16 +344,21 @@ console.log("i am here 5 ");
337
344
  value: o.value
338
345
  };
339
346
  });
347
+ console.log("withCounts :", withCounts);
340
348
  // Apply search
341
349
  const filtered = searchQuery
342
350
  ? withCounts.filter(o => (o.label || '').toLowerCase().includes(searchQuery))
343
351
  : withCounts;
344
-
352
+ console.log("filtered :", filtered);
353
+
345
354
  // Preserve currently selected values that are still visible
346
355
  let prevSelected=[]
356
+ console.log("FiltersIds[fieldTitle] :", FiltersIds[fieldTitle]);
347
357
  clearAll? prevSelected=[]:prevSelected= _$w(`#${FiltersIds[fieldTitle]}CheckBox`).value;
348
358
  const visibleSet = new Set(filtered.map(o => o.value));
359
+ console.log("visibleSet :", visibleSet);
349
360
  const preserved = prevSelected.filter(v => visibleSet.has(v));
361
+ console.log("preserved :", preserved);
350
362
  _$w(`#${FiltersIds[fieldTitle]}CheckBox`).options = filtered;
351
363
  _$w(`#${FiltersIds[fieldTitle]}CheckBox`).value = preserved;
352
364
  }