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 +3 -3
- package/src/idle-report.js +1 -2
- package/src/tests/idle.test.js +0 -1
- package/src/tests/index.test.js +2 -0
- package/src/tests/zones.test.js +1 -1
- package/src/util/index.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetmap-reports",
|
|
3
|
-
"version": "1.0.
|
|
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": "^
|
|
39
|
-
"webpack": "^5.
|
|
38
|
+
"mocha": "^10.2.0",
|
|
39
|
+
"webpack": "^5.51.0",
|
|
40
40
|
"webpack-cli": "^4.5.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/idle-report.js
CHANGED
|
@@ -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))
|
package/src/tests/idle.test.js
CHANGED
package/src/tests/index.test.js
CHANGED
|
@@ -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()
|
package/src/tests/zones.test.js
CHANGED
|
@@ -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 &&
|
|
5
|
+
return devices.length > 100 && !userData.reportServer
|
|
7
6
|
}
|