sr-npm 1.7.244 → 1.7.246

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.244",
3
+ "version": "1.7.246",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ const {
18
18
  let queryDepartmentVar;
19
19
  let queryLocationVar;
20
20
  async function careersPageOnReady(_$w,thisObject,queryParams) {
21
+ console.log("careersPageOn@!$%#$%##$%$#$#$%#$%#Ready");
21
22
  console.log("queryParams: ", queryParams);
22
23
  const { page, keyWord, department, location } = queryParams;
23
24
  queryPageVar=page;
@@ -144,7 +145,6 @@ async function handlePageParam(_$w) {
144
145
  async function bind(_$w) {
145
146
  await _$w('#jobsDataset').onReady(async () => {
146
147
  await updateCount(_$w);
147
- await updateMapMarkers(_$w);
148
148
 
149
149
  });
150
150
 
@@ -154,6 +154,9 @@ async function bind(_$w) {
154
154
 
155
155
  _$w('#positionsRepeater').onItemReady(async ($item, itemData) => {
156
156
  $item('#positionItem').onClick(() => {
157
+ console.log("itemData: ", itemData);
158
+ console.log("$item: ", $item);
159
+ console.log("itemData['link-jobs-title']: ", itemData['link-jobs-title']);
157
160
  to(`${itemData['link-jobs-title']}`);
158
161
  });
159
162
  });
@@ -176,14 +179,12 @@ function init(_$w) {
176
179
  }
177
180
 
178
181
  async function applyFilters(_$w, skipUrlUpdate = false) {
179
- console.log("applying filters");
180
182
  const dropdownFiltersMapping = [
181
183
  { elementId: '#dropdownDepartment', field: 'department', value: _$w('#dropdownDepartment').value },
182
184
  { elementId: '#dropdownLocation', field: 'cityText', value: _$w('#dropdownLocation').value },
183
185
  { elementId: '#dropdownJobType', field: 'remote', value: _$w('#dropdownJobType').value},
184
186
  { elementId: '#searchInput', field: 'title', value: _$w('#searchInput').value }
185
187
  ];
186
- console.log("dropdownFiltersMapping: ", dropdownFiltersMapping);
187
188
 
188
189
 
189
190
 
@@ -241,7 +242,7 @@ async function applyFilters(_$w, skipUrlUpdate = false) {
241
242
 
242
243
  const count = await updateCount(_$w);
243
244
  console.log("updating map markers");
244
- await updateMapMarkers(_$w);
245
+ await updateMapMarkers(_$w,count);
245
246
  console.log("updating map markers completed");
246
247
  count ? _$w('#resultsMultiState').changeState('results') : _$w('#resultsMultiState').changeState('noResults');
247
248
 
@@ -261,13 +262,9 @@ async function resetFilters(_$w) {
261
262
 
262
263
  _$w('#resetFiltersButton').disable();
263
264
 
264
- queryParams.remove(["keyWord", "department","page","location"]);
265
-
265
+ queryParams.remove(["keyWord", "department","page"]);
266
266
 
267
267
  await updateCount(_$w);
268
- console.log("reseting map markers");
269
- await updateMapMarkers(_$w);
270
- console.log("reseting map markers completed");
271
268
  }
272
269
 
273
270
  async function updateCount(_$w) {
@@ -345,40 +342,27 @@ async function handleLocationParam(_$w,location) {
345
342
 
346
343
  }
347
344
 
348
- async function updateMapMarkers(_$w){
345
+ async function updateMapMarkers(_$w,count){
346
+ if(count>0){
349
347
  const numOfItems = await _$w('#jobsDataset').getTotalCount();
350
348
  const items = await _$w('#jobsDataset').getItems(0, numOfItems);
351
- const markers = items.items
352
- .filter(item => {
353
- const locationAddress = item.locationAddress;
354
- const location = locationAddress && locationAddress.location;
355
- return (
356
- location !== undefined &&
357
- location !== null &&
358
- location.latitude !== undefined &&
359
- location.latitude !== null &&
360
- location.longitude !== undefined &&
361
- location.longitude !== null
362
- );
363
- })
364
- .map(item => {
365
- const location = item.locationAddress.location;
366
- return {
367
- location: {
368
- latitude: location.latitude,
369
- longitude: location.longitude
370
- },
371
- address: item.locationAddress.formatted,
372
- title: item.title
373
- };
374
- });
375
- console.log("markers: ", markers);
376
- console.log("type of markers: ", typeof markers);
349
+ const markers = items.items.map(item => {
350
+ const location = item.locationAddress.location;
351
+ return {
352
+ location: {
353
+ latitude: location.latitude,
354
+ longitude: location.longitude
355
+ },
356
+ address: item.locationAddress.formatted,
357
+ title: item.title,
358
+ };
359
+ });
377
360
  //@ts-ignore
378
- await _$w('#googleMaps').setMarkers(markers);
379
- let getmarkers2=await _$w('#googleMaps').markers;
380
- console.log("getmarkers2: ", getmarkers2);
381
-
361
+ _$w('#googleMaps').setMarkers(markers);
362
+ }
363
+ else{
364
+ _$w('#googleMaps').setMarkers([]);
365
+ }
382
366
  }
383
367
 
384
368