sr-npm 1.7.874 → 1.7.876
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/collectionConsts.js +2 -2
- package/backend/data.js +1 -1
- package/package.json +1 -1
- package/pages/careersMultiBoxesPage.js +1 -1
- package/pages/homePage.js +19 -8
- package/pages/pagesUtils.js +1 -1
- package/pages/positionPage.js +10 -5
- package/public/utils.js +0 -5
|
@@ -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
|
@@ -19,7 +19,8 @@ async function homePageOnReady(_$w,thisObject=null) {
|
|
|
19
19
|
const allvaluesobjects=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
20
20
|
await Promise.all([
|
|
21
21
|
bindPrimarySearch(_$w,allvaluesobjects,allJobs),
|
|
22
|
-
loadPrimarySearchRepeater(_$w)
|
|
22
|
+
loadPrimarySearchRepeater(_$w),
|
|
23
|
+
bindTeamRepeater(_$w)
|
|
23
24
|
]);
|
|
24
25
|
}
|
|
25
26
|
else{
|
|
@@ -32,13 +33,9 @@ async function homePageOnReady(_$w,thisObject=null) {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
function bind(_$w) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const department = encodeURIComponent(itemData.title);
|
|
39
|
-
location.to(`/positions?department=${department}`);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
36
|
+
|
|
37
|
+
bindTeamRepeater(_$w);
|
|
38
|
+
|
|
42
39
|
|
|
43
40
|
_$w('#citiesDataset').onReady(async () => {
|
|
44
41
|
const numOfItems = await _$w('#citiesDataset').getTotalCount();
|
|
@@ -64,6 +61,20 @@ async function homePageOnReady(_$w,thisObject=null) {
|
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
63
|
|
|
64
|
+
function bindTeamRepeater(_$w) {
|
|
65
|
+
_$w('#teamRepeater').onItemReady(($item, itemData) => {
|
|
66
|
+
$item('#teamButton').label = `View ${itemData.count} Open Positions`;
|
|
67
|
+
console.log("itemData: ", itemData);
|
|
68
|
+
$item('#teamButton').onClick(()=>{
|
|
69
|
+
const department = encodeURIComponent(itemData.title);
|
|
70
|
+
itemData.customField?
|
|
71
|
+
location.to(`/search?category=${department}`)
|
|
72
|
+
:
|
|
73
|
+
location.to(`/positions?department=${department}`);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
function init(_$w) {
|
|
68
79
|
const debouncedInput = debounce(()=>handleSearchInput(_$w), 400,thisObjectVar);
|
|
69
80
|
|
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;
|
package/pages/positionPage.js
CHANGED
|
@@ -37,10 +37,9 @@ async function getCategoryValueId(customValues) {
|
|
|
37
37
|
const item = await _$w('#datasetJobsItem').getCurrentItem();
|
|
38
38
|
const multiRefField=await getPositionWithMultiRefField(item._id);
|
|
39
39
|
const categoryValueId=await getCategoryValueId(multiRefField);
|
|
40
|
-
|
|
41
40
|
handleReferFriendButton(_$w,item);
|
|
42
|
-
|
|
43
41
|
handleApplyButton(_$w,item);
|
|
42
|
+
|
|
44
43
|
|
|
45
44
|
_$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
|
|
46
45
|
_$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
|
|
@@ -83,15 +82,21 @@ async function getCategoryValueId(customValues) {
|
|
|
83
82
|
|
|
84
83
|
function handleReferFriendButton(_$w,item) {
|
|
85
84
|
if(!item.referFriendLink && isElementExistOnPage(_$w('#referFriendButton'))){
|
|
86
|
-
console.log("hiding referFriendButton");
|
|
87
85
|
_$w('#referFriendButton').hide();
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
function handleApplyButton(_$w,item) {
|
|
90
|
+
try{
|
|
92
91
|
_$w('#applyButton').target="_blank";//so it can open in new tab
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const url=appendQueryParams(item.applyLink,query);
|
|
93
|
+
_$w('#applyButton').link=url; //so it can be clicked
|
|
94
|
+
}
|
|
95
|
+
catch(error){
|
|
96
|
+
console.warn("error in handleApplyButton: , using applyLink directly", error);
|
|
97
|
+
_$w('#applyButton').target="_blank";
|
|
98
|
+
_$w('#applyButton').link=item.applyLink;
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
async function getRelatedJobs(categoryValueId,itemId,limit=1000) {
|
package/public/utils.js
CHANGED
|
@@ -40,15 +40,10 @@ function filterBrokenMarkers(items) {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
function appendQueryParams(url,query){
|
|
43
|
-
console.log("appendQueryParams url: ", url);
|
|
44
|
-
console.log("appendQueryParams query: ", query);
|
|
45
43
|
const urlObj=new URL(url);
|
|
46
|
-
console.log("urlObj urlObj: ", urlObj);
|
|
47
44
|
Object.entries(query).forEach(([key,value])=>{
|
|
48
45
|
urlObj.searchParams.set(key,value);
|
|
49
46
|
});
|
|
50
|
-
console.log("urlObj urlObj: ", urlObj);
|
|
51
|
-
console.log("urlObj urlObj.toString(): ", urlObj.toString());
|
|
52
47
|
return urlObj.toString();
|
|
53
48
|
}
|
|
54
49
|
|