sr-npm 1.7.785 → 1.7.787
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/consts.js +1 -0
- package/package.json +1 -1
- package/pages/pagesUtils.js +2 -5
- package/pages/supportTeamsPage.js +15 -8
package/backend/consts.js
CHANGED
|
@@ -86,6 +86,7 @@ const supportTeamsPageIds={
|
|
|
86
86
|
JOB_TITLE: "#jobTitle",
|
|
87
87
|
SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
|
|
88
88
|
TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
|
|
89
|
+
RECENTLY_ADDED_JOBS_SECTION: "#recentlyJobsSection",
|
|
89
90
|
valueToValueIdMap: {
|
|
90
91
|
"Human Resouces":"PeopleSupport",
|
|
91
92
|
"Buying":"Merchandise",
|
package/package.json
CHANGED
package/pages/pagesUtils.js
CHANGED
|
@@ -63,11 +63,8 @@ function groupValuesByField(values, refKey) {
|
|
|
63
63
|
return result.find(value=>value._id===valueId);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
async function
|
|
67
|
-
console.log("Value: ", Value);
|
|
66
|
+
async function getLatestJobsByValue(Value) {
|
|
68
67
|
const jobs=Value.multiRefJobsCustomValues;
|
|
69
|
-
console.log("jobs: ", jobs);
|
|
70
|
-
|
|
71
68
|
const latestJobs = jobs
|
|
72
69
|
.sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
|
|
73
70
|
.slice(0, 5);
|
|
@@ -82,6 +79,6 @@ function groupValuesByField(values, refKey) {
|
|
|
82
79
|
getFieldByTitle,
|
|
83
80
|
getCorrectOption,
|
|
84
81
|
getOptionIndexFromCheckBox,
|
|
85
|
-
|
|
82
|
+
getLatestJobsByValue,
|
|
86
83
|
getValueFromValueId
|
|
87
84
|
}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { getLatestJobsByValue, getValueFromValueId } = require('./pagesUtils');
|
|
2
2
|
const { location } = require("@wix/site-location");
|
|
3
3
|
const { supportTeamsPageIds } = require('../backend/consts');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
async function supportTeasmPageOnReady(_$w) {
|
|
8
|
-
|
|
8
|
+
handleRecentJobsSection(_$w);
|
|
9
9
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
async function
|
|
14
|
+
async function handleRecentJobsSection(_$w) {
|
|
15
|
+
|
|
16
|
+
const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
17
|
+
const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
|
|
18
|
+
const Value=await getValueFromValueId(valueId);
|
|
19
|
+
const latestsJobs=await getLatestJobsByValue(Value);
|
|
20
|
+
|
|
21
|
+
if(latestsJobs.length === 0) {
|
|
22
|
+
console.log("No jobs found , collapsing recently Jobs Section ");
|
|
23
|
+
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).collapse();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
|
|
16
28
|
$item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
|
|
17
29
|
$item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
|
|
@@ -20,11 +32,6 @@ async function bind(_$w) {
|
|
|
20
32
|
})
|
|
21
33
|
});
|
|
22
34
|
|
|
23
|
-
const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
24
|
-
const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
|
|
25
|
-
const Value=await getValueFromValueId(valueId);
|
|
26
|
-
console.log("Value: ", Value);
|
|
27
|
-
const latestsJobs=await getLatestJobsByValueId(Value);
|
|
28
35
|
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
29
36
|
|
|
30
37
|
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
|