sr-npm 1.7.568 → 1.7.570
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/data.js +7 -2
- package/package.json +1 -1
- package/pages/careersPage.js +5 -5
package/backend/data.js
CHANGED
|
@@ -19,7 +19,6 @@ function getBrand(customField) {
|
|
|
19
19
|
async function getSiteConfig() {
|
|
20
20
|
const queryresult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
|
|
21
21
|
siteconfig = queryresult.items[0];
|
|
22
|
-
console.log("siteconfig: ", siteconfig);
|
|
23
22
|
}
|
|
24
23
|
function validatePosition(position) {
|
|
25
24
|
if (!position.id) {
|
|
@@ -81,6 +80,12 @@ function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,custom
|
|
|
81
80
|
jobToCustomValues[position.id] ? jobToCustomValues[position.id].push(valueId) : jobToCustomValues[position.id]=[valueId]
|
|
82
81
|
customValuesToJobs[valueId] ? customValuesToJobs[valueId].push(position.id) : customValuesToJobs[valueId]=[position.id]
|
|
83
82
|
}
|
|
83
|
+
|
|
84
|
+
if (!customFieldsValues["employmentType"]) {
|
|
85
|
+
customFieldsValues["employmentType"] = {};
|
|
86
|
+
}
|
|
87
|
+
customFieldsValues["employmentType"][position.typeOfEmployment.id] = position.typeOfEmployment.label;
|
|
88
|
+
|
|
84
89
|
|
|
85
90
|
}
|
|
86
91
|
async function saveJobsDataToCMS() {
|
|
@@ -122,7 +127,6 @@ async function saveJobsDataToCMS() {
|
|
|
122
127
|
if(siteconfig===undefined) {
|
|
123
128
|
await getSiteConfig();
|
|
124
129
|
}
|
|
125
|
-
console.log("siteconfig is @#!#!@!@$##!@: ", siteconfig);
|
|
126
130
|
if (siteconfig.customFields==="true") {
|
|
127
131
|
await populateCustomFieldsCollection(customFieldsLabels);
|
|
128
132
|
await populateCustomValuesCollection(customFieldsValues);
|
|
@@ -173,6 +177,7 @@ async function insertJobsReference(valueId) {
|
|
|
173
177
|
|
|
174
178
|
async function populateCustomFieldsCollection(customFields) {
|
|
175
179
|
fieldstoinsert=[]
|
|
180
|
+
customFields["employmentType"] = "Employment Type";
|
|
176
181
|
for(const ID of Object.keys(customFields)){
|
|
177
182
|
fieldstoinsert.push({
|
|
178
183
|
title: customFields[ID],
|
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -30,7 +30,6 @@ if(siteconfig===undefined) {
|
|
|
30
30
|
const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
|
|
31
31
|
siteconfig = queryResult.items[0];
|
|
32
32
|
}
|
|
33
|
-
console.log("siteconfig: ", siteconfig);
|
|
34
33
|
console.log("queryParams: ", queryParams);
|
|
35
34
|
const { page, keyWord, department, location,jobType,brand } = queryParams;
|
|
36
35
|
queryPageVar=page;
|
|
@@ -102,8 +101,11 @@ async function handleUrlParams(_$w) {
|
|
|
102
101
|
if (queryKeyWordVar) {
|
|
103
102
|
await handleKeyWordParam(_$w,queryKeyWordVar);
|
|
104
103
|
}
|
|
104
|
+
if (queryBrandVar && _$w('#dropdownBrand').isVisible) { //if it is not visible, ignore it
|
|
105
|
+
await handleBrandParam(_$w,queryBrandVar);
|
|
106
|
+
}
|
|
105
107
|
|
|
106
|
-
if (siteconfig.onlyBrandKeywordUrlParams==="
|
|
108
|
+
if (siteconfig.onlyBrandKeywordUrlParams==="false") { // it is something else that is not TWG
|
|
107
109
|
if (queryPageVar) {
|
|
108
110
|
await handlePageParam(_$w);
|
|
109
111
|
}
|
|
@@ -116,9 +118,7 @@ async function handleUrlParams(_$w) {
|
|
|
116
118
|
if (queryJobTypeVar) {
|
|
117
119
|
await handleJobTypeParam(_$w,queryJobTypeVar);
|
|
118
120
|
}
|
|
119
|
-
|
|
120
|
-
await handleBrandParam(_$w,queryBrandVar);
|
|
121
|
-
}
|
|
121
|
+
|
|
122
122
|
}
|
|
123
123
|
await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
124
124
|
}
|