sr-npm 1.7.783 → 1.7.785
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 -1
- package/package.json +1 -1
- package/pages/pagesUtils.js +10 -4
- package/pages/supportTeamsPage.js +6 -4
package/backend/consts.js
CHANGED
|
@@ -86,7 +86,7 @@ const supportTeamsPageIds={
|
|
|
86
86
|
JOB_TITLE: "#jobTitle",
|
|
87
87
|
SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
|
|
88
88
|
TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
|
|
89
|
-
|
|
89
|
+
valueToValueIdMap: {
|
|
90
90
|
"Human Resouces":"PeopleSupport",
|
|
91
91
|
"Buying":"Merchandise",
|
|
92
92
|
"Tech":"InformationServices",
|
package/package.json
CHANGED
package/pages/pagesUtils.js
CHANGED
|
@@ -58,10 +58,15 @@ function groupValuesByField(values, refKey) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async function
|
|
61
|
+
async function getValueFromValueId(valueId) {
|
|
62
62
|
const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
return result.find(value=>value._id===valueId);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function getLatestJobsByValueId(Value) {
|
|
67
|
+
console.log("Value: ", Value);
|
|
68
|
+
const jobs=Value.multiRefJobsCustomValues;
|
|
69
|
+
console.log("jobs: ", jobs);
|
|
65
70
|
|
|
66
71
|
const latestJobs = jobs
|
|
67
72
|
.sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
|
|
@@ -77,5 +82,6 @@ function groupValuesByField(values, refKey) {
|
|
|
77
82
|
getFieldByTitle,
|
|
78
83
|
getCorrectOption,
|
|
79
84
|
getOptionIndexFromCheckBox,
|
|
80
|
-
|
|
85
|
+
getLatestJobsByValueId,
|
|
86
|
+
getValueFromValueId
|
|
81
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { getLatestJobsByValueId, getValueFromValueId } = require('./pagesUtils');
|
|
2
2
|
const { location } = require("@wix/site-location");
|
|
3
3
|
const { supportTeamsPageIds } = require('../backend/consts');
|
|
4
4
|
|
|
@@ -21,12 +21,14 @@ async function bind(_$w) {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
24
|
-
const
|
|
25
|
-
const
|
|
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);
|
|
26
28
|
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
27
29
|
|
|
28
30
|
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
|
|
29
|
-
await location.to(`/search?category=${
|
|
31
|
+
await location.to(`/search?category=${Value.title}`);
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
34
|
|