sr-npm 1.7.72 → 1.7.73
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/careersPage.js +49 -46
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -78,7 +78,10 @@ async function handleUrlParams(_$w) {
|
|
|
78
78
|
|
|
79
79
|
async function handleKeyWordParam(_$w,keyWord) {
|
|
80
80
|
_$w('#searchInput').value = keyWord;
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
const filter = await wixData.query("Jobs").contains("title", keyWord);
|
|
83
|
+
console.log("typeof filter is: ", typeof filter);
|
|
84
|
+
await _$w("#jobsDataset").setFilter(filter);
|
|
82
85
|
await _$w("#jobsDataset").refresh();
|
|
83
86
|
}
|
|
84
87
|
|
|
@@ -137,11 +140,11 @@ async function bind(_$w) {
|
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
function init(_$w) {
|
|
140
|
-
|
|
143
|
+
// const debouncedSearch = debounce(applyFilters, 400);
|
|
141
144
|
|
|
142
|
-
|
|
143
|
-
_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
|
|
144
|
-
_$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
|
|
145
|
+
// _$w('#searchInput').onInput(debouncedSearch);
|
|
146
|
+
//_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
|
|
147
|
+
//_$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
|
|
145
148
|
|
|
146
149
|
_$w('#openFiltersButton').onClick(()=>{
|
|
147
150
|
_$w('#dropdownsContainer, #closeFiltersButton').expand();
|
|
@@ -152,55 +155,55 @@ function init(_$w) {
|
|
|
152
155
|
});
|
|
153
156
|
}
|
|
154
157
|
|
|
155
|
-
async function applyFilters(_$w) {
|
|
158
|
+
// async function applyFilters(_$w) {
|
|
156
159
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
// const dropdownFiltersMapping = [
|
|
161
|
+
// { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
|
|
162
|
+
// { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
|
|
163
|
+
// { elementId: '#dropdownJobType', field: 'remote', value: _$w('#dropdownJobType').value},
|
|
164
|
+
// { elementId: '#searchInput', field: 'title', value: _$w('#searchInput').value }
|
|
165
|
+
// ];
|
|
163
166
|
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
// let filters = [];
|
|
168
|
+
// let value;
|
|
166
169
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
170
|
+
// dropdownFiltersMapping.forEach(filter => {
|
|
171
|
+
// // Handle RESET_ALL values
|
|
172
|
+
// if (filter.value === RESET_ALL) {
|
|
173
|
+
// _$w(filter.elementId).value = '';
|
|
174
|
+
// filter.value = '';
|
|
175
|
+
// }
|
|
176
|
+
|
|
177
|
+
// // build filters
|
|
178
|
+
// if (filter.value && filter.value.trim() !== '') {
|
|
179
|
+
// if(filter.field === 'title'){
|
|
180
|
+
// queryParams.queryParams().add({ keyWord: filter.value });
|
|
181
|
+
// }
|
|
182
|
+
// if(filter.field === 'remote') {
|
|
183
|
+
// value = filter.value === 'true';
|
|
184
|
+
// } else {
|
|
185
|
+
// value = filter.value;
|
|
186
|
+
// }
|
|
187
|
+
// filters.push({ field: filter.field, searchTerm: value });
|
|
188
|
+
// }
|
|
189
|
+
// else{
|
|
190
|
+
// queryParams.queryParams().remove(["keyWord" ]);
|
|
191
|
+
// }
|
|
192
|
+
// });
|
|
190
193
|
|
|
191
|
-
|
|
194
|
+
// const filter = await getFilter(filters, 'and');
|
|
192
195
|
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
// await _$w('#jobsDataset').setFilter(filter);
|
|
197
|
+
// await _$w('#jobsDataset').refresh();
|
|
195
198
|
|
|
196
|
-
|
|
199
|
+
// const count = await updateCount();
|
|
197
200
|
|
|
198
|
-
|
|
201
|
+
// count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
|
|
199
202
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
203
|
+
// // Update reset button state
|
|
204
|
+
// const hasActiveFilters = filters.length > 0;
|
|
205
|
+
// hasActiveFilters? _$w('#resetFiltersButton').enable() : _$w('#resetFiltersButton').disable();
|
|
206
|
+
// }
|
|
204
207
|
|
|
205
208
|
async function resetFilters(_$w) {
|
|
206
209
|
_$w('#searchInput, #dropdownDepartment, #dropdownLocation, #dropdownJobType').value = '';
|