sr-npm 1.7.810 → 1.7.812

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.810",
3
+ "version": "1.7.812",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,13 +7,14 @@ const {
7
7
  appendQueryParams
8
8
  } = require('../public/utils');
9
9
 
10
- let categoryValueId;
10
+
11
11
 
12
12
 
13
13
  async function positionPageOnReady(_$w) {
14
14
 
15
15
  await bind(_$w);
16
16
 
17
+
17
18
 
18
19
  }
19
20
 
@@ -22,8 +23,8 @@ async function getCategoryValueId(customFields) {
22
23
  console.log("categoryCustomField@@$@$@$#$@: ", categoryCustomField);
23
24
  for(const field of customFields) {
24
25
  if(field.customField===categoryCustomField._id) {
25
- categoryValueId=field._id;
26
- return;
26
+ return field._id;
27
+
27
28
  }
28
29
  }
29
30
  }
@@ -34,7 +35,7 @@ async function getCategoryValueId(customFields) {
34
35
 
35
36
  const item = await _$w('#datasetJobsItem').getCurrentItem();
36
37
  const multiRefField=await getPositionWithMultiRefField(item._id);
37
- await getCategoryValueId(multiRefField);
38
+ const categoryValueId=await getCategoryValueId(multiRefField);
38
39
  console.log("multiRefField@@$@$@$#$@: ", multiRefField);
39
40
  console.log("categoryValueId@@$@$@$#$@: ", categoryValueId);
40
41
 
@@ -52,11 +53,25 @@ async function getCategoryValueId(customFields) {
52
53
  _$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
53
54
  }
54
55
  console.log("i am here 2");
56
+ if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
57
+ {
58
+ console.log("i am here 3");
59
+ const relatedJobs=await getRelatedJobs();
60
+ console.log("relatedJobs@@$@$@$$%%%%%%%%%%#$@: ", relatedJobs);
61
+ _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
62
+ $item('#relatedJobTitle').text = itemData.title;
63
+ $item('#relatedJobLocation').text = itemData.location.fullLocation;
64
+ $item('#relatedJobTitle').onClick(async () => {
65
+ await location.to(itemData["link-jobs-title"]);
66
+ });
67
+ });
68
+ _$w('#relatedJobsRepNoDepartment').data = relatedJobs.slice(0,5);
69
+
70
+ }
55
71
  });
56
72
 
57
73
  if(_$w('#relatedJobsDataset') && _$w('#relatedJobsDataset').length>0)
58
74
  {
59
- console.log("relatedJobsDataset@@$@$@$#$@ is : ",_$w('#relatedJobsDataset'));
60
75
  _$w('#relatedJobsDataset').onReady(() => {
61
76
  const count = _$w('#relatedJobsDataset').getTotalCount();
62
77
  if(!count){
@@ -64,22 +79,7 @@ async function getCategoryValueId(customFields) {
64
79
  }
65
80
  });
66
81
  }
67
-
68
- if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
69
- {
70
- console.log("i am here 3");
71
- const relatedJobs=await getRelatedJobs();
72
- console.log("relatedJobs@@$@$@$$%%%%%%%%%%#$@: ", relatedJobs);
73
- _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
74
- $item('#relatedJobTitle').text = itemData.title;
75
- $item('#relatedJobLocation').text = itemData.location.fullLocation;
76
- $item('#relatedJobTitle').onClick(async () => {
77
- await location.to(itemData["link-jobs-title"]);
78
- });
79
- });
80
- _$w('#relatedJobsRepNoDepartment').data = relatedJobs.slice(0,5);
81
-
82
- }
82
+
83
83
  }
84
84
 
85
85
  function handleReferFriendButton(_$w,item) {
@@ -96,7 +96,9 @@ async function getCategoryValueId(customFields) {
96
96
  }
97
97
 
98
98
  async function getRelatedJobs() {
99
- const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,categoryValueId).find();
99
+ console.log("categoryValueId inside getRelatedJobs ", categoryValueId);
100
+ console.log("type of categoryValueId: ", typeof categoryValueId);
101
+ const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,[categoryValueId]).find();
100
102
  console.log("relatedJobs@@$@$@$#$@: ", relatedJobs);
101
103
  return relatedJobs.items;
102
104
  }