sr-npm 1.7.698 → 1.7.700

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.698",
3
+ "version": "1.7.700",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,7 +15,8 @@ const pagination = {
15
15
  pageSize: 10,
16
16
  currentPage: 1,
17
17
  };
18
- async function careersMultiBoxesPageOnReady(_$w) {
18
+ async function careersMultiBoxesPageOnReady(_$w,queryParams) {
19
+ console.log("queryParams: ", queryParams);
19
20
  await loadData(_$w);
20
21
  await loadJobsRepeater(_$w);
21
22
  await loadFilters(_$w);
@@ -23,13 +24,20 @@ async function careersMultiBoxesPageOnReady(_$w) {
23
24
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CLEAR_ALL_BUTTON_ID).onClick(async () => {
24
25
  if(selectedByField.size>0) {
25
26
  selectedByField.clear();
26
- await applyJobFilters(_$w);
27
- await refreshFacetCounts(_$w,true);
28
- await updateSelectedValuesRepeater(_$w);
29
- updateTotalJobsCountText(_$w);
27
+ await updateJobsAndNumbersAndFilters(_$w,true);
30
28
  }
31
29
  });
32
30
  await loadPaginationButtons(_$w);
31
+ await handleUrlParams(_$w,queryParams);
32
+ }
33
+
34
+ async function handleUrlParams(_$w,queryParams) {
35
+ if(queryParams.Brand) {
36
+ const brandValue = decodeURIComponent(queryParams.Brand);
37
+ console.log("brandValue: ", brandValue);
38
+ console.log("selectedByField: ", selectedByField);
39
+ console.log("optionsByFieldId: ", optionsByFieldId);
40
+ }
33
41
  }
34
42
 
35
43
  async function loadPaginationButtons(_$w) {
@@ -77,10 +85,7 @@ async function loadSelectedValuesRepeater(_$w) {
77
85
  _$w(`#${FiltersIds[field.title]}CheckBox`).value = nextVals;
78
86
  }
79
87
  }
80
- await applyJobFilters(_$w);
81
- await refreshFacetCounts(_$w);
82
- await updateSelectedValuesRepeater(_$w);
83
- updateTotalJobsCountText(_$w);
88
+ await updateJobsAndNumbersAndFilters(_$w);
84
89
  });
85
90
  });
86
91
  await updateSelectedValuesRepeater(_$w);
@@ -168,10 +173,8 @@ async function loadJobsRepeater(_$w) {
168
173
  } else {
169
174
  selectedByField.delete(field._id);
170
175
  }
171
- await applyJobFilters(_$w); // re-query jobs
172
- await refreshFacetCounts(_$w); // recompute and update counts in all lists
173
- await updateSelectedValuesRepeater(_$w);
174
- updateTotalJobsCountText(_$w);
176
+ await updateJobsAndNumbersAndFilters(_$w);
177
+
175
178
  });
176
179
 
177
180
  const runFilter = debounce(() => {
@@ -190,7 +193,13 @@ async function loadJobsRepeater(_$w) {
190
193
  }
191
194
  }
192
195
 
193
-
196
+ async function updateJobsAndNumbersAndFilters(_$w) {
197
+ await applyJobFilters(_$w); // re-query jobs
198
+ await refreshFacetCounts(_$w); // recompute and update counts in all lists
199
+ await updateSelectedValuesRepeater(_$w);
200
+ updateTotalJobsCountText(_$w);
201
+ }
202
+
194
203
  function updateOptionsUI(_$w,fieldTitle, fieldId, searchQuery,clearAll=false) {
195
204
  let base = optionsByFieldId.get(fieldId) || [];
196
205
  const countsMap = countsByFieldId.get(fieldId) || new Map();
@@ -31,7 +31,7 @@ if(siteconfig===undefined) {
31
31
  siteconfig = queryResult.items[0];
32
32
  }
33
33
  if(siteconfig.customFields==="true") {
34
- await careersMultiBoxesPageOnReady(_$w);
34
+ await careersMultiBoxesPageOnReady(_$w,queryParams);
35
35
  }
36
36
  else{
37
37
  console.log("queryParams: ", queryParams);