sr-npm 1.7.626 → 1.7.628
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
|
@@ -2,6 +2,7 @@ const { COLLECTIONS,CUSTOM_VALUES_COLLECTION_FIELDS,JOBS_COLLECTION_FIELDS } = r
|
|
|
2
2
|
const { items: wixData } = require('@wix/data');
|
|
3
3
|
const {CAREERS_MULTI_BOXES_PAGE_CONSTS} = require('../backend/careersMultiBoxesPageIds');
|
|
4
4
|
|
|
5
|
+
let valuesByFieldIdGlobal = null;
|
|
5
6
|
const selectedByField = new Map(); // fieldId -> array of selected value IDs
|
|
6
7
|
const optionsByFieldId = new Map(); // fieldId -> [{label, value}] array of objects with label which is the valueLabel and value which is the valueId
|
|
7
8
|
const countsByFieldId = new Map(); // fieldId -> {valueId: count} map of counts for each valueId
|
|
@@ -71,6 +72,7 @@ async function loadJobs(_$w) {
|
|
|
71
72
|
|
|
72
73
|
function updateTotalJobsCountText(_$w) {
|
|
73
74
|
_$w('#totalJobsCountText').text = `${currentJobs.length} Jobs`;
|
|
75
|
+
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
async function loadFilters(_$w) {
|
|
@@ -251,12 +253,12 @@ async function refreshFacetCounts(_$w) {
|
|
|
251
253
|
const selectedItems = [];
|
|
252
254
|
for (const [fieldId, valueIds] of selectedByField.entries()) {
|
|
253
255
|
const opts = optionsByFieldId.get(fieldId) || [];
|
|
254
|
-
|
|
256
|
+
const byId = new Map(opts.map(o => [o.value, o.label]));
|
|
255
257
|
for (const id of valueIds) {
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
+
const label = byId.get(id);
|
|
259
|
+
if (label) {
|
|
258
260
|
selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
|
|
259
|
-
|
|
261
|
+
}
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
264
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;
|