fleetmap-reports 1.0.704 → 1.0.706

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.704",
3
+ "version": "1.0.706",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -35,8 +35,8 @@
35
35
  "eslint-plugin-node": "^11.1.0",
36
36
  "eslint-plugin-promise": "^6.0.0",
37
37
  "jest": "^27.5.0",
38
- "mocha": "^9.0.3",
39
- "webpack": "^5.24.3",
38
+ "mocha": "^10.2.0",
39
+ "webpack": "^5.51.0",
40
40
  "webpack-cli": "^4.5.0"
41
41
  }
42
42
  }
@@ -154,7 +154,6 @@ function processDrivers (from, to, userData, data) {
154
154
  filteredEvents.forEach(e => {
155
155
  findPOIData(e, userData)
156
156
  findGeofenceData(e, userData)
157
-
158
157
  const device = userData.devices.find(d => d.id === e.position.deviceId)
159
158
  e.deviceName = device ? device.name : ''
160
159
  })
@@ -207,7 +206,7 @@ function findPOIData (event, userData) {
207
206
  }
208
207
 
209
208
  function findGeofenceData (event, userData) {
210
- const geofence = userData.geofences.find(g =>
209
+ const geofence = userData.geofences.filter(g => !g.area.startsWith('CIRCLE')).find(g =>
211
210
  checkGeofenceIn(convertPositionToFeature(event.position), convertToFeature(g)))
212
211
  if (geofence) {
213
212
  const group = userData.groups.find(g => g.geofenceIds && g.geofenceIds.includes(geofence.id))
@@ -1,5 +1,4 @@
1
1
  const { getReports } = require('./index')
2
- const assert = require('assert')
3
2
  // eslint-disable-next-line no-undef
4
3
  describe('idle', function () {
5
4
  // eslint-disable-next-line no-undef
@@ -17,10 +17,12 @@ describe('Test_Reports', function () {
17
17
  userData)
18
18
  await report.speedingReportToPDF(userData, data)
19
19
  }, 40000)
20
+
20
21
  it('converts madrid time', async () => {
21
22
  assert.equal(false, utils.isClientSide())
22
23
  console.log(utils.convertToLocaleString(new Date(), 'es-CL', 'Europe/Madrid'))
23
24
  })
25
+
24
26
  // eslint-disable-next-line no-undef
25
27
  it('Trip by device', async () => {
26
28
  const report = await getReports()
@@ -1,6 +1,5 @@
1
1
  const { getReports } = require('./index')
2
2
  const assert = require('assert')
3
- const ellca = require('./ellca.json')
4
3
  // eslint-disable-next-line no-undef
5
4
  describe('zones', function () {
6
5
  // eslint-disable-next-line no-undef
@@ -20,6 +19,7 @@ describe('zones', function () {
20
19
  console.log('result', result)
21
20
  }, 4000000)
22
21
 
22
+ // eslint-disable-next-line no-undef
23
23
  it('works with afriquia', async () => {
24
24
  const report = await getReports('moviflotte@gmail.com', 'moviflotte@gmail.com')
25
25
  const userData = await report.getUserData()
package/src/util/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const { devicesToProcess } = require('./device')
2
- const { isClientSide } = require('./utils')
3
2
 
4
3
  exports.processServerSide = (userData) => {
5
4
  const devices = devicesToProcess(userData)
6
- return devices.length > 100 && isClientSide()
5
+ return devices.length > 100 && !userData.reportServer
7
6
  }