sr-npm 1.7.914 → 1.7.916

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 CHANGED
@@ -111,7 +111,9 @@ async function saveJobsDataToCMS() {
111
111
  const customFieldsValues = {}
112
112
 
113
113
  const {companyId,templateType} = await getApiKeys();
114
-
114
+ if(siteconfig===undefined) {
115
+ await getSiteConfig();
116
+ }
115
117
  // bulk insert to jobs collection without descriptions first
116
118
  const jobsData = sourcePositions.map(position => {
117
119
 
@@ -135,7 +137,7 @@ async function saveJobsDataToCMS() {
135
137
  country: position.location?.country || '',
136
138
  remote: position.location?.remote || false,
137
139
  language: position.language?.label || '',
138
- brand: getBrand(position.customField),
140
+ brand: siteconfig.disableMultiBrand==="false" ? getBrand(position.customField) : '',
139
141
  jobDescription: null, // Will be filled later
140
142
  employmentType: position.typeOfEmployment.label,
141
143
  releasedDate: position.releasedDate
@@ -149,9 +151,7 @@ async function saveJobsDataToCMS() {
149
151
  }
150
152
  return basicJob;
151
153
  });
152
- if(siteconfig===undefined) {
153
- await getSiteConfig();
154
- }
154
+
155
155
  if (siteconfig.customFields==="true") {
156
156
  await populateCustomFieldsCollection(customFieldsLabels,templateType);
157
157
  await populateCustomValuesCollection(customFieldsValues);
@@ -468,9 +468,15 @@ async function aggregateJobs() {
468
468
 
469
469
  async function referenceJobs() {
470
470
  console.log("Reference jobs");
471
+ if(siteconfig===undefined) {
472
+ await getSiteConfig();
473
+ }
471
474
  await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.DEPARTMENT_REF, sourceCollection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT, jobField: JOBS_COLLECTION_FIELDS.DEPARTMENT });
472
475
  await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.CITY, sourceCollection: COLLECTIONS.CITIES, jobField: JOBS_COLLECTION_FIELDS.CITY_TEXT });
473
- await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.BRAND_REF, sourceCollection: COLLECTIONS.BRANDS, jobField: JOBS_COLLECTION_FIELDS.BRAND });
476
+ if(siteconfig.disableMultiBrand==="false"){
477
+ await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.BRAND_REF, sourceCollection: COLLECTIONS.BRANDS, jobField: JOBS_COLLECTION_FIELDS.BRAND });
478
+ }
479
+
474
480
  console.log("finished referencing jobs");
475
481
  }
476
482
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.914",
3
+ "version": "1.7.916",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -507,9 +507,6 @@ async function updateMapMarkers(_$w){
507
507
  }
508
508
 
509
509
  async function handleBrandDropdown(_$w){
510
- console.log("siteconfig: ", siteconfig);
511
- console.log("siteconfig.disableMultiBrand: ", siteconfig.disableMultiBrand);
512
- console.log("siteconfig.disableMultiBrand==='false': ", siteconfig.disableMultiBrand==="false");
513
510
  if(siteconfig.disableMultiBrand==="false"){
514
511
  const brands=await wixData.query(COLLECTIONS.BRANDS).find();
515
512
  if(brands.items.length>1){
@@ -517,6 +514,9 @@ async function handleBrandDropdown(_$w){
517
514
  _$w('#dropdownBrand').show();
518
515
  }
519
516
  }
517
+ else{
518
+ _$w('#dropdownBrand').hide();
519
+ }
520
520
  }
521
521
  module.exports = {
522
522
  careersPageOnReady,