sr-npm 1.7.241 → 1.7.243

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/data.js CHANGED
@@ -54,13 +54,6 @@ async function saveJobsDataToCMS() {
54
54
  return basicJob;
55
55
  });
56
56
 
57
- // Sort jobs by title (ascending, case-insensitive, numeric-aware)
58
- jobsData.sort((a, b) => {
59
- const titleA = a.title || '';
60
- const titleB = b.title || '';
61
- return titleA.localeCompare(titleB, undefined, { sensitivity: 'base', numeric: true });
62
- });
63
-
64
57
  const chunkSize = 1000;
65
58
  let totalSaved = 0;
66
59
  const totalChunks = Math.ceil(jobsData.length / chunkSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.241",
3
+ "version": "1.7.243",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -144,10 +144,11 @@ 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
 
150
- if (await window.formFactor() === "Mobile") {
151
+ if (await window.formFactor === "Mobile") {
151
152
  _$w('#dropdownsContainer').collapse();
152
153
  }
153
154
 
@@ -172,16 +173,17 @@ function init(_$w) {
172
173
  _$w('#closeFiltersButton').onClick(()=>{
173
174
  _$w('#dropdownsContainer, #closeFiltersButton').collapse();
174
175
  });
175
-
176
176
  }
177
177
 
178
178
  async function applyFilters(_$w, skipUrlUpdate = false) {
179
+ console.log("applying filters");
179
180
  const dropdownFiltersMapping = [
180
181
  { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
181
182
  { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
182
183
  { elementId: '#dropdownJobType', field: 'remote', value: _$w('#dropdownJobType').value},
183
184
  { elementId: '#searchInput', field: 'title', value: _$w('#searchInput').value }
184
185
  ];
186
+ console.log("dropdownFiltersMapping: ", dropdownFiltersMapping);
185
187
 
186
188
 
187
189
 
@@ -239,7 +241,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
239
241
 
240
242
  const count = await updateCount(_$w);
241
243
  console.log("updating map markers");
242
- await updateMapMarkers(_$w,count);
244
+ await updateMapMarkers(_$w);
243
245
  console.log("updating map markers completed");
244
246
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
245
247
 
@@ -259,9 +261,13 @@ async function resetFilters(_$w) {
259
261
 
260
262
  _$w('#resetFiltersButton').disable();
261
263
 
262
- queryParams.remove(["keyWord", "department","page"]);
264
+ queryParams.remove(["keyWord", "department","page","location"]);
265
+
263
266
 
264
267
  await updateCount(_$w);
268
+ console.log("reseting map markers");
269
+ await updateMapMarkers(_$w);
270
+ console.log("reseting map markers completed");
265
271
  }
266
272
 
267
273
  async function updateCount(_$w) {
@@ -339,8 +345,7 @@ async function handleLocationParam(_$w,location) {
339
345
 
340
346
  }
341
347
 
342
- async function updateMapMarkers(_$w,count){
343
- if(count>0){
348
+ async function updateMapMarkers(_$w){
344
349
  const numOfItems = await _$w('#jobsDataset').getTotalCount();
345
350
  const items = await _$w('#jobsDataset').getItems(0, numOfItems);
346
351
  const markers = items.items.map(item => {
@@ -354,12 +359,13 @@ async function updateMapMarkers(_$w,count){
354
359
  title: item.title,
355
360
  };
356
361
  });
362
+ console.log("markers: ", markers);
363
+ console.log("type of markers: ", typeof markers);
357
364
  //@ts-ignore
358
- _$w('#googleMaps').setMarkers(markers);
359
- }
360
- else{
361
- _$w('#googleMaps').setMarkers([]);
362
- }
365
+ await _$w('#googleMaps').setMarkers(markers);
366
+ let getmarkers2=await _$w('#googleMaps').markers;
367
+ console.log("getmarkers2: ", getmarkers2);
368
+
363
369
  }
364
370
 
365
371