sr-npm 1.7.140 → 1.7.141
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 +23 -18
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -95,9 +95,8 @@ async function handleUrlParams(_$w) {
|
|
|
95
95
|
|
|
96
96
|
async function handleKeyWordParam(_$w,keyWord) {
|
|
97
97
|
_$w('#searchInput').value = keyWord;
|
|
98
|
-
//
|
|
99
|
-
await $w
|
|
100
|
-
await _$w("#jobsDataset").refresh();
|
|
98
|
+
// Use applyFilters to maintain consistency instead of directly setting filter
|
|
99
|
+
await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
async function handlePageParam(_$w) {
|
|
@@ -158,7 +157,7 @@ function init(_$w) {
|
|
|
158
157
|
const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
|
|
159
158
|
|
|
160
159
|
_$w('#searchInput').onInput(debouncedSearch);
|
|
161
|
-
|
|
160
|
+
_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
|
|
162
161
|
_$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
|
|
163
162
|
|
|
164
163
|
_$w('#openFiltersButton').onClick(()=>{
|
|
@@ -170,7 +169,7 @@ function init(_$w) {
|
|
|
170
169
|
});
|
|
171
170
|
}
|
|
172
171
|
|
|
173
|
-
async function applyFilters(_$w) {
|
|
172
|
+
async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
174
173
|
console.log("applyFilters");
|
|
175
174
|
console.log("after applyFilters_$w('#dropdownDepartment').value", _$w('#dropdownDepartment').value);
|
|
176
175
|
const dropdownFiltersMapping = [
|
|
@@ -190,17 +189,21 @@ async function applyFilters(_$w) {
|
|
|
190
189
|
if (filter.value === RESET_ALL) {
|
|
191
190
|
_$w(filter.elementId).value = '';
|
|
192
191
|
filter.value = '';
|
|
193
|
-
|
|
192
|
+
if (!skipUrlUpdate) {
|
|
193
|
+
queryParams.remove(["keyWord", "department","page"]);
|
|
194
|
+
}
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
// build filters
|
|
197
198
|
if (filter.value && filter.value.trim() !== '') {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
if (!skipUrlUpdate) {
|
|
200
|
+
if(filter.field === 'title'){
|
|
201
|
+
queryParams.add({ keyWord: filter.value });
|
|
202
|
+
}
|
|
203
|
+
if(filter.field === 'department'){
|
|
204
|
+
queryParams.add({ department: filter.value });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
204
207
|
if(filter.field === 'remote') {
|
|
205
208
|
value = filter.value === 'true';
|
|
206
209
|
} else {
|
|
@@ -209,11 +212,13 @@ async function applyFilters(_$w) {
|
|
|
209
212
|
filters.push({ field: filter.field, searchTerm: value });
|
|
210
213
|
}
|
|
211
214
|
else{
|
|
212
|
-
if(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
if (!skipUrlUpdate) {
|
|
216
|
+
if(filter.field === 'title'){
|
|
217
|
+
queryParams.remove(["keyWord" ]);
|
|
218
|
+
}
|
|
219
|
+
if(filter.field === 'department'){
|
|
220
|
+
queryParams.remove(["department" ]);
|
|
221
|
+
}
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
});
|
|
@@ -259,7 +264,7 @@ async function handleDepartmentParam(_$w,department) {
|
|
|
259
264
|
_$w('#dropdownDepartment').value = department.replace('-', ' ');
|
|
260
265
|
console.log("before applyFilters_$w('#dropdownDepartment').value", _$w('#dropdownDepartment').value);
|
|
261
266
|
|
|
262
|
-
await applyFilters(_$w);
|
|
267
|
+
await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
263
268
|
}
|
|
264
269
|
|
|
265
270
|
|