sr-npm 1.7.629 → 1.7.631
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
|
@@ -175,24 +175,26 @@ async function loadJobs(_$w) {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
function updateOptionsUI($item, fieldId, searchQuery) {
|
|
178
|
-
|
|
178
|
+
let base = optionsByFieldId.get(fieldId) || [];
|
|
179
179
|
const countsMap = countsByFieldId.get(fieldId) || new Map();
|
|
180
|
-
|
|
180
|
+
console.log("base before filtering: ",base)
|
|
181
181
|
for (const element of countsMap)
|
|
182
182
|
{
|
|
183
|
-
if (element[1]
|
|
183
|
+
if (element[1]===0)
|
|
184
184
|
{
|
|
185
|
-
|
|
185
|
+
base= base.filter(o => o.value !== element[0])
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
+
console.log("base after filtering: ",base)
|
|
188
189
|
// Build display options with counts
|
|
189
190
|
const withCounts = base.map(o => {
|
|
190
|
-
const count =
|
|
191
|
+
const count = countsMap.get(o.value)
|
|
191
192
|
return {
|
|
192
193
|
label: `${o.label} (${count})`,
|
|
193
194
|
value: o.value
|
|
194
195
|
};
|
|
195
196
|
});
|
|
197
|
+
console.log("withCounts: ",withCounts)
|
|
196
198
|
// Apply search
|
|
197
199
|
const filtered = searchQuery
|
|
198
200
|
? withCounts.filter(o => (o.label || '').toLowerCase().includes(searchQuery))
|
|
@@ -202,6 +204,8 @@ async function loadJobs(_$w) {
|
|
|
202
204
|
const prevSelected = $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value || [];
|
|
203
205
|
const visibleSet = new Set(filtered.map(o => o.value));
|
|
204
206
|
const preserved = prevSelected.filter(v => visibleSet.has(v));
|
|
207
|
+
console.log("preserved: ",preserved)
|
|
208
|
+
console.log("filtered: ",filtered)
|
|
205
209
|
|
|
206
210
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).options = filtered;
|
|
207
211
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.FILTER_REPEATER_ITEM_CHECKBOX).value = preserved;
|