sr-npm 1.7.780 → 1.7.781
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 +29 -0
- package/package.json +1 -1
- package/pages/pagesUtils.js +1 -10
- package/pages/supportTeamsPage.js +9 -21
package/backend/consts.js
CHANGED
|
@@ -80,9 +80,38 @@ const TASK_TYPE = {
|
|
|
80
80
|
EVENT: 'event',
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
const supportTeamsPageIds={
|
|
84
|
+
RECENTLEY_ADDED_JOBS: "#recentleyAddedJobs",
|
|
85
|
+
JOB_LOCATION: "#jobLocation",
|
|
86
|
+
JOB_TITLE: "#jobTitle",
|
|
87
|
+
SEE_ALL_JOBS_TEXT: "#seeAllJobsText",
|
|
88
|
+
TEAM_SUPPORT_DYNAMIC_DATASET: "#dynamicDataset",
|
|
89
|
+
valueToCategoryIdMap: {
|
|
90
|
+
"Human Resouces":"PeopleSupport",
|
|
91
|
+
"Buying":"Merchandise",
|
|
92
|
+
"Tech":"InformationServices",
|
|
93
|
+
"Planning":"Merchandise",
|
|
94
|
+
"Digital":"ecommerceandDigital",// this field doesnt exists in the database
|
|
95
|
+
"Marketing":"Marketing",
|
|
96
|
+
"Finance":"Finance",// this field doesnt exists in the database
|
|
97
|
+
"Services":"ServicesInstallation",
|
|
98
|
+
"Design":"Merchandise",
|
|
99
|
+
"Retail Operations":"Operations",// this field doesnt exists in the database
|
|
100
|
+
"Data":"InsightsandDataScience",// this field doesnt exists in the database
|
|
101
|
+
"Property":"Property",// this field doesnt exists in the database,
|
|
102
|
+
"Legal":"Legal",// this field doesnt exists in the database,
|
|
103
|
+
"Supply Chain":"Logistics",
|
|
104
|
+
"Contact Centre":"CustomerEngagementCentres",// this field doesnt exists in the database
|
|
105
|
+
"Commercial":"CommercialSales",// this field doesnt exists in the database
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
83
111
|
module.exports = {
|
|
84
112
|
TASKS_NAMES,
|
|
85
113
|
TASK_TYPE,
|
|
86
114
|
TASKS,
|
|
87
115
|
QUERY_MAX_LIMIT,
|
|
116
|
+
supportTeamsPageIds,
|
|
88
117
|
};
|
package/package.json
CHANGED
package/pages/pagesUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { items: wixData } = require('@wix/data');
|
|
2
|
-
const { JOBS_COLLECTION_FIELDS, COLLECTIONS
|
|
2
|
+
const { JOBS_COLLECTION_FIELDS, COLLECTIONS } = require('../backend/collectionConsts');
|
|
3
3
|
|
|
4
4
|
function groupValuesByField(values, refKey) {
|
|
5
5
|
const map = new Map();
|
|
@@ -59,23 +59,14 @@ function groupValuesByField(values, refKey) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
async function getLatestJobsByCategoryId(categoryId) {
|
|
62
|
-
console.log("categoryId: ", categoryId);
|
|
63
62
|
const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
64
|
-
console.log("result: ", result);
|
|
65
63
|
const categoryValue=result.find(value=>value._id===categoryId);
|
|
66
|
-
console.log("categoryValue: ", categoryValue);
|
|
67
64
|
const jobs=categoryValue.multiRefJobsCustomValues;
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
console.log("jobs: ", jobs);
|
|
71
66
|
const latestJobs = jobs
|
|
72
67
|
.sort((a, b) => new Date(b.releasedDate) - new Date(a.releasedDate))
|
|
73
68
|
.slice(0, 5);
|
|
74
|
-
console.log("latestJobs: ", latestJobs);
|
|
75
69
|
return latestJobs;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
module.exports = {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
const { getLatestJobsByCategoryId } = require('./pagesUtils');
|
|
2
2
|
const { location } = require("@wix/site-location");
|
|
3
|
-
const
|
|
4
|
-
const JOB_LOCATION="#jobLocation"
|
|
5
|
-
const JOB_TITLE="#jobTitle"
|
|
6
|
-
const TEAM_NAME="#teamName"
|
|
7
|
-
const SEE_ALL_JOBS_TEXT="#seeAllJobsText"
|
|
8
|
-
const TEAM_SUPPORT_DYNAMIC_DATASET="#dynamicDataset"
|
|
9
|
-
const valueToCategoryIdMap={
|
|
10
|
-
"Human Resouces":"PeopleSupport"
|
|
11
|
-
}
|
|
3
|
+
const { supportTeamsPageIds } = require('../backend/consts');
|
|
12
4
|
|
|
13
5
|
async function supportTeasmPageOnReady(_$w) {
|
|
14
6
|
|
|
@@ -18,27 +10,23 @@ async function supportTeasmPageOnReady(_$w) {
|
|
|
18
10
|
|
|
19
11
|
function loadOnClick(_$w)
|
|
20
12
|
{
|
|
21
|
-
_$w(SEE_ALL_JOBS_TEXT).onClick(async () => {
|
|
13
|
+
_$w(supportTeamsPageIds.SEE_ALL_JOBS_TEXT).onClick(async () => {
|
|
22
14
|
await location.to(`/search`);
|
|
23
15
|
});
|
|
24
16
|
}
|
|
25
17
|
|
|
26
18
|
async function bindRepeater(_$w) {
|
|
27
|
-
_$w(RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
|
|
28
|
-
$item(JOB_TITLE).text = itemData.title;
|
|
29
|
-
$item(JOB_LOCATION).text = itemData.location.fullLocation;
|
|
30
|
-
$item(JOB_TITLE).onClick(async () => {
|
|
19
|
+
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).onItemReady(($item, itemData) => {
|
|
20
|
+
$item(supportTeamsPageIds.JOB_TITLE).text = itemData.title;
|
|
21
|
+
$item(supportTeamsPageIds.JOB_LOCATION).text = itemData.location.fullLocation;
|
|
22
|
+
$item(supportTeamsPageIds.JOB_TITLE).onClick(async () => {
|
|
31
23
|
await location.to(itemData["link-jobs-title"]);
|
|
32
24
|
})
|
|
33
25
|
});
|
|
34
|
-
let obj= _$w(TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
35
|
-
|
|
36
|
-
const categoryId=valueToCategoryIdMap[obj.title_fld]
|
|
26
|
+
let obj= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
|
|
27
|
+
const categoryId=supportTeamsPageIds.valueToCategoryIdMap[obj.title_fld]
|
|
37
28
|
const latestsJobs=await getLatestJobsByCategoryId(categoryId);
|
|
38
|
-
|
|
39
|
-
_$w(RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
40
|
-
// const teamName=_$w(TEAM_NAME).label.toLowerCase();
|
|
41
|
-
// _$w(RECENTLEY_ADDED_JOBS).data = await getLatestJobsByCategory(teamName);
|
|
29
|
+
_$w(supportTeamsPageIds.RECENTLEY_ADDED_JOBS).data = latestsJobs;
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
module.exports = {
|