sr-npm 1.7.844 → 1.7.845
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/collectionConsts.js +2 -0
- package/backend/data.js +17 -2
- package/package.json +1 -1
- package/pages/careersMultiBoxesPage.js +1 -0
- package/pages/index.js +0 -1
- package/pages/masterPage.js +0 -25
|
@@ -31,6 +31,7 @@ const JOBS_COLLECTION_FIELDS = {
|
|
|
31
31
|
MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
|
|
32
32
|
EMPLOYMENT_TYPE: 'employmentType',
|
|
33
33
|
RELEASED_DATE: 'releasedDate',
|
|
34
|
+
VISIBILITY: 'visibility',
|
|
34
35
|
}
|
|
35
36
|
const AMOUNT_OF_JOBS_PER_DEPARTMENT_COLLECTION_FIELDS = {
|
|
36
37
|
TITLE: 'title',
|
|
@@ -93,6 +94,7 @@ const COLLECTIONS_FIELDS = {
|
|
|
93
94
|
{key: 'image', type: 'IMAGE' },
|
|
94
95
|
{key:'employmentType', type: 'TEXT'},
|
|
95
96
|
{key:'releasedDate', type: 'TEXT'},
|
|
97
|
+
{key:'visibility', type: 'TEXT'},
|
|
96
98
|
],
|
|
97
99
|
TEMPLATE_TYPE: [
|
|
98
100
|
{key:'templateType', type: 'TEXT'},
|
package/backend/data.js
CHANGED
|
@@ -4,7 +4,7 @@ const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend
|
|
|
4
4
|
const { COLLECTIONS, COLLECTIONS_FIELDS,JOBS_COLLECTION_FIELDS,TEMPLATE_TYPE,TOKEN_NAME,CUSTOM_VALUES_COLLECTION_FIELDS } = require('./collectionConsts');
|
|
5
5
|
const { chunkedBulkOperation, countJobsPerGivenField, fillCityLocationAndLocationAddress ,prepareToSaveArray,normalizeString} = require('./utils');
|
|
6
6
|
const { getAllPositions } = require('./queries');
|
|
7
|
-
const { retrieveSecretVal, getTokenFromCMS } = require('./secretsData');
|
|
7
|
+
const { retrieveSecretVal, getTokenFromCMS ,getApiKeys} = require('./secretsData');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -68,6 +68,14 @@ function getLocation(position,basicJob) {
|
|
|
68
68
|
locationToJobs[basicJob.cityText] ? locationToJobs[basicJob.cityText].push(position.id) : locationToJobs[basicJob.cityText]=[position.id]
|
|
69
69
|
|
|
70
70
|
}
|
|
71
|
+
function getVisibility(position,customFieldsValues) {
|
|
72
|
+
if (!customFieldsValues[JOBS_COLLECTION_FIELDS.VISIBILITY]) {
|
|
73
|
+
customFieldsValues[JOBS_COLLECTION_FIELDS.VISIBILITY] = {};
|
|
74
|
+
}
|
|
75
|
+
customFieldsValues[JOBS_COLLECTION_FIELDS.VISIBILITY][position.visibility.toLowerCase()] = position.visibility.toLowerCase();
|
|
76
|
+
customValuesToJobs[position.visibility.toLowerCase()] ? customValuesToJobs[position.visibility.toLowerCase()].push(position.id) : customValuesToJobs[position.visibility.toLowerCase()]=[position.id]
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
function getEmploymentType(position,customFieldsValues) {
|
|
72
80
|
if (!customFieldsValues["employmentType"]) {
|
|
73
81
|
customFieldsValues["employmentType"] = {};
|
|
@@ -99,6 +107,9 @@ async function saveJobsDataToCMS() {
|
|
|
99
107
|
const sourcePositions = await filterBasedOnBrand(positions);
|
|
100
108
|
const customFieldsLabels = {}
|
|
101
109
|
const customFieldsValues = {}
|
|
110
|
+
|
|
111
|
+
const {companyId,templateType} = await getApiKeys();
|
|
112
|
+
console.log("templateType: ", templateType);
|
|
102
113
|
|
|
103
114
|
// bulk insert to jobs collection without descriptions first
|
|
104
115
|
const jobsData = sourcePositions.map(position => {
|
|
@@ -126,12 +137,16 @@ async function saveJobsDataToCMS() {
|
|
|
126
137
|
brand: getBrand(position.customField),
|
|
127
138
|
jobDescription: null, // Will be filled later
|
|
128
139
|
employmentType: position.typeOfEmployment.label,
|
|
129
|
-
releasedDate: position.releasedDate
|
|
140
|
+
releasedDate: position.releasedDate
|
|
130
141
|
};
|
|
131
142
|
|
|
132
143
|
getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
|
|
133
144
|
getEmploymentType(position,customFieldsValues);
|
|
134
145
|
getLocation(position,basicJob);
|
|
146
|
+
if(templateType===TEMPLATE_TYPE.INTERNAL){
|
|
147
|
+
getVisibility(position,customFieldsValues);
|
|
148
|
+
}
|
|
149
|
+
|
|
135
150
|
return basicJob;
|
|
136
151
|
});
|
|
137
152
|
if(siteconfig===undefined) {
|
package/package.json
CHANGED
package/pages/index.js
CHANGED
package/pages/masterPage.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const{isElementExistOnPage} = require('psdev-utils');
|
|
2
|
-
const { location } = require("@wix/site-location");
|
|
3
|
-
async function masterPageOnReady(_$w) {
|
|
4
|
-
if(isElementExistOnPage(_$w('#myApplicationButton'))){
|
|
5
|
-
_$w('#myApplicationButton').onClick(()=>{
|
|
6
|
-
location.to('https://www.smartrecruiters.com/app/employee-portal/68246e5512d84f4c00a19e62/job-applications');
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
else{
|
|
10
|
-
console.log("myApplicationButton not found");
|
|
11
|
-
}
|
|
12
|
-
if(isElementExistOnPage(_$w('#myReferralsButton'))){
|
|
13
|
-
_$w('#myReferralsButton').onClick(()=>{
|
|
14
|
-
location.to('https://www.smartrecruiters.com/app/referrals/');
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
else{
|
|
19
|
-
console.log("myReferralsButton not found");
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
masterPageOnReady,
|
|
25
|
-
};
|