sr-npm 3.1.29 → 3.1.31

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": "3.1.29",
3
+ "version": "3.1.31",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -128,6 +128,7 @@ else{
128
128
  }
129
129
 
130
130
  async function clearAll(_$w,urlOnChange=false) {
131
+ try{
131
132
 
132
133
  for(const field of allfields) {
133
134
  _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [];
@@ -147,6 +148,9 @@ async function clearAll(_$w,urlOnChange=false) {
147
148
  await updateJobsAndNumbersAndFilters(_$w,true);
148
149
  }
149
150
 
151
+ } catch (error) {
152
+ console.error('clearAll failed, error:', error);
153
+ }
150
154
  }
151
155
 
152
156
  async function handleFilterButton(_$w) {
@@ -247,7 +251,7 @@ async function handleUrlParams(_$w,urlParams,handleBackAndForth=false) {
247
251
  handlePaginationButtons(_$w);
248
252
  }
249
253
  } catch (error) {
250
- console.error('Failed to handle url params:', error);
254
+ console.error('handleUrlParams failed, error:', error);
251
255
  }
252
256
  }
253
257
 
@@ -306,7 +310,7 @@ async function handleParams(_$w,param,values) {
306
310
  await _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_INPUT).scrollTo();
307
311
  });
308
312
  } catch (error) {
309
- console.error('Failed to load pagination buttons:', error);
313
+ console.error('loadPaginationButtons failed, error:', error);
310
314
  }
311
315
  }
312
316
 
@@ -316,6 +320,7 @@ async function handleParams(_$w,param,values) {
316
320
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
317
321
  // Deselect this value from both the selected map and the multibox
318
322
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
323
+ try{
319
324
  const fieldId = itemData.fieldId;
320
325
  const valueId = itemData.valueId;
321
326
  dontUpdateThisCheckBox=fieldId;
@@ -343,6 +348,9 @@ async function handleParams(_$w,param,values) {
343
348
  const nextVals = currentVals.filter(v => v !== valueId);
344
349
  _$w(`#${FiltersIds[field.title]}CheckBox`).value = nextVals;
345
350
  await updateJobsAndNumbersAndFilters(_$w);
351
+ } catch (error) {
352
+ console.error(`deselect value failed, label: ${itemData.label}, error: `, error);
353
+ }
346
354
 
347
355
  });
348
356
  });
@@ -439,7 +447,7 @@ async function loadJobsRepeater(_$w) {
439
447
 
440
448
  _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
441
449
  _$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
442
-
450
+ try{
443
451
  dontUpdateThisCheckBox=field._id;
444
452
  const selected = ev.target.value; // array of selected value IDs
445
453
  let fieldTitle=field.title.toLowerCase().replace(' ', '');
@@ -468,6 +476,10 @@ async function loadJobsRepeater(_$w) {
468
476
 
469
477
  console.log("selectedByField: ",selectedByField)
470
478
  await updateJobsAndNumbersAndFilters(_$w);
479
+ }
480
+ catch (error) {
481
+ console.error(`CheckBox onchange failed,${FiltersIds[field.title]}, error: `, error);
482
+ }
471
483
  });
472
484
 
473
485
  const runFilter = debounce(() => {
@@ -731,6 +743,7 @@ function updateSelectedValuesRepeater(_$w) {
731
743
 
732
744
 
733
745
  async function secondarySearch(_$w,query) {
746
+ try{
734
747
  if(query.length===0 || query===undefined || query==='') {
735
748
  secondarySearchIsFilled=false;
736
749
  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
@@ -759,6 +772,9 @@ async function secondarySearch(_$w,query) {
759
772
  updateTotalJobsCountText(_$w);
760
773
  await refreshFacetCounts(_$w);
761
774
  return allsecondarySearchJobs;
775
+ } catch (error) {
776
+ console.error('secondary search failed, error:', error);
777
+ }
762
778
  }
763
779
  function bindSearchInput(_$w) {
764
780
  try {
@@ -27,7 +27,7 @@ const {
27
27
 
28
28
  if(companysegmentValue===undefined || companysegmentValue.length===0) {
29
29
 
30
- _$w("#notifyMe").hide()
30
+ _$w("#notifyMeSection").collapse()
31
31
  console.log(`companysegmentValue is ${siteconfig.showNotifyMeForCompanySegment}, hiding notifyMe`);
32
32
  }
33
33
 
@@ -128,7 +128,8 @@ async function getCategoryValue(customValues) {
128
128
  _$w('#applyButton').link=url; //so it can be clicked
129
129
  }
130
130
  catch(error){
131
- console.warn("error in handleApplyButton: , using applyLink directly", error);
131
+ console.error("handleApplyButton failed, error: ", error);
132
+ console.log("using applyLink directly");
132
133
  _$w('#applyButton').target="_blank";
133
134
  _$w('#applyButton').link=item.applyLink;
134
135
  }
@@ -27,8 +27,9 @@ function loadCategoryRepeaterData(_$w, allvaluesobjects) {
27
27
 
28
28
  async function bindPrimarySearch(_$w) {
29
29
  handleCategoryEvents(_$w);
30
-
30
+
31
31
  await handleSearchInput(_$w);
32
+
32
33
 
33
34
  // on mouse out collapse the results container
34
35
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).onMouseOut(async () => {
@@ -127,7 +128,20 @@ async function queryPrimarySearchResults(_$w, query) {
127
128
  await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).setFilter(filter);
128
129
  await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).refresh();
129
130
 
130
- let count = _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).getTotalCount();
131
+ let count=0
132
+ try{
133
+ count = _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).getTotalCount();
134
+ }
135
+ catch (error) {
136
+ if(error.message==="Cannot read properties of undefined (reading 'total')")
137
+ {
138
+ console.warn('failed to get total count due to known error, using 0')
139
+
140
+ }
141
+ else{
142
+ console.error('Failed to get total count:', error);
143
+ }
144
+ }
131
145
 
132
146
  if( count > 0 ) {
133
147
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
@@ -138,7 +152,22 @@ async function queryPrimarySearchResults(_$w, query) {
138
152
  await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).setFilter(filter);
139
153
  await _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).refresh();
140
154
 
141
- count = _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).getTotalCount();
155
+
156
+ try{
157
+ count = _$w(GLOBAL_SECTIONS_SELECTORS.JOBS_DATASET).getTotalCount();
158
+ }
159
+ catch (error) {
160
+ if(error.message==="Cannot read properties of undefined (reading 'total')")
161
+ {
162
+ console.warn('failed to get total count due to known error, using 0')
163
+
164
+ }
165
+ else
166
+ {
167
+ console.error('Failed to get total count:', error);
168
+ }
169
+
170
+ }
142
171
  if (count > 0) {
143
172
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
144
173
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState(PRIMARY_SEARCH_STATES.JOB_RESULTS);