sr-npm 1.7.530 → 1.7.532

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
@@ -56,6 +56,7 @@ function addCustomFields(basicJob, position) {
56
56
  const customFieldsArray = Array.isArray(position?.customField) ? position.customField : [];
57
57
  const customFields = {};
58
58
  for (const field of customFieldsArray) {
59
+ if(field.fieldLabel==="Country" || field.fieldLabel==="Department") continue; //country and department are not custom fields, they are already in the job object
59
60
  const label = field.fieldLabel==="Brands" ? "brand" : field.fieldLabel
60
61
  const key = normalizeString(label);
61
62
  const value = field.valueLabel
@@ -352,6 +353,7 @@ async function aggregateJobs() {
352
353
  aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.CITY_TEXT, collection: COLLECTIONS.CITIES }),
353
354
  aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.BRAND, collection: COLLECTIONS.BRANDS })
354
355
  ]);
356
+
355
357
  console.log("finished aggregating jobs");
356
358
  }
357
359
 
@@ -374,7 +376,7 @@ async function syncJobsFast() {
374
376
  // console.log("saving jobs descriptions and location apply url to CMS");
375
377
  // await saveJobsDescriptionsAndLocationApplyUrlToCMS();
376
378
  // console.log("saved jobs descriptions and location apply url to CMS successfully");
377
- // await aggregateJobs();
379
+ // await aggregateJobs();
378
380
  // await referenceJobs();
379
381
  // console.log("syncing jobs fast finished successfully");
380
382
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.530",
3
+ "version": "1.7.532",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ const {
28
28
  async function careersPageOnReady(_$w,thisObject,queryParams,customFieldsDropdownObject=null) {
29
29
  console.log("queryParams: ", queryParams);
30
30
  console.log("customFieldsDropdownObject: ", customFieldsDropdownObject)
31
- await retrieveQueryParams(queryParams);
31
+ await retrieveQueryParams(queryParams,customFieldsDropdownObject);
32
32
  thisObjectVar=thisObject;
33
33
  allJobs=await getAllPositions();
34
34
  await activateAutoLoad(_$w);
@@ -376,6 +376,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
376
376
  });
377
377
 
378
378
  //applyCustomFieldFilters(filters);
379
+ console.log("dropdownFiltersMapping after applying filters: ", dropdownFiltersMapping);
379
380
 
380
381
  const filter = await getFilter(filters, 'and');
381
382
  await _$w('#jobsDataset').setFilter(filter);
@@ -426,13 +427,16 @@ async function updateCount(_$w) {
426
427
  return count;
427
428
  }
428
429
 
429
- async function handleGivenURLParam(_$w,param,value) {
430
+ async function handleGivenURLParam(_$w,param,value,isCustomField=false) {
430
431
  const paramValue = decodeURIComponent(value);
431
432
  let dropdownOptions = _$w(DROPDOWN_IDS[param]).options;
432
433
  console.log("dropdown options:", dropdownOptions);
433
- const optionsFromCMS=await wixData.query(DROPDOWN_COLLECTIONS[param]).find();
434
- if(dropdownOptions.length!==optionsFromCMS.items.length+1){
435
- fixDropdownOptions(DROPDOWN_IDS[param],optionsFromCMS, _$w);
434
+ let optionsFromCMS;
435
+ if(!isCustomField){
436
+ optionsFromCMS=await wixData.query(DROPDOWN_COLLECTIONS[param]).find();
437
+ if(dropdownOptions.length!==optionsFromCMS.items.length+1){
438
+ fixDropdownOptions(DROPDOWN_IDS[param],optionsFromCMS, _$w);
439
+ }
436
440
  }
437
441
  const option=_$w(DROPDOWN_IDS[param]).options.find(option => option.value.toLowerCase() === paramValue.toLowerCase())
438
442
  if(option){