fleetmap-reports 2.0.154 → 2.0.155
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 +1 -1
- package/src/events-report.js +4 -8
package/package.json
CHANGED
package/src/events-report.js
CHANGED
|
@@ -248,14 +248,10 @@ function getEventType (a, translations, device, userData) {
|
|
|
248
248
|
const result = translations.report['event_' + a.type] || a.type
|
|
249
249
|
try {
|
|
250
250
|
if (userData &&
|
|
251
|
-
userData.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const notification = userData.notifications.find(n => a.attributes.notifications.split(',').includes(n.id.toString()))
|
|
256
|
-
if (notification) {
|
|
257
|
-
return `${result} ${notification.attributes.name}`
|
|
258
|
-
}
|
|
251
|
+
userData.maintenances &&
|
|
252
|
+
a.type === 'maintenance') {
|
|
253
|
+
const maintenance = userData.maintenances.find(m => m.id === a.maintenanceId)
|
|
254
|
+
if (maintenance) { return `${result} ${maintenance.name}` }
|
|
259
255
|
}
|
|
260
256
|
} catch (e) {
|
|
261
257
|
console.error(e)
|