fleetmap-reports 1.0.443 → 1.0.444

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.443",
3
+ "version": "1.0.444",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -261,7 +261,7 @@ function getAlertInfo (drivers, alert) {
261
261
  const driver = drivers.find(d => d.uniqueId === alert.attributes.driverUniqueId)
262
262
  return driver ? driver.name : alert.attributes.driverUniqueId
263
263
  }
264
- return ''
264
+ return alert.driver
265
265
  }
266
266
 
267
267
  function getAlertDate (user, alert) {
package/src/index.test.js CHANGED
@@ -15,12 +15,10 @@ async function getSpeedingReport (report, userData) {
15
15
 
16
16
  // eslint-disable-next-line no-undef
17
17
  describe('Test_Reports', function () {
18
- this.timeout(500000)
19
18
  // eslint-disable-next-line no-undef
20
19
  it('Speeding by device', async () => {
21
20
  const report = await getReports()
22
21
  const userData = await report.getUserData()
23
- userData.roadSpeedLimit = true
24
22
  const { device, totalDistance, totalEventTime } = await getSpeedingReport(report, userData)
25
23
  assert.equal(device.alerts.length, 15) // Total Alerts
26
24
  assert.equal(totalDistance, 19.59984677533689) // Total Kms
package/src/util/odoo.js CHANGED
@@ -1,16 +1,14 @@
1
1
 
2
- async function getOdooFuelServices (traccar, from, to) {
3
- const url = `/odoo/reports/refuelingServices?startDate=${from.toDateString()}&endDate=${to.toDateString()}`
2
+ async function getOdooFuelServices(traccar, from, to) {
3
+ const url = `/odoo/reports/refuelingServices?startDate=${from.toDateString()}&endDate=${to.toDateString()}`
4
4
 
5
- console.log('LOADING_MESSAGE:' + url)
6
- const { data } = await traccar.axios.get(url, {
7
- jar: traccar.cookieJar,
8
- withCredentials: true
9
- })
5
+ const {data} = await traccar.axios.get(url,{
6
+ jar: traccar.cookieJar,
7
+ withCredentials: true })
10
8
 
11
- console.log(data)
9
+ console.log(data)
12
10
 
13
- return data
11
+ return data
14
12
  }
15
13
 
16
14
  exports.getOdooFuelServices = getOdooFuelServices