sr-npm 1.7.988 → 1.7.989
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 +1 -1
- package/pages/careersMultiBoxesPage.js +16 -11
- package/pages/homePage.js +1 -4
- package/pages/pagesUtils.js +4 -18
- package/pages/positionPage.js +1 -2
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ const pagination = {
|
|
|
22
22
|
currentPage: 1,
|
|
23
23
|
};
|
|
24
24
|
async function careersMultiBoxesPageOnReady(_$w,urlParams) {
|
|
25
|
+
console.log("urlParams is inside multi boxes page on ready ",urlParams);
|
|
25
26
|
await loadData(_$w);
|
|
26
27
|
loadJobsRepeater(_$w);
|
|
27
28
|
loadPrimarySearchRepeater(_$w);
|
|
@@ -48,6 +49,7 @@ async function clearAll(_$w) {
|
|
|
48
49
|
secondarySearchIsFilled=false;
|
|
49
50
|
currentJobs=alljobs;
|
|
50
51
|
keywordAllJobs=undefined;
|
|
52
|
+
queryParams.remove(["keyword", "brand","visibility","category","page"]);
|
|
51
53
|
await updateJobsAndNumbersAndFilters(_$w,true);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -70,6 +72,7 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
70
72
|
applyFiltering=await handleParams(_$w,"visibility",urlParams.visibility)
|
|
71
73
|
}
|
|
72
74
|
if(urlParams.category) {
|
|
75
|
+
console.log("category url param is present ",urlParams.category);
|
|
73
76
|
applyFiltering=await handleParams(_$w,"category",urlParams.category)
|
|
74
77
|
}
|
|
75
78
|
|
|
@@ -83,14 +86,14 @@ async function handleUrlParams(_$w,urlParams) {
|
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
pagination.currentPage=Number(urlParams.page);
|
|
86
|
-
let paginationCurrentText=
|
|
89
|
+
let paginationCurrentText=urlParams.page;
|
|
87
90
|
let startSlicIndex=pagination.pageSize*(pagination.currentPage-1);
|
|
88
91
|
let endSlicIndex=(pagination.pageSize)*(pagination.currentPage);
|
|
89
92
|
if(Number(urlParams.page)==Math.ceil(currentJobs.length/pagination.pageSize)) {
|
|
90
|
-
paginationCurrentText=paginationCurrentText-(pagination.pageSize-(currentJobs.length%pagination.pageSize));
|
|
93
|
+
paginationCurrentText=(paginationCurrentText-(pagination.pageSize-(currentJobs.length%pagination.pageSize))).toString();
|
|
91
94
|
endSlicIndex=currentJobs.length;
|
|
92
95
|
}
|
|
93
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = paginationCurrentText
|
|
96
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = paginationCurrentText
|
|
94
97
|
const jobsFirstPage=currentJobs.slice(startSlicIndex,endSlicIndex);
|
|
95
98
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
96
99
|
handlePaginationButtons(_$w);
|
|
@@ -123,8 +126,9 @@ async function handleParams(_$w,param,value) {
|
|
|
123
126
|
try {
|
|
124
127
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_NEXT).onClick(async () => {
|
|
125
128
|
let nextPageJobs=currentJobs.slice(pagination.pageSize*pagination.currentPage,pagination.pageSize*(pagination.currentPage+1));
|
|
126
|
-
|
|
129
|
+
|
|
127
130
|
pagination.currentPage++;
|
|
131
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = pagination.currentPage.toString();
|
|
128
132
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = nextPageJobs;
|
|
129
133
|
handlePaginationButtons(_$w);
|
|
130
134
|
});
|
|
@@ -132,7 +136,7 @@ async function handleParams(_$w,param,value) {
|
|
|
132
136
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PAGE_BUTTON_PREVIOUS).onClick(async () => {
|
|
133
137
|
let previousPageJobs=currentJobs.slice(pagination.pageSize*(pagination.currentPage-2),pagination.pageSize*(pagination.currentPage-1));
|
|
134
138
|
pagination.currentPage--;
|
|
135
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text =
|
|
139
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = pagination.currentPage.toString();
|
|
136
140
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = previousPageJobs;
|
|
137
141
|
handlePaginationButtons(_$w);
|
|
138
142
|
});
|
|
@@ -208,8 +212,8 @@ async function loadJobsRepeater(_$w) {
|
|
|
208
212
|
|
|
209
213
|
const jobsFirstPage=alljobs.slice(0,pagination.pageSize);
|
|
210
214
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
211
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text =
|
|
212
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = currentJobs.length.toString();
|
|
215
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = "1"
|
|
216
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = Math.ceil(currentJobs.length/pagination.pageSize).toString();
|
|
213
217
|
updateTotalJobsCountText(_$w);
|
|
214
218
|
handlePaginationButtons(_$w);
|
|
215
219
|
} catch (error) {
|
|
@@ -381,8 +385,8 @@ async function loadJobsRepeater(_$w) {
|
|
|
381
385
|
let jobsFirstPage=[];
|
|
382
386
|
secondarySearchIsFilled? jobsFirstPage=currentSecondarySearchJobs.slice(0,pagination.pageSize):jobsFirstPage=currentJobs.slice(0,pagination.pageSize);
|
|
383
387
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
384
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text =
|
|
385
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = secondarySearchIsFilled? currentSecondarySearchJobs.length.toString():currentJobs.length.toString();
|
|
388
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = "1";
|
|
389
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = secondarySearchIsFilled? Math.ceil(currentSecondarySearchJobs.length/pagination.pageSize).toString():Math.ceil(currentJobs.length/pagination.pageSize).toString();
|
|
386
390
|
if(jobsFirstPage.length===0) {
|
|
387
391
|
await _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_MULTI_STATE_BOX).changeState("noJobs");
|
|
388
392
|
}
|
|
@@ -480,9 +484,10 @@ async function secondarySearch(_$w,query) {
|
|
|
480
484
|
currentSecondarySearchJobs=allsecondarySearchJobs;
|
|
481
485
|
const jobsFirstPage=allsecondarySearchJobs.slice(0,pagination.pageSize);
|
|
482
486
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = jobsFirstPage;
|
|
483
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text =
|
|
484
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = allsecondarySearchJobs.length.toString();
|
|
487
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationCurrentText).text = "1";
|
|
488
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.paginationTotalCountText).text = Math.ceil(allsecondarySearchJobs.length/pagination.pageSize).toString();
|
|
485
489
|
pagination.currentPage=1;
|
|
490
|
+
|
|
486
491
|
if(jobsFirstPage.length===0) {
|
|
487
492
|
await _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_MULTI_STATE_BOX).changeState("noJobs");
|
|
488
493
|
}
|
package/pages/homePage.js
CHANGED
|
@@ -15,16 +15,13 @@ async function homePageOnReady(_$w,thisObject=null) {
|
|
|
15
15
|
|
|
16
16
|
const queryResult = await wixData.query(COLLECTIONS.SITE_CONFIGS).find();
|
|
17
17
|
const siteconfig = queryResult.items[0];
|
|
18
|
-
if(siteconfig.
|
|
18
|
+
if(siteconfig.categorySearch==="true") {
|
|
19
19
|
const allJobs=await getAllRecords(COLLECTIONS.JOBS);
|
|
20
20
|
const allvaluesobjects=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
|
|
21
21
|
bindPrimarySearch(_$w,allvaluesobjects,allJobs);
|
|
22
22
|
loadPrimarySearchRepeater(_$w)
|
|
23
|
-
console.log("siteconfig.twg: ",siteconfig.twg);
|
|
24
|
-
if(siteconfig.twg==="external") {
|
|
25
23
|
bindTeamRepeater(_$w)
|
|
26
24
|
bindViewAllButton(_$w)
|
|
27
|
-
}
|
|
28
25
|
}
|
|
29
26
|
else{
|
|
30
27
|
|
package/pages/pagesUtils.js
CHANGED
|
@@ -85,25 +85,11 @@ function loadPrimarySearchRepeater(_$w) {
|
|
|
85
85
|
const data = _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).data;
|
|
86
86
|
const clickedItemData = data.find(
|
|
87
87
|
(item) => item._id === event.context.itemId,
|
|
88
|
+
|
|
88
89
|
);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
);
|
|
93
|
-
if (linkKey && clickedItemData[linkKey] ) {
|
|
94
|
-
console.log("original link: ",clickedItemData[linkKey]);
|
|
95
|
-
console.log("original clickedItemData: ",clickedItemData);
|
|
96
|
-
console.log(typeof clickedItemData[linkKey]);
|
|
97
|
-
console.log(clickedItemData[linkKey].toString().includes("copy-of-jobs"));
|
|
98
|
-
if(clickedItemData[linkKey].includes("copy-of-jobs")) {
|
|
99
|
-
clickedItemData[linkKey]=clickedItemData[linkKey].replace("copy-of-jobs","jobs")
|
|
100
|
-
}
|
|
101
|
-
console.log("new link: ",clickedItemData[linkKey]);
|
|
102
|
-
console.log("new clickedItemData: ",clickedItemData);
|
|
103
|
-
console.log("redirecting to: ",clickedItemData[linkKey]);
|
|
104
|
-
location.to(clickedItemData[linkKey]);
|
|
105
|
-
}
|
|
106
|
-
|
|
90
|
+
console.log("clickedItemData: ",clickedItemData);
|
|
91
|
+
console.log("clickedItemData['link-jobs-title']: ",clickedItemData["link-jobs-title"]);
|
|
92
|
+
location.to(clickedItemData["link-jobs-title"]);
|
|
107
93
|
});
|
|
108
94
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.CATEGORY_RESULTS_REPEATER).onItemReady(async ($item, itemData) => {
|
|
109
95
|
$item(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_CATEGORY_BUTTON).label = itemData.title || '';
|
package/pages/positionPage.js
CHANGED
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
async function positionPageOnReady(_$w) {
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
await bind(_$w);
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,6 @@ async function getCategoryValue(customValues) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
async function bind(_$w) {
|
|
35
|
-
console.log("bind called");
|
|
36
35
|
_$w('#datasetJobsItem').onReady(async () => {
|
|
37
36
|
|
|
38
37
|
const item = await _$w('#datasetJobsItem').getCurrentItem();
|