sr-npm 1.7.654 → 1.7.655

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.654",
3
+ "version": "1.7.655",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,7 +15,6 @@ async function careersMultiBoxesPageOnReady(_$w) {
15
15
  if(alljobs.length===0) {
16
16
  alljobs=await getAllRecords(COLLECTIONS.JOBS);
17
17
  currentJobs=alljobs;
18
- console.log("alljobs: ",alljobs)
19
18
  }
20
19
  if(Object.keys(valueToJobs).length === 0){
21
20
  allvaluesobjects=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
@@ -84,18 +83,15 @@ async function loadJobs(_$w) {
84
83
  try {
85
84
  // 1) Load all categories (fields)
86
85
  let fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
87
- fields.push({_id:"Location",title:"Location"});
88
- console.log("fields: ",fields)
86
+ fields.push({_id:"Location",title:"Location"});
89
87
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).data = fields;
90
88
  const cities=await getAllRecords(COLLECTIONS.CITIES);
91
- console.log("cities: ",cities)
92
89
  for(const city of cities) {
93
90
  valueToJobs[city._id]=city.jobIds;
94
91
  }
95
92
  // 2) Load all values once and group them by referenced field
96
93
 
97
94
  let valuesByFieldId = groupValuesByField(allvaluesobjects, CUSTOM_VALUES_COLLECTION_FIELDS.CUSTOM_FIELD);
98
- console.log("valuesByFieldId: ",valuesByFieldId)
99
95
  valuesByFieldId.set("Location",cities)
100
96
  console.log("valuesByFieldId after addubg cities: ",valuesByFieldId)
101
97
  valuesByFieldIdGlobal = valuesByFieldId; // store globally
@@ -110,13 +106,6 @@ async function loadJobs(_$w) {
110
106
 
111
107
  // Set the filter label (category name)
112
108
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_LABEL).placeholder = itemData.title
113
-
114
- // if(fieldId==="Location") {
115
- // $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).options = cities.map(city=>({
116
- // label: city.city,
117
- // value: city._id
118
- // }));
119
- // }
120
109
 
121
110
  // Build CheckboxGroup options for this field
122
111
  const fieldValues = valuesByFieldId.get(fieldId) || [];
@@ -256,10 +245,15 @@ async function loadJobs(_$w) {
256
245
  let tempFilteredJobs=[];
257
246
  let finalFilteredJobs=alljobs;
258
247
  let addedJobsIds=[]
248
+ console.log("filterByField: ",filterByField)
259
249
  if(filterByField!="Location") {
260
250
  filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
261
251
  }
252
+ else{
253
+ filterByField=JOBS_COLLECTION_FIELDS.CITY_TEXT;
254
+ }
262
255
 
256
+ console.log("selectedByField: ",selectedByField)
263
257
  // AND across categories, OR within each category
264
258
  for (const [, values] of selectedByField.entries()) {
265
259
  for(job of finalFilteredJobs) {