sr-npm 1.7.665 → 1.7.667

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/backend/data.js CHANGED
@@ -7,11 +7,11 @@ const { getAllPositions } = require('./queries');
7
7
  const { retrieveSecretVal, getTokenFromCMS } = require('./secretsData');
8
8
 
9
9
 
10
- //let jobToCustomValues = {}
10
+
11
11
  let customValuesToJobs = {}
12
12
  let locationToJobs = {}
13
13
  let siteconfig;
14
- const EXCLUDED_CUSTOM_FIELDS = new Set(["Department","COUNTRY"]);
14
+ const EXCLUDED_CUSTOM_FIELDS = new Set(["Department","Country"]);
15
15
 
16
16
  function getBrand(customField) {
17
17
  return customField.find(field => field.fieldLabel === 'Brands')?.valueLabel;
@@ -73,7 +73,6 @@ function getEmploymentType(position,customFieldsValues) {
73
73
  customFieldsValues["employmentType"] = {};
74
74
  }
75
75
  customFieldsValues["employmentType"][position.typeOfEmployment.id] = position.typeOfEmployment.label;
76
- //jobToCustomValues[position.id] ? jobToCustomValues[position.id].push(position.typeOfEmployment.id) : jobToCustomValues[position.id]=[position.typeOfEmployment.id]
77
76
  customValuesToJobs[position.typeOfEmployment.id] ? customValuesToJobs[position.typeOfEmployment.id].push(position.id) : customValuesToJobs[position.typeOfEmployment.id]=[position.id]
78
77
  }
79
78
 
@@ -92,7 +91,6 @@ function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,custom
92
91
  }
93
92
  customFieldsValues[fieldId][valueId] = valueLabel;
94
93
 
95
- //jobToCustomValues[position.id] ? jobToCustomValues[position.id].push(valueId) : jobToCustomValues[position.id]=[valueId]
96
94
  customValuesToJobs[valueId] ? customValuesToJobs[valueId].push(position.id) : customValuesToJobs[valueId]=[position.id]
97
95
  }
98
96
  }
@@ -218,6 +216,8 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
218
216
  if (siteconfig.customFields==="true") {
219
217
  let customValues=await getAllCustomValues();
220
218
  console.log("inserting jobs references to custom values collection");
219
+ console.log("customValues: ",customValues)
220
+ console.log("customValues.items: ",customValues.items)
221
221
  for (const value of customValues.items) {
222
222
  await insertJobsReference(value._id);
223
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.665",
3
+ "version": "1.7.667",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,9 +25,49 @@ async function careersMultiBoxesPageOnReady(_$w) {
25
25
  }
26
26
 
27
27
  await loadJobs(_$w);
28
- await loadFilters(_$w);
28
+ // await loadFilters(_$w);
29
29
  //selected values repeater on item ready
30
- _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
30
+ //await loadSelectedValuesRepeater(_$w);
31
+ // _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
32
+ // $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
33
+
34
+ // // Deselect this value from both the selected map and the multibox
35
+ // $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
36
+
37
+ // const fieldId = itemData.fieldId;
38
+ // const valueId = itemData.valueId;
39
+ // dontUpdateThisCheckBox=fieldId;
40
+ // if (!fieldId || !valueId) return;
41
+
42
+ // const existing = selectedByField.get(fieldId) || [];
43
+ // const updated = existing.filter(v => v !== valueId);
44
+ // if (updated.length) {
45
+ // selectedByField.set(fieldId, updated);
46
+ // } else {
47
+ // selectedByField.delete(fieldId);
48
+ // }
49
+
50
+ // // Update the checkbox group UI inside the corresponding filter item
51
+ // _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).forEachItem(($filterItem, filterItemData) => {
52
+ // if (filterItemData._id === fieldId) {
53
+ // const currentVals = $filterItem(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value || [];
54
+ // const nextVals = currentVals.filter(v => v !== valueId);
55
+ // $filterItem(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value = nextVals;
56
+ // }
57
+ // });
58
+
59
+ // await applyJobFilters(_$w,fieldId);
60
+ // await refreshFacetCounts(_$w);
61
+ // await updateSelectedValuesRepeater(_$w);
62
+ // updateTotalJobsCountText(_$w);
63
+ // });
64
+ // });
65
+ // await updateSelectedValuesRepeater(_$w);
66
+
67
+ }
68
+
69
+ async function loadSelectedValuesRepeater(_$w) {
70
+ _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
31
71
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
32
72
 
33
73
  // Deselect this value from both the selected map and the multibox
@@ -62,7 +102,6 @@ async function careersMultiBoxesPageOnReady(_$w) {
62
102
  });
63
103
  });
64
104
  await updateSelectedValuesRepeater(_$w);
65
-
66
105
  }
67
106
 
68
107
  async function loadJobs(_$w) {
@@ -237,19 +276,8 @@ async function loadJobs(_$w) {
237
276
  let tempFilteredJobs=[];
238
277
  let finalFilteredJobs=alljobs;
239
278
  let addedJobsIds=[]
240
- // if(filterByField!="Location") {
241
- // filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
242
- // }
243
- // else{
244
- // filterByField=JOBS_COLLECTION_FIELDS.CITY_TEXT;
245
- // }
246
- console.log("filterByField: ",filterByField)
247
-
248
- console.log("selectedByField: ",selectedByField)
249
279
  // AND across categories, OR within each category
250
280
  for (const [key, values] of selectedByField.entries()) {
251
- console.log("key: ",key)
252
- console.log("values: ",values)
253
281
  for(job of finalFilteredJobs) {
254
282
  if(key==="Location"){
255
283
  //if it is location then we check if selecred values (which is an array) have job city text