fleetmap-reports 1.0.293 → 1.0.298

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": "fleetmap-reports",
3
- "version": "1.0.293",
3
+ "version": "1.0.298",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -260,7 +260,7 @@ async function getHereEvents(devices, routes, threshold){
260
260
  console.log('empty array after filter on device', d.name)
261
261
  continue
262
262
  }
263
- const reduced = hereAlerts.reduce((acc, cur, idx, src) => {
263
+ const reduced = hereAlerts.length < 2 ? hereAlerts : hereAlerts.reduce((acc, cur, idx, src) => {
264
264
  if (idx === 1) {
265
265
  return [cur]
266
266
  }
@@ -271,7 +271,7 @@ async function getHereEvents(devices, routes, threshold){
271
271
  })
272
272
  events.push(...reduced)
273
273
  } catch (e) {
274
- console.error(hereAlerts, e)
274
+ console.error(hereAlerts, 'threshold', threshold, e)
275
275
  }
276
276
  }
277
277
  return events
@@ -346,7 +346,7 @@ async function exportSpeedingReportToPDF(userData, reportData) {
346
346
 
347
347
  if (overspeedData) {
348
348
  let first = true
349
- const doc = new jsPDF.jsPDF('l');
349
+ const doc = new jsPDF.jsPDF('l','pt', 'a4', true);
350
350
  await headerFromUser(doc, translations.report.titleSpeedingReport, userData.user)
351
351
 
352
352
  overspeedData.forEach(d => {
@@ -483,7 +483,6 @@ function exportSpeedingReportToExcel(userData, reportData) {
483
483
  }
484
484
  }))
485
485
  })
486
- console.log(data)
487
486
  return {
488
487
  headers,
489
488
  data,