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.
@@ -89,7 +89,7 @@ const COLLECTIONS_FIELDS = {
89
89
  {key:'templateType', type: 'TEXT'},
90
90
  ],
91
91
  SITE_CONFIGS: [
92
- {key:'urlParams', type: 'TEXT'},
92
+ {key:'onlyBrandKeywordUrlParams', type: 'TEXT'},
93
93
  {key:'customFields', type: 'TEXT'},
94
94
  ],
95
95
  SECRET_MANAGER_MIRROR: [
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(field.fieldLabel==="Country" || field.fieldLabel==="Department" || field.fieldLabel==="Brands") continue; //country and department are not custom fields, they are already in the job object
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 = label;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.566",
3
+ "version": "1.7.567",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -102,7 +102,7 @@ async function handleUrlParams(_$w) {
102
102
  await handleKeyWordParam(_$w,queryKeyWordVar);
103
103
  }
104
104
 
105
- if (siteconfig.handleCareersUrlParams==="true") { // it is something else that is not TWG
105
+ if (siteconfig.onlyBrandKeywordUrlParams==="true") { // it is something else that is not TWG
106
106
  if (queryPageVar) {
107
107
  await handlePageParam(_$w);
108
108
  }