sr-npm 1.7.777 → 1.7.779
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/pagesUtils.js +13 -5
- package/pages/supportTeamsPage.js +10 -6
package/package.json
CHANGED
package/pages/pagesUtils.js
CHANGED
|
@@ -58,13 +58,21 @@ function groupValuesByField(values, refKey) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async function
|
|
62
|
-
console.log("
|
|
61
|
+
async function getLatestJobsByCategoryId(categoryId) {
|
|
62
|
+
console.log("categoryId: ", categoryId);
|
|
63
63
|
const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
64
64
|
console.log("result: ", result);
|
|
65
|
-
const categoryValue=result.filter(value=>value.
|
|
65
|
+
const categoryValue=result.filter(value=>value._id===categoryId);
|
|
66
66
|
console.log("categoryValue: ", categoryValue);
|
|
67
|
-
|
|
67
|
+
const jobs=categoryValue.multiRefJobsCustomValues;
|
|
68
|
+
console.log("jobs: ", jobs);
|
|
69
|
+
const latestJobs = jobs
|
|
70
|
+
.sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
|
|
71
|
+
.slice(0, 5);
|
|
72
|
+
console.log("latestJobs: ", latestJobs);
|
|
73
|
+
return latestJobs;
|
|
74
|
+
|
|
75
|
+
|
|
68
76
|
|
|
69
77
|
}
|
|
70
78
|
|
|
@@ -76,5 +84,5 @@ function groupValuesByField(values, refKey) {
|
|
|
76
84
|
getFieldByTitle,
|
|
77
85
|
getCorrectOption,
|
|
78
86
|
getOptionIndexFromCheckBox,
|
|
79
|
-
|
|
87
|
+
getLatestJobsByCategoryId
|
|
80
88
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { getLatestJobsByCategoryId } = require('./pagesUtils');
|
|
2
2
|
const { location } = require("@wix/site-location");
|
|
3
3
|
const RECENTLEY_ADDED_JOBS="#recentleyAddedJobs"
|
|
4
4
|
const JOB_LOCATION="#jobLocation"
|
|
5
5
|
const JOB_TITLE="#jobTitle"
|
|
6
6
|
const TEAM_NAME="#teamName"
|
|
7
7
|
const SEE_ALL_JOBS_TEXT="#seeAllJobsText"
|
|
8
|
+
const TEAM_SUPPORT_DYNAMIC_DATASET="#dynamicDataset"
|
|
9
|
+
const valueToCategoryIdMap={
|
|
10
|
+
"Human Resouces":"PeopleSupport"
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
async function supportTeasmPageOnReady(_$w) {
|
|
10
14
|
|
|
@@ -27,12 +31,12 @@ async function bindRepeater(_$w) {
|
|
|
27
31
|
await location.to(itemData["link-jobs-title"]);
|
|
28
32
|
})
|
|
29
33
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const latestsJobs=await
|
|
34
|
+
let obj= _$w(TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
35
|
+
console.log("obj: ", obj);
|
|
36
|
+
const categoryId=valueToCategoryIdMap[obj.title_fld]
|
|
37
|
+
const latestsJobs=await getLatestJobsByCategoryId(categoryId);
|
|
34
38
|
console.log("latestsJobs: ", latestsJobs);
|
|
35
|
-
|
|
39
|
+
_$w(RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
36
40
|
// const teamName=_$w(TEAM_NAME).label.toLowerCase();
|
|
37
41
|
// _$w(RECENTLEY_ADDED_JOBS).data = await getLatestJobsByCategory(teamName);
|
|
38
42
|
}
|