sr-npm 1.7.229 → 1.7.231

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 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: sanitizeId(value),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.229",
3
+ "version": "1.7.231",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,7 @@ const {
17
17
  let queryKeyWordVar;
18
18
  let queryDepartmentVar;
19
19
  let queryLocationVar;
20
+ let searchInputFocused = false;
20
21
  async function careersPageOnReady(_$w,thisObject,queryParams) {
21
22
  console.log("queryParams: ", queryParams);
22
23
  const { page, keyWord, department, location } = queryParams;
@@ -162,6 +163,8 @@ function init(_$w) {
162
163
  const debouncedSearch = debounce(()=>applyFilters(_$w), 400,thisObjectVar);
163
164
 
164
165
  _$w('#searchInput').onInput(debouncedSearch);
166
+ _$w('#searchInput').onFocus(() => { searchInputFocused = true; });
167
+ _$w('#searchInput').onBlur(() => { searchInputFocused = false; });
165
168
  _$w('#dropdownDepartment, #dropdownLocation, #dropdownJobType').onChange(()=>applyFilters(_$w));
166
169
  _$w('#resetFiltersButton, #clearSearch').onClick(()=>resetFilters(_$w));
167
170
 
@@ -175,6 +178,7 @@ function init(_$w) {
175
178
  }
176
179
 
177
180
  async function applyFilters(_$w, skipUrlUpdate = false) {
181
+
178
182
  const dropdownFiltersMapping = [
179
183
  { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
180
184
  { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
@@ -236,6 +240,11 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
236
240
  await _$w('#jobsDataset').setFilter(filter);
237
241
  await _$w('#jobsDataset').refresh();
238
242
 
243
+
244
+ if (searchInputFocused) {
245
+ _$w('#searchInput').focus();
246
+ }
247
+
239
248
  const count = await updateCount(_$w);
240
249
  console.log("updating map markers");
241
250
  await updateMapMarkers(_$w,count);
@@ -345,6 +354,7 @@ async function updateMapMarkers(_$w,count){
345
354
  const markers = items.items.map(item => {
346
355
  const location = item.locationAddress.location;
347
356
  return {
357
+
348
358
  location: {
349
359
  latitude: location.latitude,
350
360
  longitude: location.longitude