sr-npm 1.7.229 → 1.7.230
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/backend/utils.js +1 -11
- package/package.json +1 -1
- package/pages/careersPage.js +24 -8
package/backend/utils.js
CHANGED
|
@@ -48,7 +48,7 @@ function prepareToSaveArray(jobsPerField, cityLocations, field,citylocationAddre
|
|
|
48
48
|
} else {
|
|
49
49
|
return Object.entries(jobsPerField).map(([value, amount]) => ({
|
|
50
50
|
title: value,
|
|
51
|
-
_id:
|
|
51
|
+
_id: value.replace(/\s+/g, '').replace(/&/g, 'and'),
|
|
52
52
|
count: amount,
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
@@ -63,15 +63,6 @@ function normalizeCityName(city) {
|
|
|
63
63
|
.trim();
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function sanitizeId(input) {
|
|
67
|
-
if (!input) return '';
|
|
68
|
-
const withoutDiacritics = String(input)
|
|
69
|
-
.normalize('NFD')
|
|
70
|
-
.replace(/\p{Diacritic}/gu, '');
|
|
71
|
-
const withAnd = withoutDiacritics.replace(/&/g, 'and');
|
|
72
|
-
return withAnd.replace(/[^A-Za-z0-9-]/g, '');
|
|
73
|
-
}
|
|
74
|
-
|
|
75
66
|
module.exports = {
|
|
76
67
|
chunkedBulkOperation,
|
|
77
68
|
delay,
|
|
@@ -79,5 +70,4 @@ module.exports = {
|
|
|
79
70
|
fillCityLocationAndLocationAddress,
|
|
80
71
|
prepareToSaveArray,
|
|
81
72
|
normalizeCityName,
|
|
82
|
-
sanitizeId,
|
|
83
73
|
};
|
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -144,6 +144,7 @@ async function handlePageParam(_$w) {
|
|
|
144
144
|
async function bind(_$w) {
|
|
145
145
|
await _$w('#jobsDataset').onReady(async () => {
|
|
146
146
|
await updateCount(_$w);
|
|
147
|
+
await updateMapMarkers(_$w);
|
|
147
148
|
|
|
148
149
|
});
|
|
149
150
|
|
|
@@ -238,7 +239,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
|
|
|
238
239
|
|
|
239
240
|
const count = await updateCount(_$w);
|
|
240
241
|
console.log("updating map markers");
|
|
241
|
-
await updateMapMarkers(_$w
|
|
242
|
+
await updateMapMarkers(_$w);
|
|
242
243
|
console.log("updating map markers completed");
|
|
243
244
|
count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
|
|
244
245
|
|
|
@@ -258,9 +259,13 @@ async function resetFilters(_$w) {
|
|
|
258
259
|
|
|
259
260
|
_$w('#resetFiltersButton').disable();
|
|
260
261
|
|
|
261
|
-
queryParams.remove(["keyWord", "department","page"]);
|
|
262
|
+
queryParams.remove(["keyWord", "department","page","location"]);
|
|
263
|
+
|
|
262
264
|
|
|
263
265
|
await updateCount(_$w);
|
|
266
|
+
console.log("reseting map markers");
|
|
267
|
+
await updateMapMarkers(_$w);
|
|
268
|
+
console.log("reseting map markers completed");
|
|
264
269
|
}
|
|
265
270
|
|
|
266
271
|
async function updateCount(_$w) {
|
|
@@ -338,9 +343,9 @@ async function handleLocationParam(_$w,location) {
|
|
|
338
343
|
|
|
339
344
|
}
|
|
340
345
|
|
|
341
|
-
async function updateMapMarkers(_$w
|
|
342
|
-
if(count>0){
|
|
346
|
+
async function updateMapMarkers(_$w){
|
|
343
347
|
const numOfItems = await _$w('#jobsDataset').getTotalCount();
|
|
348
|
+
// if(numOfItems>0){
|
|
344
349
|
const items = await _$w('#jobsDataset').getItems(0, numOfItems);
|
|
345
350
|
const markers = items.items.map(item => {
|
|
346
351
|
const location = item.locationAddress.location;
|
|
@@ -353,12 +358,23 @@ async function updateMapMarkers(_$w,count){
|
|
|
353
358
|
title: item.title,
|
|
354
359
|
};
|
|
355
360
|
});
|
|
361
|
+
console.log("markers: ", markers);
|
|
362
|
+
console.log("type of markers: ", typeof markers);
|
|
356
363
|
//@ts-ignore
|
|
357
364
|
_$w('#googleMaps').setMarkers(markers);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
365
|
+
let getmarkers2=await _$w('#googleMaps').markers;
|
|
366
|
+
console.log("getmarkers2: ", getmarkers2);
|
|
367
|
+
//}
|
|
368
|
+
// else{
|
|
369
|
+
// console.log("no positions found");
|
|
370
|
+
// _$w('#googleMaps').setMarkers([{
|
|
371
|
+
// location: {
|
|
372
|
+
// latitude: 0,
|
|
373
|
+
// longitude: 0
|
|
374
|
+
// },
|
|
375
|
+
// address: "No positions found",
|
|
376
|
+
// }]);
|
|
377
|
+
// }
|
|
362
378
|
}
|
|
363
379
|
|
|
364
380
|
|