sr-npm 1.7.712 → 1.7.714

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.712",
3
+ "version": "1.7.714",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,26 +35,13 @@ async function handleUrlParams(_$w,urlParams) {
35
35
  let applyFiltering=false;
36
36
  if(urlParams.brand) {
37
37
  const brandValue = decodeURIComponent(urlParams.brand);
38
- console.log("brandValue: ", brandValue);
39
- console.log("selectedByField: ", selectedByField);
40
- console.log("optionsByFieldId: ", optionsByFieldId);
41
- console.log("allfields: ", allfields);
42
38
  const field=getFieldByTitle(fieldTitlesInCMS.brand,allfields);
43
- console.log("field: ", field);
44
39
  const options=optionsByFieldId.get(field._id);
45
- console.log("all the options: are ", options);
46
40
  const option=getCorrectOption(brandValue,options);
47
- console.log("the correctoption: ", option);
48
41
  if(option) {
49
- console.log("setting the value of the checkbox to: ", option.value);
50
- console.log("brandCheckBox options befroe: ", _$w(`#${FiltersIds[field.title]}CheckBox`).options);
51
- // _$w(`#${FiltersIds[field.title]}CheckBox`).value = [option.value];
52
42
  const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
53
- console.log("optionIndex: ", optionIndex);
54
-
55
43
  _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
56
44
  selectedByField.set(field._id, [option.value]);
57
- console.log("brandCheckBox options: after ", _$w(`#${FiltersIds[field.title]}CheckBox`).options);
58
45
  applyFiltering=true;
59
46
  dontUpdateThisCheckBox=field._id;
60
47
  }
@@ -64,27 +51,30 @@ async function handleUrlParams(_$w,urlParams) {
64
51
  }
65
52
  if(urlParams.category) {
66
53
  const categoryValue = decodeURIComponent(urlParams.category);
67
- console.log("categoryValue: ", categoryValue);
68
- console.log("selectedByField: ", selectedByField);
69
- console.log("optionsByFieldId: ", optionsByFieldId);
70
- console.log("allfields: ", allfields);
71
54
  const field=getFieldByTitle(fieldTitlesInCMS.category,allfields);
72
- console.log("field: ", field);
73
55
  const options=optionsByFieldId.get(field._id);
74
- console.log("all the options: are ", options);
75
56
  const option=getCorrectOption(categoryValue,options);
76
- console.log("the correctoption: ", option);
77
57
  if(option) {
78
- console.log("setting the value of the checkbox to: ", option.value);
79
- //_$w(`#${FiltersIds[field.title]}CheckBox`).value = [option.value];
58
+ const optionIndex=getOptionIndexFromCheckBox(_$w(`#${FiltersIds[field.title]}CheckBox`).options,option.value);
59
+ _$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = [optionIndex];
80
60
  selectedByField.set(field._id, [option.value]);
81
61
  applyFiltering=true
82
-
62
+ if(dontUpdateThisCheckBox)
63
+ {
64
+ //to update the checkboxes after applying the filters
65
+ dontUpdateThisCheckBox=null;
66
+ }
67
+ else{
68
+ dontUpdateThisCheckBox=field._id;
69
+ }
83
70
  }
84
71
  else {
85
72
  console.warn("category value not found in dropdown options");
86
73
  }
87
74
  }
75
+ if(urlParams.keyword) {
76
+ console.log("keyword urlparam handling coming soon...")
77
+ }
88
78
  if(applyFiltering) {
89
79
  await updateJobsAndNumbersAndFilters(_$w);
90
80
  }
@@ -111,7 +101,6 @@ async function loadPaginationButtons(_$w) {
111
101
  async function loadSelectedValuesRepeater(_$w) {
112
102
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
113
103
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
114
-
115
104
  // Deselect this value from both the selected map and the multibox
116
105
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
117
106
 
@@ -119,7 +108,7 @@ async function loadSelectedValuesRepeater(_$w) {
119
108
  const valueId = itemData.valueId;
120
109
  dontUpdateThisCheckBox=fieldId;
121
110
  if (!fieldId || !valueId) return;
122
-
111
+
123
112
  const existing = selectedByField.get(fieldId) || [];
124
113
  const updated = existing.filter(v => v !== valueId);
125
114
  if (updated.length) {
@@ -129,13 +118,9 @@ async function loadSelectedValuesRepeater(_$w) {
129
118
  }
130
119
 
131
120
  const field=getFieldById(fieldId,allfields);
132
-
133
-
134
121
  const currentVals = _$w(`#${FiltersIds[field.title]}CheckBox`).value || [];
135
122
  const nextVals = currentVals.filter(v => v !== valueId);
136
123
  _$w(`#${FiltersIds[field.title]}CheckBox`).value = nextVals;
137
-
138
-
139
124
  await updateJobsAndNumbersAndFilters(_$w);
140
125
  });
141
126
  });