fleetmap-reports 1.0.286 → 1.0.287

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.
@@ -1,10 +1,9 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
- <list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="Add idle report">
5
- <change beforePath="$PROJECT_DIR$/lang/enGB.js" beforeDir="false" afterPath="$PROJECT_DIR$/lang/enGB.js" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
4
+ <list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="en translation">
7
5
  <change beforePath="$PROJECT_DIR$/src/index.test.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.test.js" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/src/speeding-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/speeding-report.js" afterDir="false" />
8
7
  </list>
9
8
  <option name="SHOW_DIALOG" value="false" />
10
9
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -236,7 +235,8 @@
236
235
  <workItem from="1641992912450" duration="1734000" />
237
236
  <workItem from="1642001918030" duration="2950000" />
238
237
  <workItem from="1642028703547" duration="9503000" />
239
- <workItem from="1642073677104" duration="1289000" />
238
+ <workItem from="1642073677104" duration="1399000" />
239
+ <workItem from="1642077505676" duration="5779000" />
240
240
  </task>
241
241
  <task id="LOCAL-00001" summary="Fix getStyle">
242
242
  <created>1636983717385</created>
@@ -448,7 +448,14 @@
448
448
  <option name="project" value="LOCAL" />
449
449
  <updated>1642040031237</updated>
450
450
  </task>
451
- <option name="localTasksCounter" value="31" />
451
+ <task id="LOCAL-00031" summary="en translation">
452
+ <created>1642075797776</created>
453
+ <option name="number" value="00031" />
454
+ <option name="presentableId" value="LOCAL-00031" />
455
+ <option name="project" value="LOCAL" />
456
+ <updated>1642075797777</updated>
457
+ </task>
458
+ <option name="localTasksCounter" value="32" />
452
459
  <servers />
453
460
  </component>
454
461
  <component name="TypeScriptGeneratedFilesManager">
@@ -478,7 +485,6 @@
478
485
  <option name="oldMeFiltersMigrated" value="true" />
479
486
  </component>
480
487
  <component name="VcsManagerConfiguration">
481
- <MESSAGE value="Kms report grouped by day" />
482
488
  <MESSAGE value="Fix pdf logo" />
483
489
  <MESSAGE value="kms report with parallel requests" />
484
490
  <MESSAGE value="Kms Report - Calculate distance with traccar trips" />
@@ -503,6 +509,7 @@
503
509
  <MESSAGE value="fix convert date to localeString" />
504
510
  <MESSAGE value="Fix activity and kms report by driver inside a time period" />
505
511
  <MESSAGE value="Add idle report" />
506
- <option name="LAST_COMMIT_MESSAGE" value="Add idle report" />
512
+ <MESSAGE value="en translation" />
513
+ <option name="LAST_COMMIT_MESSAGE" value="en translation" />
507
514
  </component>
508
515
  </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.286",
3
+ "version": "1.0.287",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -237,12 +237,10 @@ async function getCustomSpeedLimitEvents(devices, routes){
237
237
  async function getHereEvents(devices, routes, threshold){
238
238
  console.log('here speed limit events')
239
239
  const events = []
240
- await Promise.all(devices.map(d =>
241
- here.routeMatch(routes.filter(p => p.deviceId === d.id)).then(r => d.results = r)
242
- ))
243
240
  for (const d of devices) {
241
+ const positions = routes.filter(p => p.deviceId === d.id)
244
242
  try {
245
- const results = d.results
243
+ const results = await here.routeMatch(positions)
246
244
  const hereAlerts = results.filter(r => r.currentSpeedKmh > (parseInt(r.speedLimit) + threshold)).map(r => {
247
245
  const position = positions.find(p => new Date(p.fixTime).getTime() === r.timestamp)
248
246
  return {