sr-npm 1.7.358 → 1.7.359
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 +1 -79
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -88,11 +88,6 @@ async function setPageParamInUrl() {
|
|
|
88
88
|
|
|
89
89
|
}
|
|
90
90
|
async function handleUrlParams(_$w) {
|
|
91
|
-
console.log("queryKeyWordVar: ", queryKeyWordVar);
|
|
92
|
-
console.log("queryPageVar: ", queryPageVar);
|
|
93
|
-
console.log("queryDepartmentVar: ", queryDepartmentVar);
|
|
94
|
-
console.log("queryLocationVar: ", queryLocationVar);
|
|
95
|
-
console.log("queryJobTypeVar: ", queryJobTypeVar);
|
|
96
91
|
if (queryKeyWordVar) {
|
|
97
92
|
await handleKeyWordParam(_$w,queryKeyWordVar);
|
|
98
93
|
}
|
|
@@ -114,7 +109,6 @@ async function handleUrlParams(_$w) {
|
|
|
114
109
|
async function handleKeyWordParam(_$w,keyWord) {
|
|
115
110
|
_$w('#searchInput').value = keyWord;
|
|
116
111
|
// Use applyFilters to maintain consistency instead of directly setting filter
|
|
117
|
-
// await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
118
112
|
}
|
|
119
113
|
|
|
120
114
|
async function handlePageParam(_$w) {
|
|
@@ -178,7 +172,7 @@ function init(_$w) {
|
|
|
178
172
|
}
|
|
179
173
|
});
|
|
180
174
|
_$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>{
|
|
181
|
-
console.log("onChange
|
|
175
|
+
console.log("dropdown onChange is triggered");
|
|
182
176
|
applyFilters(_$w);
|
|
183
177
|
});
|
|
184
178
|
_$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
|
|
@@ -194,64 +188,7 @@ function init(_$w) {
|
|
|
194
188
|
//URL onChange
|
|
195
189
|
onChange(async ()=>{
|
|
196
190
|
await handleBackAndForth(_$w);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
//try onready first
|
|
204
|
-
//try location to
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
// handleBackAndForth(_$w);
|
|
211
|
-
// const newQueryParams=await location.query();
|
|
212
|
-
// console.log("location.query(): ", newQueryParams);
|
|
213
|
-
// if(newQueryParams.keyWord){
|
|
214
|
-
// console.log("setting querykeyparam")
|
|
215
|
-
// queryKeyWordVar=newQueryParams.keyWord;
|
|
216
|
-
// }
|
|
217
|
-
// else
|
|
218
|
-
// {
|
|
219
|
-
// queryKeyWordVar=undefined;
|
|
220
|
-
// _$w('#searchInput').value = '';
|
|
221
|
-
// deletedParam=true;
|
|
222
|
-
// }
|
|
223
|
-
// if(newQueryParams.department){
|
|
224
|
-
// console.log("setting queryDepartmentVar")
|
|
225
|
-
// queryDepartmentVar=newQueryParams.department;
|
|
226
|
-
// }
|
|
227
|
-
// else
|
|
228
|
-
// {
|
|
229
|
-
// queryDepartmentVar=undefined;
|
|
230
|
-
// _$w('#dropdownDepartment').value = '';
|
|
231
|
-
// deletedParam=true;
|
|
232
|
-
// }
|
|
233
|
-
// if(newQueryParams.location){
|
|
234
|
-
// console.log("setting queryLocationVar")
|
|
235
|
-
// queryLocationVar=newQueryParams.location;
|
|
236
|
-
// }
|
|
237
|
-
// else
|
|
238
|
-
// {
|
|
239
|
-
// queryLocationVar=undefined;
|
|
240
|
-
// _$w('#dropdownLocation').value = '';
|
|
241
|
-
// deletedParam=true;
|
|
242
|
-
// }
|
|
243
|
-
|
|
244
|
-
// await handleUrlParams(_$w);
|
|
245
|
-
// if(deletedParam)
|
|
246
|
-
// {
|
|
247
|
-
// await applyFilters(_$w,true);
|
|
248
|
-
// deletedParam=false;
|
|
249
|
-
// }
|
|
250
191
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
192
|
}
|
|
256
193
|
|
|
257
194
|
|
|
@@ -291,9 +228,6 @@ async function handleBackAndForth(_$w){
|
|
|
291
228
|
_$w('#dropdownJobType').value = '';
|
|
292
229
|
}
|
|
293
230
|
await handleUrlParams(_$w);
|
|
294
|
-
// if(deletedParam){
|
|
295
|
-
// await applyFilters(_$w,true);
|
|
296
|
-
// }
|
|
297
231
|
|
|
298
232
|
}
|
|
299
233
|
|
|
@@ -324,15 +258,12 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
324
258
|
if (!skipUrlUpdate) {
|
|
325
259
|
if(filter.field === 'title'){
|
|
326
260
|
queryParams.add({ keyWord: filter.value });
|
|
327
|
-
// queryKeyWordVar=filter.value;
|
|
328
261
|
}
|
|
329
262
|
if(filter.field === 'department'){
|
|
330
263
|
queryParams.add({ department: encodeURIComponent(filter.value) });
|
|
331
|
-
//queryDepartmentVar=filter.value;
|
|
332
264
|
}
|
|
333
265
|
if(filter.field === 'cityText'){
|
|
334
266
|
queryParams.add({ location: encodeURIComponent(filter.value) });
|
|
335
|
-
//queryLocationVar=filter.value;
|
|
336
267
|
}
|
|
337
268
|
if(filter.field === 'remote'){
|
|
338
269
|
if(filter.value === 'true'){
|
|
@@ -341,7 +272,6 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
341
272
|
else{
|
|
342
273
|
queryParams.add({ jobType: encodeURIComponent("onsite") });
|
|
343
274
|
}
|
|
344
|
-
//queryJobTypeVar=filter.value;
|
|
345
275
|
}
|
|
346
276
|
}
|
|
347
277
|
if(filter.field === 'remote') {
|
|
@@ -355,22 +285,18 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
355
285
|
if (!skipUrlUpdate) {
|
|
356
286
|
if(filter.field === 'title'){
|
|
357
287
|
queryParams.remove(["keyWord" ]);
|
|
358
|
-
// queryKeyWordVar=undefined;
|
|
359
288
|
}
|
|
360
289
|
if(filter.field === 'department'){
|
|
361
290
|
console.log("removing department from url")
|
|
362
291
|
queryParams.remove(["department" ]);
|
|
363
|
-
// queryDepartmentVar=undefined;
|
|
364
292
|
}
|
|
365
293
|
if(filter.field === 'cityText'){
|
|
366
294
|
console.log("removing location from url")
|
|
367
295
|
queryParams.remove(["location" ]);
|
|
368
|
-
// queryLocationVar=undefined;
|
|
369
296
|
}
|
|
370
297
|
if(filter.field === 'remote'){
|
|
371
298
|
console.log("removing jobType from url")
|
|
372
299
|
queryParams.remove(["jobType" ]);
|
|
373
|
-
// queryJobTypeVar=undefined;
|
|
374
300
|
}
|
|
375
301
|
}
|
|
376
302
|
}
|
|
@@ -438,7 +364,6 @@ async function handleDepartmentParam(_$w,department) {
|
|
|
438
364
|
{
|
|
439
365
|
console.log("department value found in dropdown options ",departmentValue);
|
|
440
366
|
_$w('#dropdownDepartment').value = departmentValue;
|
|
441
|
-
// await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
442
367
|
}
|
|
443
368
|
else{
|
|
444
369
|
console.warn("department value not found in dropdown options");
|
|
@@ -479,7 +404,6 @@ async function handleLocationParam(_$w,location) {
|
|
|
479
404
|
|
|
480
405
|
if(option){
|
|
481
406
|
_$w('#dropdownLocation').value = option.value;
|
|
482
|
-
// await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
|
|
483
407
|
}
|
|
484
408
|
else{
|
|
485
409
|
console.warn("location value not found in dropdown options");
|
|
@@ -499,9 +423,7 @@ async function handleJobTypeParam(_$w,jobType) {
|
|
|
499
423
|
if(jobTypeValue.toLowerCase()==="onsite"){
|
|
500
424
|
option="false";
|
|
501
425
|
}
|
|
502
|
-
//const option=_$w('#dropdownJobType').options.find(option => option.value.toLowerCase() === jobTypeValue.toLowerCase())
|
|
503
426
|
if(option){
|
|
504
|
-
|
|
505
427
|
_$w('#dropdownJobType').value = option;
|
|
506
428
|
}
|
|
507
429
|
else{
|