feat(GUI): add analytics image / drive info on flash done / error events (#1255)

Change-Type: patch
This commit is contained in:
Ștefan Daniel Mihăilă 2017-04-06 19:39:49 +01:00 committed by Juan Cruz Viotti
parent 76aa05f320
commit 7fe503c89a

View File

@ -72,7 +72,10 @@ module.exports = function(
} }
OSNotificationService.send('Success!', messages.info.flashComplete()); OSNotificationService.send('Success!', messages.info.flashComplete());
AnalyticsService.logEvent('Done'); AnalyticsService.logEvent('Done', {
image,
drive
});
$state.go('success'); $state.go('success');
}) })
.catch((error) => { .catch((error) => {
@ -80,15 +83,23 @@ module.exports = function(
if (error.code === 'EVALIDATION') { if (error.code === 'EVALIDATION') {
FlashErrorModalService.show(messages.error.validation()); FlashErrorModalService.show(messages.error.validation());
AnalyticsService.logEvent('Validation error'); AnalyticsService.logEvent('Validation error', {
image,
drive
});
} else if (error.code === 'ENOSPC') { } else if (error.code === 'ENOSPC') {
FlashErrorModalService.show(messages.error.notEnoughSpaceInDrive()); FlashErrorModalService.show(messages.error.notEnoughSpaceInDrive());
AnalyticsService.logEvent('Out of space'); AnalyticsService.logEvent('Out of space', {
image,
drive
});
} else { } else {
FlashErrorModalService.show(messages.error.genericFlashError()); FlashErrorModalService.show(messages.error.genericFlashError());
ErrorService.reportException(error); ErrorService.reportException(error);
AnalyticsService.logEvent('Flash error', { AnalyticsService.logEvent('Flash error', {
error error,
image,
drive
}); });
} }