sr-npm 1.7.706 → 1.7.707

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.
@@ -18,6 +18,11 @@ const CAREERS_MULTI_BOXES_PAGE_CONSTS={
18
18
  paginationTotalCountText: '#paginationTotalCount',
19
19
  }
20
20
 
21
+ const fieldTitlesInCMS={
22
+ "brand": "Brands",
23
+ category: "Category",
24
+ }
25
+
21
26
  const FiltersIds={
22
27
  Category: 'Category',
23
28
  "Company Segment": 'CompanySegment',
@@ -32,4 +37,5 @@ const FiltersIds={
32
37
  module.exports = {
33
38
  CAREERS_MULTI_BOXES_PAGE_CONSTS,
34
39
  FiltersIds,
40
+ fieldTitlesInCMS
35
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.706",
3
+ "version": "1.7.707",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  const { COLLECTIONS,CUSTOM_VALUES_COLLECTION_FIELDS,JOBS_COLLECTION_FIELDS } = require('../backend/collectionConsts');
2
- const {CAREERS_MULTI_BOXES_PAGE_CONSTS,FiltersIds} = require('../backend/careersMultiBoxesPageIds');
2
+ const {CAREERS_MULTI_BOXES_PAGE_CONSTS,FiltersIds,fieldTitlesInCMS} = require('../backend/careersMultiBoxesPageIds');
3
3
  const { query,queryParams,onChange} = require("wix-location-frontend");
4
4
  const { groupValuesByField, debounce, getAllRecords, getFieldById, getFieldByTitle } = require('./pagesUtils');
5
5
 
@@ -38,9 +38,23 @@ async function handleUrlParams(_$w,urlParams) {
38
38
  console.log("selectedByField: ", selectedByField);
39
39
  console.log("optionsByFieldId: ", optionsByFieldId);
40
40
  console.log("allfields: ", allfields);
41
- const field=getFieldByTitle("brand",allfields);
41
+ const field=getFieldByTitle(fieldTitlesInCMS.brand,allfields);
42
42
  console.log("field: ", field);
43
- //await updateJobsAndNumbersAndFilters(_$w);
43
+ const options=optionsByFieldId.get(field._id);
44
+ console.log("all the options: are ", options);
45
+ const option=options.find(option=>option.label===brandValue);
46
+ console.log("the correctoption: ", option);
47
+ if(option) {
48
+ console.log("setting the value of the checkbox to: ", option.value);
49
+
50
+ _$w(`#${FiltersIds[field.title]}CheckBox`).value = [option.value];
51
+ selectedByField.set(field._id, [option.value]);
52
+ await updateJobsAndNumbersAndFilters(_$w);
53
+ }
54
+ else {
55
+ console.warn("brand value not found in dropdown options");
56
+ }
57
+
44
58
 
45
59
  }
46
60
  }