Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
feat(Extensions): Added processing of failed commands with growl noti…
Browse files Browse the repository at this point in the history
…fication

Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson committed May 28, 2016
1 parent 2c323b5 commit 10f4537
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/models/extensionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
*
* (c) 2014-2016 Chris Jackson (chris@cd-jackson.com)
*/
angular.module('HABmin.extensionModel', [])
angular.module('HABmin.extensionModel', [
'angular-growl',
'ngLocalize'
])

.service('ExtensionModel', function ($http, $q, UserService, RestService) {
.service('ExtensionModel', function ($http, $q,locale, growl) {
var extensionList = [];
var extensionTypeList = [];
var eventSrc;
Expand All @@ -29,13 +32,19 @@ angular.module('HABmin.extensionModel', [])
case 'ExtensionEvent':
for (var i = 0; i < extensionList.length; i++) {
if (extensionList[i].id == topic[2]) {
extensionList[i].inprogress = false;

if(topic[3] == "installed") {
extensionList[i].installed = true;
growl.error(locale.getString("extensions.InstallOk", {extension: payload[0]}));
}
if(topic[3] == "uninstalled") {
extensionList[i].installed = false;
growl.error(locale.getString("extensions.UninstallOk", {extension: payload[0]}));
}
if(topic[3] == "failed") {
growl.error(locale.getString("extensions.CommandFailed", {message: payload[1]}));
}
extensionList[i].inprogress = false;
break;
}
}
Expand Down

0 comments on commit 10f4537

Please sign in to comment.