fleetmap-reports 1.0.613 → 1.0.614

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.613",
3
+ "version": "1.0.614",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -156,7 +156,9 @@ async function exportSpeedingReportToPDF (userData, reportData) {
156
156
  userData.eventTypes.forEach(e => {
157
157
  const data = e.startsWith('alarm') ? { type: 'alarm', attributes: { alarm: e.slice(6) } } : { type: e }
158
158
  const value = e.startsWith('alarm') ? d.alerts.filter(a => a.attributes.alarm === data.attributes.alarm).length : d.alerts.filter(a => a.type === e).length
159
- headerEventTypes.push([getEventType(data, translations, d.device), value])
159
+ if (value > 0) {
160
+ headerEventTypes.push([getEventType(data, translations, d.device), value])
161
+ }
160
162
  })
161
163
 
162
164
  doc.autoTable({
@@ -281,6 +283,9 @@ function deviceName (device) {
281
283
  }
282
284
 
283
285
  function getAlertInfo (drivers, alert, device, translations) {
286
+ if (alert.type === 'alarm' && alert.attributes.alarm === 'sensor') {
287
+ return device ? device.attributes.sensor1on : ''
288
+ }
284
289
  if (alert.type === 'alarm' && alert.position) {
285
290
  return getDigitalPortValue(alert.position, 1, translations, device.attributes)
286
291
  }