sr-npm 1.7.919 → 1.7.920
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 +17 -23
package/package.json
CHANGED
package/pages/positionPage.js
CHANGED
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
} = require('../public/utils');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
|
|
15
15
|
async function positionPageOnReady(_$w) {
|
|
16
16
|
|
|
@@ -32,24 +32,11 @@ async function getCategoryValueId(customValues) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
async function bind(_$w) {
|
|
35
|
-
siteconfig=await wixData.query(COLLECTIONS.SITE_CONFIGS).find().then(result => result.items[0]);
|
|
36
35
|
_$w('#datasetJobsItem').onReady(async () => {
|
|
37
36
|
|
|
38
37
|
const item = await _$w('#datasetJobsItem').getCurrentItem();
|
|
39
|
-
if(siteconfig.customFields==="true"){
|
|
40
38
|
const multiRefField=await getPositionWithMultiRefField(item._id);
|
|
41
39
|
const categoryValueId=await getCategoryValueId(multiRefField);
|
|
42
|
-
const relatedJobs=await getRelatedJobs(categoryValueId,item._id,5);
|
|
43
|
-
console.log("relatedJobs: ", relatedJobs);
|
|
44
|
-
if(_$w('#relatedJobsRepNoDepartment') && relatedJobs.length>0) // when there is no department, we filter based on category
|
|
45
|
-
{
|
|
46
|
-
_$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
|
|
47
|
-
$item('#relatedJobTitle').text = itemData.title;
|
|
48
|
-
$item('#relatedJobLocation').text = itemData.location.fullLocation;
|
|
49
|
-
});
|
|
50
|
-
_$w('#relatedJobsRepNoDepartment').data = relatedJobs;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
40
|
handleReferFriendButton(_$w,item);
|
|
54
41
|
handleApplyButton(_$w,item);
|
|
55
42
|
|
|
@@ -62,18 +49,25 @@ async function getCategoryValueId(customValues) {
|
|
|
62
49
|
{
|
|
63
50
|
_$w('#additionalInfoText').text = htmlToText(item.jobDescription.additionalInformation.text);
|
|
64
51
|
}
|
|
65
|
-
|
|
52
|
+
if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
|
|
53
|
+
{
|
|
54
|
+
const relatedJobs=await getRelatedJobs(categoryValueId,item._id,5);
|
|
55
|
+
_$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
|
|
56
|
+
$item('#relatedJobTitle').text = itemData.title;
|
|
57
|
+
$item('#relatedJobLocation').text = itemData.location.fullLocation;
|
|
58
|
+
});
|
|
59
|
+
_$w('#relatedJobsRepNoDepartment').data = relatedJobs;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
}
|
|
66
63
|
});
|
|
67
|
-
if(isElementExistOnPage(_$w('#relatedJobsNoDepartmentItem')))
|
|
68
|
-
{
|
|
69
64
|
_$w('#relatedJobsNoDepartmentItem').onClick((event) => {
|
|
70
65
|
const data = _$w("#relatedJobsRepNoDepartment").data;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
66
|
+
const clickedItemData = data.find(
|
|
67
|
+
(item) => item._id === event.context.itemId,
|
|
68
|
+
);
|
|
69
|
+
location.to(clickedItemData["link-jobs-title"]);
|
|
70
|
+
});
|
|
77
71
|
if(isElementExistOnPage(_$w('#relatedJobsDataset')))
|
|
78
72
|
{
|
|
79
73
|
_$w('#relatedJobsDataset').onReady(() => {
|