fleetmap-reports 1.0.520 → 1.0.522

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.520",
3
+ "version": "1.0.522",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.test.js CHANGED
@@ -295,7 +295,7 @@ describe('Test_Reports', function () {
295
295
  assert.equal(device.summary[0].distance, 1427444.4699999243)
296
296
  assert.equal(device.summary[0].startTime, '2022-01-01T13:35:47.000+0000')
297
297
  assert.equal(device.summary[0].endTime, '2022-01-31T17:36:27.000+0000')
298
- }, 40000)
298
+ }, 80000)
299
299
  // eslint-disable-next-line no-undef
300
300
  it('Activity 2 by device', async () => {
301
301
  const report = await getReports()
@@ -415,7 +415,7 @@ describe('Test_Reports', function () {
415
415
 
416
416
  assert.equal(data.length, 1)
417
417
  const device = data[0].devices.find(d => d.device.id === 22326)
418
- assert.equal(device.days.length, 25)
418
+ assert.equal(device.days.length, 26)
419
419
  }, 30000)
420
420
  // eslint-disable-next-line no-undef
421
421
  it('Zone Report', async () => {
@@ -259,7 +259,7 @@ function findEventsPosition (from, to, devices, events, routes, userData) {
259
259
  }
260
260
  a.deviceName = d.name
261
261
  } else {
262
- console.error('cant find position for event', a)
262
+ console.warn('cant find position for event', a)
263
263
  }
264
264
  }
265
265
  }
@@ -415,7 +415,7 @@ async function exportSpeedingReportToPDF (userData, reportData) {
415
415
  const data = []
416
416
 
417
417
  const name = userData.byDriver ? d.driver.name : deviceName(d.device)
418
- const group = userData.byDriver ? userData.groups.find(g => g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
418
+ const group = userData.byDriver ? userData.groups.find(g => g.drivers && g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
419
419
 
420
420
  let space = 0
421
421
  if (!first) {
package/src/util/utils.js CHANGED
@@ -76,7 +76,6 @@ function convertToFeature (geofence) {
76
76
  const point = turf.point([parseFloat(coord[1]), parseFloat(coord[0])])
77
77
  point.properties.geofence = geofence
78
78
  point.properties.distance = coordList[1].trim()
79
- console.log(point)
80
79
  return point
81
80
  }
82
81