sr-npm 1.7.647 → 1.7.649
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
|
@@ -10,12 +10,12 @@ const countsByFieldId = new Map(); // fieldId -> {valueId: count} map of counts
|
|
|
10
10
|
let alljobs=[] // all jobs in the database
|
|
11
11
|
let allvaluesobjects=[] // all values in the database
|
|
12
12
|
let valueToJobs={} // valueId -> array of jobIds
|
|
13
|
-
let currentJobsIds=[] // current jobs that are displayed in the jobs repeater
|
|
13
|
+
//let currentJobsIds=[] // current jobs that are displayed in the jobs repeater
|
|
14
14
|
let currentJobs=[] // current jobs that are displayed in the jobs repeater
|
|
15
15
|
async function careersMultiBoxesPageOnReady(_$w) {
|
|
16
16
|
if(alljobs.length===0) {
|
|
17
17
|
alljobs=await getAllRecords(COLLECTIONS.JOBS);
|
|
18
|
-
|
|
18
|
+
// currentJobsIds=alljobs.map(job=>job._id);
|
|
19
19
|
currentJobs=alljobs;
|
|
20
20
|
console.log("alljobs: ",alljobs)
|
|
21
21
|
}
|
|
@@ -78,7 +78,7 @@ async function loadJobs(_$w) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function updateTotalJobsCountText(_$w) {
|
|
81
|
-
_$w('#totalJobsCountText').text = `${
|
|
81
|
+
_$w('#totalJobsCountText').text = `${currentJobs.length} Jobs`;
|
|
82
82
|
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -234,14 +234,15 @@ async function loadJobs(_$w) {
|
|
|
234
234
|
async function applyJobFilters(_$w,filterByField) {
|
|
235
235
|
//let q = wixData.query(COLLECTIONS.JOBS)
|
|
236
236
|
console.log(alljobs)
|
|
237
|
-
let newFilteredJobs=[]
|
|
237
|
+
let newFilteredJobs=[];
|
|
238
|
+
let currentAllJobs=alljobs;
|
|
238
239
|
let addedJobsIds=[]
|
|
239
|
-
|
|
240
|
+
console.log("selectedByField: ",selectedByField)
|
|
240
241
|
|
|
241
242
|
// AND across categories, OR within each category
|
|
242
243
|
for (const [, values] of selectedByField.entries()) {
|
|
243
244
|
// console.log("values: ",values)
|
|
244
|
-
for(job of
|
|
245
|
+
for(job of currentAllJobs) {
|
|
245
246
|
//console.log("job: ",job)
|
|
246
247
|
//console.log("job[filterByField]: ",job[filterByField])
|
|
247
248
|
// console.log("job[filterByField].some(value=>values.includes(value))) ",job[filterByField].some(value=>values.includes(value._id)))
|
|
@@ -253,7 +254,9 @@ async function loadJobs(_$w) {
|
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
|
|
257
|
+
addedJobsIds=[]
|
|
258
|
+
currentAllJobs=newFilteredJobs;
|
|
259
|
+
newFilteredJobs=[];
|
|
257
260
|
// if (values && values.length) {
|
|
258
261
|
|
|
259
262
|
// q = q.hasSome(filterByField, values);
|
|
@@ -263,7 +266,7 @@ async function loadJobs(_$w) {
|
|
|
263
266
|
//console.log("alreadyAddedJobs: ",alreadyAddedJobs)
|
|
264
267
|
console.log("newFilteredJobs: ",newFilteredJobs)
|
|
265
268
|
currentJobs=newFilteredJobs;
|
|
266
|
-
currentJobsIds=addedJobsIds;
|
|
269
|
+
// currentJobsIds=addedJobsIds;
|
|
267
270
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = newFilteredJobs;
|
|
268
271
|
|
|
269
272
|
// await q.find()
|
|
@@ -276,6 +279,7 @@ async function loadJobs(_$w) {
|
|
|
276
279
|
|
|
277
280
|
async function refreshFacetCounts(_$w) {
|
|
278
281
|
const fieldIds = Array.from(optionsByFieldId.keys());
|
|
282
|
+
const currentJobsIds=currentJobs.map(job=>job._id);
|
|
279
283
|
for (const fieldId of fieldIds) {
|
|
280
284
|
let currentoptions=optionsByFieldId.get(fieldId)
|
|
281
285
|
let counter=new Map();
|
|
@@ -326,7 +330,7 @@ async function refreshFacetCounts(_$w) {
|
|
|
326
330
|
res = await res.next();
|
|
327
331
|
newcurrentJobs.push(...res.items.map(job=>job._id));
|
|
328
332
|
}
|
|
329
|
-
|
|
333
|
+
currentJobs = newcurrentJobs;
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
module.exports = {
|