fleetmap-reports 1.0.567 → 1.0.569

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.567",
3
+ "version": "1.0.569",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -173,7 +173,9 @@ async function exportSpeedingReportToPDF (userData, reportData) {
173
173
  })
174
174
  d.alerts.forEach(a => {
175
175
  const temp = [
176
- a.type === 'alarm' ? translations.report['event_' + a.attributes.alarm] : translations.report['event_' + a.type],
176
+ a.type === 'alarm'
177
+ ? translations.report['event_' + a.attributes.alarm] || a.attributes.alarm
178
+ : translations.report['event_' + a.type],
177
179
  getAlertDate(userData.user, a),
178
180
  a.geofenceName || (a.position ? a.position.address : ''),
179
181
  getAlertInfo(userData.drivers, a, d.device, translations)
@@ -239,7 +241,9 @@ function exportSpeedingReportToExcel (userData, reportData) {
239
241
  data = data.concat(d.alerts.map(a => {
240
242
  return {
241
243
  name: d.device.name,
242
- eventType: a.type === 'alarm' ? translations.report['event_' + a.attributes.alarm] : translations.report['event_' + a.type],
244
+ eventType: a.type === 'alarm'
245
+ ? translations.report['event_' + a.attributes.alarm] || a.attributes.alarm
246
+ : translations.report['event_' + a.type],
243
247
  fixTime: getAlertDate(userData.user, a),
244
248
  address: a.geofenceName || (a.position ? a.position.address : ''),
245
249
  info: getAlertInfo(userData.drivers, a, d.device, translations),
@@ -270,7 +274,6 @@ function deviceName (device) {
270
274
  }
271
275
 
272
276
  function getAlertInfo (drivers, alert, device, translations) {
273
- console.log('getAlertInfo', drivers, alert, device, translations)
274
277
  if (alert.type === 'alarm' && alert.position) {
275
278
  return getDigitalPortValue(alert.position, 1, translations, device.attributes)
276
279
  }
@@ -314,7 +314,6 @@ function getDigitalPort2Label (row, translations) {
314
314
  }
315
315
 
316
316
  function getDigitalPortValue (row, index, translations, dAttributes) {
317
- console.log('getDigitalPortValue', row, index, translations, dAttributes)
318
317
  switch (index) {
319
318
  case 1:
320
319
  if (row.attributes && row.attributes.door1 !== undefined) {