sr-npm 1.2.55 → 1.2.57
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/public/primarySearchUtils.js +26 -26
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ const { getFilter } = require('../public/filterUtils');
|
|
|
4
4
|
const { debounce } = require('./utils');
|
|
5
5
|
|
|
6
6
|
function loadPrimarySearchRepeater(_$w) {
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER_ITEM).onClick((event) => {
|
|
9
9
|
// const data = _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOB_RESULTS_REPEATER).data;
|
|
10
10
|
// const clickedItemData = data.find(
|
|
@@ -110,38 +110,38 @@ async function loadCategoriesListPrimarySearch(_$w, allvaluesobjects) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
async function primarySearch(_$w, query) {
|
|
113
|
-
if(query === undefined || query === '') {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const searchByTitle = [{field: 'title', searchTerm: query}];
|
|
119
|
-
const searchByCity = [{field: 'location.fullLocation', searchTerm: query}];
|
|
120
|
-
|
|
121
|
-
let filter = await getFilter(searchByTitle);
|
|
113
|
+
if(query === undefined || query === '') {
|
|
114
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("categoryResults");
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
122
117
|
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
const searchByTitle = [{field: 'title', searchTerm: query}];
|
|
119
|
+
const searchByCity = [{field: 'location.fullLocation', searchTerm: query}];
|
|
125
120
|
|
|
126
|
-
let
|
|
121
|
+
let filter = await getFilter(searchByTitle);
|
|
127
122
|
|
|
128
|
-
if( count > 0 ) {
|
|
129
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
|
|
130
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("jobResults");
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
filter = await getFilter(searchByCity);
|
|
134
123
|
await _$w('#jobsDataset').setFilter(filter);
|
|
135
124
|
await _$w('#jobsDataset').refresh();
|
|
136
125
|
|
|
137
|
-
count = _$w('#jobsDataset').getTotalCount();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
else{
|
|
143
|
-
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("noResults");
|
|
126
|
+
let count = _$w('#jobsDataset').getTotalCount();
|
|
127
|
+
|
|
128
|
+
if( count > 0 ) {
|
|
129
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
|
|
130
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("jobResults");
|
|
144
131
|
}
|
|
132
|
+
else {
|
|
133
|
+
filter = await getFilter(searchByCity);
|
|
134
|
+
await _$w('#jobsDataset').setFilter(filter);
|
|
135
|
+
await _$w('#jobsDataset').refresh();
|
|
136
|
+
|
|
137
|
+
count = _$w('#jobsDataset').getTotalCount();
|
|
138
|
+
if (count > 0) {
|
|
139
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.RESULTS_CONTAINER).expand();
|
|
140
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("jobResults");
|
|
141
|
+
}
|
|
142
|
+
else{
|
|
143
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.PRIMARY_SEARCH_MULTI_BOX).changeState("noResults");
|
|
144
|
+
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
return count > 0;
|