sr-npm 1.7.875 → 1.7.877
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.
|
@@ -41,7 +41,7 @@ const CUSTOM_VALUES_COLLECTION_FIELDS = {
|
|
|
41
41
|
TITLE: 'title',
|
|
42
42
|
CUSTOM_FIELD: 'customField',
|
|
43
43
|
MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
|
|
44
|
-
|
|
44
|
+
count: 'count',
|
|
45
45
|
JOB_IDS: 'jobIds',
|
|
46
46
|
}
|
|
47
47
|
const CUSTOM_FIELDS_COLLECTION_FIELDS = {
|
|
@@ -112,7 +112,7 @@ const COLLECTIONS_FIELDS = {
|
|
|
112
112
|
CUSTOM_VALUES: [
|
|
113
113
|
{key:'title', type: 'TEXT'},
|
|
114
114
|
{key:'customField', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.CUSTOM_FIELDS } } },
|
|
115
|
-
{key:'
|
|
115
|
+
{key:'count', type: 'NUMBER'},
|
|
116
116
|
{key:'multiRefJobsCustomValues', type: 'MULTI_REFERENCE', typeMetadata: { multiReference: { referencedCollectionId: COLLECTIONS.JOBS,referencingFieldKey:CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,referencingDisplayName:CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES } } },
|
|
117
117
|
{key:'jobIds', type: 'ARRAY'},
|
|
118
118
|
],
|
package/backend/data.js
CHANGED
|
@@ -202,7 +202,7 @@ async function populateCustomValuesCollection(customFieldsValues) {
|
|
|
202
202
|
_id: valueId,
|
|
203
203
|
title: valuesMap[valueId],
|
|
204
204
|
customField: fieldId,
|
|
205
|
-
|
|
205
|
+
count:customValuesToJobs[valueId].length,
|
|
206
206
|
jobIds:customValuesToJobs[valueId],
|
|
207
207
|
})
|
|
208
208
|
}
|
package/package.json
CHANGED
|
@@ -260,7 +260,7 @@ async function loadJobsRepeater(_$w) {
|
|
|
260
260
|
|
|
261
261
|
optionsByFieldId.set(key, originalOptions);
|
|
262
262
|
for (const val of allvaluesobjects) {
|
|
263
|
-
counter[val.title]=val.
|
|
263
|
+
counter[val.title]=val.count
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
countsByFieldId.set(key, new Map(originalOptions.map(o => [o.value, counter[o.label]])));
|
package/pages/homePage.js
CHANGED
|
@@ -67,6 +67,9 @@ function bindTeamRepeater(_$w) {
|
|
|
67
67
|
console.log("itemData: ", itemData);
|
|
68
68
|
$item('#teamButton').onClick(()=>{
|
|
69
69
|
const department = encodeURIComponent(itemData.title);
|
|
70
|
+
itemData.customField?
|
|
71
|
+
location.to(`/search?category=${department}`)
|
|
72
|
+
:
|
|
70
73
|
location.to(`/positions?department=${department}`);
|
|
71
74
|
});
|
|
72
75
|
});
|
package/pages/pagesUtils.js
CHANGED
|
@@ -141,7 +141,7 @@ async function loadCategoriesListPrimarySearch(_$w,allvaluesobjects) {
|
|
|
141
141
|
let categoryValues=[]
|
|
142
142
|
for(const value of allvaluesobjects) {
|
|
143
143
|
if(value.customField===CATEGORY_CUSTOM_FIELD_ID_IN_CMS) {
|
|
144
|
-
categoryValues.push({title:value.title+` (${value.
|
|
144
|
+
categoryValues.push({title:value.title+` (${value.count})` ,_id:value._id});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).data = categoryValues;
|
|
@@ -158,15 +158,16 @@ describe('primarySearch function tests', () => {
|
|
|
158
158
|
|
|
159
159
|
await primarySearch(mockW, 'unicorn hunter',mockJobs);
|
|
160
160
|
|
|
161
|
+
|
|
161
162
|
expect(mockprimarySearchMultiBox.changeState).toHaveBeenCalledWith('noResults');
|
|
162
163
|
expect(mockprimarySearcJobResult.data).toBeNull();
|
|
163
164
|
});
|
|
164
165
|
|
|
165
166
|
it('should fill category repeater when clicking on empty primary search input', async () => {
|
|
166
167
|
const mockCategoryValues = [
|
|
167
|
-
{ _id: 'cat1', title: 'Engineering', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS,
|
|
168
|
-
{ _id: 'cat2', title: 'Marketing', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS,
|
|
169
|
-
{ _id: 'cat3', title: 'Sales', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS,
|
|
168
|
+
{ _id: 'cat1', title: 'Engineering', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS, count: 5 },
|
|
169
|
+
{ _id: 'cat2', title: 'Marketing', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS, count: 3 },
|
|
170
|
+
{ _id: 'cat3', title: 'Sales', customField: CATEGORY_CUSTOM_FIELD_ID_IN_CMS, count: 7 }
|
|
170
171
|
];
|
|
171
172
|
|
|
172
173
|
careersMultiBoxesPage.__set__('allvaluesobjects', mockCategoryValues);
|