sr-npm 1.7.566 → 1.7.567
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 +1 -1
- package/backend/data.js +5 -3
- package/package.json +1 -1
- package/pages/careersPage.js +1 -1
package/backend/data.js
CHANGED
|
@@ -10,6 +10,7 @@ const { retrieveSecretVal, getTokenFromCMS } = require('./secretsData');
|
|
|
10
10
|
let jobToCustomValues = {}
|
|
11
11
|
let customValuesToJobs = {}
|
|
12
12
|
let siteconfig;
|
|
13
|
+
const EXCLUDED_CUSTOM_FIELDS = new Set(["Country", "Department", "Brands"]);
|
|
13
14
|
|
|
14
15
|
function getBrand(customField) {
|
|
15
16
|
return customField.find(field => field.fieldLabel === 'Brands')?.valueLabel;
|
|
@@ -18,6 +19,7 @@ function getBrand(customField) {
|
|
|
18
19
|
async function getSiteConfig() {
|
|
19
20
|
const queryresult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
|
|
20
21
|
siteconfig = queryresult.items[0];
|
|
22
|
+
console.log("siteconfig: ", siteconfig);
|
|
21
23
|
}
|
|
22
24
|
function validatePosition(position) {
|
|
23
25
|
if (!position.id) {
|
|
@@ -64,10 +66,9 @@ function validateSingleDesiredBrand(desiredBrand) {
|
|
|
64
66
|
function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues) {
|
|
65
67
|
const customFieldsArray = Array.isArray(position?.customField) ? position.customField : [];
|
|
66
68
|
for (const field of customFieldsArray) {
|
|
67
|
-
if(
|
|
68
|
-
const label = field.fieldLabel
|
|
69
|
+
if(EXCLUDED_CUSTOM_FIELDS.has(field.fieldLabel)) continue; //country and department are not custom fields, they are already in the job object
|
|
69
70
|
const fieldId=normalizeString(field.fieldId)
|
|
70
|
-
const fieldLabel =
|
|
71
|
+
const fieldLabel = field.fieldLabel;
|
|
71
72
|
const valueId=normalizeString(field.valueId)
|
|
72
73
|
const valueLabel = field.valueLabel
|
|
73
74
|
customFieldsLabels[fieldId] = fieldLabel
|
|
@@ -121,6 +122,7 @@ async function saveJobsDataToCMS() {
|
|
|
121
122
|
if(siteconfig===undefined) {
|
|
122
123
|
siteconfig = await getSiteConfig();
|
|
123
124
|
}
|
|
125
|
+
console.log("siteconfig is @#!#!@!@$##!@: ", siteconfig);
|
|
124
126
|
if (siteconfig.customFields==="true") {
|
|
125
127
|
await populateCustomFieldsCollection(customFieldsLabels);
|
|
126
128
|
await populateCustomValuesCollection(customFieldsValues);
|
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -102,7 +102,7 @@ async function handleUrlParams(_$w) {
|
|
|
102
102
|
await handleKeyWordParam(_$w,queryKeyWordVar);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
if (siteconfig.
|
|
105
|
+
if (siteconfig.onlyBrandKeywordUrlParams==="true") { // it is something else that is not TWG
|
|
106
106
|
if (queryPageVar) {
|
|
107
107
|
await handlePageParam(_$w);
|
|
108
108
|
}
|