sr-npm 1.7.677 → 1.7.679
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 +1 -1
- package/pages/careersMultiBoxesPage.js +22 -21
package/package.json
CHANGED
|
@@ -110,7 +110,6 @@ async function loadJobs(_$w) {
|
|
|
110
110
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_LOCATION).text=itemData.location.fullLocation
|
|
111
111
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER_ITEM_EMPLOYMENT_TYPE).text=itemData.employmentType
|
|
112
112
|
});
|
|
113
|
-
console.log("alljobs: ",alljobs)
|
|
114
113
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = alljobs;
|
|
115
114
|
updateTotalJobsCountText(_$w);
|
|
116
115
|
}
|
|
@@ -126,7 +125,6 @@ async function loadJobs(_$w) {
|
|
|
126
125
|
let fields = await getAllRecords(COLLECTIONS.CUSTOM_FIELDS);
|
|
127
126
|
|
|
128
127
|
fields.push({_id:"Location",title:"Location"});
|
|
129
|
-
// _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).data = fields;
|
|
130
128
|
const cities=await getAllRecords(COLLECTIONS.CITIES);
|
|
131
129
|
for(const city of cities) {
|
|
132
130
|
valueToJobs[city._id]=city.jobIds;
|
|
@@ -142,33 +140,35 @@ async function loadJobs(_$w) {
|
|
|
142
140
|
for(const city of cities) {
|
|
143
141
|
counter[city.city]=city.count
|
|
144
142
|
}
|
|
143
|
+
|
|
145
144
|
for(const [key, value] of valuesByFieldId) {
|
|
146
145
|
for(const field of fields) {
|
|
147
146
|
if(field._id===key) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
optionsByFieldId.set(key, originalOptions);
|
|
160
|
-
|
|
147
|
+
let originalOptions=[];
|
|
148
|
+
if(key==="Location") {
|
|
149
|
+
originalOptions=value.map(city=>({
|
|
150
|
+
label: city.city,
|
|
151
|
+
value: city._id
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
else{
|
|
155
|
+
originalOptions=value
|
|
156
|
+
}
|
|
161
157
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
optionsByFieldId.set(key, originalOptions);
|
|
159
|
+
for (const val of allvaluesobjects) {
|
|
160
|
+
counter[val.title]=val.totalJobs
|
|
161
|
+
}
|
|
165
162
|
|
|
166
|
-
|
|
163
|
+
countsByFieldId.set(key, new Map(originalOptions.map(o => [o.value, counter[o.label]])));
|
|
167
164
|
updateOptionsUI(_$w,field.title, field._id, ''); // no search query
|
|
165
|
+
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
|
|
168
166
|
//_$w("#CategoryCheckBox").options = valuesByFieldId.get(elemenet);
|
|
169
167
|
_$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
|
|
170
168
|
dontUpdateThisCheckBox=field._id;
|
|
169
|
+
console.log("dontUpdateThisCheckBox ",dontUpdateThisCheckBox)
|
|
171
170
|
const selected = ev.target.value; // array of selected value IDs
|
|
171
|
+
console.log("selected: ",selected)
|
|
172
172
|
if (selected && selected.length) {
|
|
173
173
|
selectedByField.set(field._id, selected);
|
|
174
174
|
} else {
|
|
@@ -193,8 +193,8 @@ async function loadJobs(_$w) {
|
|
|
193
193
|
|
|
194
194
|
await refreshFacetCounts(_$w);
|
|
195
195
|
// _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER).forEachItem(($item, itemData) => {
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
// const query = ($item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_LABEL).value || '').toLowerCase().trim();
|
|
197
|
+
// updateOptionsUI($item, itemData._id, query);
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
|
|
@@ -305,6 +305,7 @@ async function loadJobs(_$w) {
|
|
|
305
305
|
};
|
|
306
306
|
|
|
307
307
|
function updateOptionsUI(_$w,fieldTitle, fieldId, searchQuery) {
|
|
308
|
+
console.log("fieldTitle now inisde updateOptionsUI: ",fieldTitle)
|
|
308
309
|
let base = optionsByFieldId.get(fieldId) || [];
|
|
309
310
|
console.log("base: ",base)
|
|
310
311
|
const countsMap = countsByFieldId.get(fieldId) || new Map();
|