sr-npm 1.7.749 → 1.7.751

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.749",
3
+ "version": "1.7.751",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -327,8 +327,6 @@ async function loadJobsRepeater(_$w) {
327
327
  tempFilteredJobs=[];
328
328
  }
329
329
  secondarySearchIsFilled? currentSecondarySearchJobs=finalFilteredJobs:currentJobs=finalFilteredJobs;
330
-
331
- //currentJobs=finalFilteredJobs;
332
330
  let jobsFirstPage=[];
333
331
  secondarySearchIsFilled? jobsFirstPage=currentSecondarySearchJobs.slice(0,pagination.pageSize):jobsFirstPage=currentJobs.slice(0,pagination.pageSize);
334
332
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
@@ -368,26 +366,7 @@ function handlePageUrlParam() {
368
366
  }
369
367
  async function refreshFacetCounts(_$w,clearAll=false) {
370
368
 
371
- console.log("refreshing facet counts");
372
-
373
369
  secondarySearchIsFilled? countJobsPerField(currentSecondarySearchJobs):countJobsPerField(currentJobs);
374
- // const fieldIds = Array.from(optionsByFieldId.keys());
375
- // const currentJobsIds=currentJobs.map(job=>job._id);
376
- // for (const fieldId of fieldIds) {
377
- // let currentoptions=optionsByFieldId.get(fieldId)
378
- // let counter=new Map();
379
- // for(const option of currentoptions) {
380
- // for (const jobId of currentJobsIds) {
381
- // if (valueToJobs[option.value].includes(jobId)) {
382
- // counter.set(option.value, (counter.get(option.value) || 0) + 1);
383
- // }
384
- // }
385
- // }
386
- // countsByFieldId.set(fieldId, counter);
387
- // }
388
-
389
- console.log("countsByFieldId: ", countsByFieldId);
390
-
391
370
  for(const field of allfields) {
392
371
  const query = (_$w(`#${FiltersIds[field.title]}input`).value || '').toLowerCase().trim();
393
372
  clearAll? updateOptionsUI(_$w,field.title, field._id, '',true):updateOptionsUI(_$w,field.title, field._id, query);
@@ -397,7 +376,6 @@ async function refreshFacetCounts(_$w,clearAll=false) {
397
376
 
398
377
 
399
378
  function countJobsPerField(jobs) {
400
- console.log("counting jobs per field for jobs: ", jobs);
401
379
  const fieldIds = Array.from(optionsByFieldId.keys());
402
380
  const currentJobsIds=jobs.map(job=>job._id);
403
381
  for (const fieldId of fieldIds) {
@@ -412,7 +390,6 @@ async function refreshFacetCounts(_$w,clearAll=false) {
412
390
  }
413
391
  countsByFieldId.set(fieldId, counter);
414
392
  }
415
- console.log("countsByFieldId inside countJobsPerField: ", countsByFieldId);
416
393
  }
417
394
 
418
395
 
@@ -434,12 +411,10 @@ function primarySearch(_$w,query) {
434
411
  console.log("primary search query: ", query);
435
412
  }
436
413
  async function secondarySearch(_$w,query) {
437
- console.log("secondary search query: ", query);
438
414
  if(query.length===0 || query===undefined || query==='') {
439
- console.log("secondary search query is empty, resetting secondary search");
440
- // allsecondarySearchJobs=currentJobs;
441
415
  secondarySearchIsFilled=false;
442
-
416
+ await updateJobsAndNumbersAndFilters(_$w); // we do this here because of the case when searching the list and adding filters from the side, and we delete the search query, so we need to refresh the counts and the jobs
417
+ return;
443
418
  }
444
419
  else {
445
420
  allsecondarySearchJobs=currentJobs.filter(job=>job.title.toLowerCase().includes(query));
@@ -457,9 +432,10 @@ async function secondarySearch(_$w,query) {
457
432
  }
458
433
  secondarySearchIsFilled=true
459
434
  }
435
+
460
436
  handlePaginationButtons(_$w);
461
437
  updateTotalJobsCountText(_$w);
462
- await refreshFacetCounts(_$w); //false for clearAll, true for secondarySearch
438
+ await refreshFacetCounts(_$w);
463
439
  return allsecondarySearchJobs;
464
440
  }
465
441
  async function bindSearchInput(_$w) {