sr-npm 1.7.712 → 1.7.713
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
|
@@ -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,23 @@ 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
|
-
|
|
79
|
-
|
|
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
|
+
dontUpdateThisCheckBox=field._id;
|
|
83
63
|
}
|
|
84
64
|
else {
|
|
85
65
|
console.warn("category value not found in dropdown options");
|
|
86
66
|
}
|
|
87
67
|
}
|
|
68
|
+
if(urlParams.keyword) {
|
|
69
|
+
console.log("keyword urlparam handling coming soon...")
|
|
70
|
+
}
|
|
88
71
|
if(applyFiltering) {
|
|
89
72
|
await updateJobsAndNumbersAndFilters(_$w);
|
|
90
73
|
}
|
|
@@ -111,7 +94,6 @@ async function loadPaginationButtons(_$w) {
|
|
|
111
94
|
async function loadSelectedValuesRepeater(_$w) {
|
|
112
95
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
|
|
113
96
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
|
|
114
|
-
|
|
115
97
|
// Deselect this value from both the selected map and the multibox
|
|
116
98
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.DESELECT_BUTTON_ID).onClick(async () => {
|
|
117
99
|
|
|
@@ -119,7 +101,7 @@ async function loadSelectedValuesRepeater(_$w) {
|
|
|
119
101
|
const valueId = itemData.valueId;
|
|
120
102
|
dontUpdateThisCheckBox=fieldId;
|
|
121
103
|
if (!fieldId || !valueId) return;
|
|
122
|
-
|
|
104
|
+
|
|
123
105
|
const existing = selectedByField.get(fieldId) || [];
|
|
124
106
|
const updated = existing.filter(v => v !== valueId);
|
|
125
107
|
if (updated.length) {
|
|
@@ -129,13 +111,9 @@ async function loadSelectedValuesRepeater(_$w) {
|
|
|
129
111
|
}
|
|
130
112
|
|
|
131
113
|
const field=getFieldById(fieldId,allfields);
|
|
132
|
-
|
|
133
|
-
|
|
134
114
|
const currentVals = _$w(`#${FiltersIds[field.title]}CheckBox`).value || [];
|
|
135
115
|
const nextVals = currentVals.filter(v => v !== valueId);
|
|
136
116
|
_$w(`#${FiltersIds[field.title]}CheckBox`).value = nextVals;
|
|
137
|
-
|
|
138
|
-
|
|
139
117
|
await updateJobsAndNumbersAndFilters(_$w);
|
|
140
118
|
});
|
|
141
119
|
});
|