sr-npm 1.7.896 → 1.7.898
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/backend/data.js
CHANGED
|
@@ -153,7 +153,7 @@ async function saveJobsDataToCMS() {
|
|
|
153
153
|
await getSiteConfig();
|
|
154
154
|
}
|
|
155
155
|
if (siteconfig.customFields==="true") {
|
|
156
|
-
await populateCustomFieldsCollection(customFieldsLabels);
|
|
156
|
+
await populateCustomFieldsCollection(customFieldsLabels,templateType);
|
|
157
157
|
await populateCustomValuesCollection(customFieldsValues);
|
|
158
158
|
}
|
|
159
159
|
// Sort jobs by title (ascending, case-insensitive, numeric-aware)
|
|
@@ -197,10 +197,12 @@ async function insertJobsReference(valueId) {
|
|
|
197
197
|
await wixData.insertReference(COLLECTIONS.CUSTOM_VALUES, CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,valueId, Array.from(customValuesToJobs[valueId]));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
async function populateCustomFieldsCollection(customFields) {
|
|
200
|
+
async function populateCustomFieldsCollection(customFields,templateType) {
|
|
201
201
|
let fieldstoinsert=[]
|
|
202
202
|
customFields["employmentType"] = "Employment Type";
|
|
203
|
-
|
|
203
|
+
if(templateType===TEMPLATE_TYPE.INTERNAL){
|
|
204
|
+
customFields["Visibility"] = "Visibility";
|
|
205
|
+
}
|
|
204
206
|
for(const ID of Object.keys(customFields)){
|
|
205
207
|
fieldstoinsert.push({
|
|
206
208
|
title: customFields[ID],
|
package/package.json
CHANGED
|
@@ -218,6 +218,7 @@ async function loadJobsRepeater(_$w) {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
function updateTotalJobsCountText(_$w) {
|
|
221
|
+
console.log("currentJobs inisde updateTotalJobsCountText: ",currentJobs)
|
|
221
222
|
secondarySearchIsFilled? _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.TotalJobsCountText).text = `${currentSecondarySearchJobs.length} Jobs`:
|
|
222
223
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.TotalJobsCountText).text = `${currentJobs.length} Jobs`;
|
|
223
224
|
}
|
|
@@ -439,17 +440,23 @@ async function refreshFacetCounts(_$w,clearAll=false) {
|
|
|
439
440
|
function countJobsPerField(jobs) {
|
|
440
441
|
const fieldIds = Array.from(optionsByFieldId.keys());
|
|
441
442
|
const currentJobsIds=jobs.map(job=>job._id);
|
|
443
|
+
|
|
442
444
|
for (const fieldId of fieldIds) {
|
|
445
|
+
console.log("fieldId: ",fieldId)
|
|
446
|
+
console.log("optionsByFieldId: ",optionsByFieldId)
|
|
447
|
+
console.log("valueToJobs: ",valueToJobs)
|
|
443
448
|
let currentoptions=optionsByFieldId.get(fieldId)
|
|
444
449
|
let counter=new Map();
|
|
445
450
|
for(const option of currentoptions) {
|
|
446
451
|
for (const jobId of currentJobsIds) {
|
|
452
|
+
console.log("current jobId: ",jobId)
|
|
447
453
|
if (valueToJobs[option.value].includes(jobId)) {
|
|
448
454
|
counter.set(option.value, (counter.get(option.value) || 0) + 1);
|
|
449
455
|
}
|
|
450
456
|
}
|
|
451
457
|
}
|
|
452
458
|
countsByFieldId.set(fieldId, counter);
|
|
459
|
+
console.log("countsByFieldId: ",countsByFieldId)
|
|
453
460
|
}
|
|
454
461
|
}
|
|
455
462
|
|