sr-npm 1.7.811 → 1.7.813
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 +1 -1
- package/pages/positionPage.js +22 -22
package/package.json
CHANGED
package/pages/positionPage.js
CHANGED
|
@@ -7,13 +7,14 @@ const {
|
|
|
7
7
|
appendQueryParams
|
|
8
8
|
} = require('../public/utils');
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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(categoryValueId);
|
|
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) {
|
|
@@ -95,7 +95,7 @@ async function getCategoryValueId(customFields) {
|
|
|
95
95
|
_$w('#applyButton').link=url; //so it can be clicked
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
async function getRelatedJobs() {
|
|
98
|
+
async function getRelatedJobs(categoryValueId) {
|
|
99
99
|
console.log("categoryValueId inside getRelatedJobs ", categoryValueId);
|
|
100
100
|
console.log("type of categoryValueId: ", typeof categoryValueId);
|
|
101
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();
|