X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-FE-common%2Fclient%2Fapp%2Fviews%2Frole%2Frole-list-controller.js;h=8765149e6505ff471e7b9dd77c50e493764d7988;hb=ace89e59c9838b666ddd02c08fd5e39a94eee39a;hp=0ae218c4d05eb19f47f2f7130a083605f5b790b1;hpb=47bcf09a62fb260a60b90d4f6c8406d956ab5a8a;p=portal.git diff --git a/ecomp-portal-FE-common/client/app/views/role/role-list-controller.js b/ecomp-portal-FE-common/client/app/views/role/role-list-controller.js index 0ae218c4..8765149e 100644 --- a/ecomp-portal-FE-common/client/app/views/role/role-list-controller.js +++ b/ecomp-portal-FE-common/client/app/views/role/role-list-controller.js @@ -152,11 +152,9 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS $scope.centralizedApps = res; for(var i = 0; i { $scope.getRolesForSelectedCentralizedApp(appId); }); } else{ - confirmBoxService.showInformation('Sync operation failed for '+app).then(isConfirmed => {}); + confirmBoxService.showInformation('Sync operation failed for '+app + res.data.message).then(isConfirmed => {}); } - }); + }).catch(err=> { + confirmBoxService.showInformation("Sync operation failed for: " + err); + }); }; @@ -217,11 +217,13 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS // edit Role $scope.editRoleModalPopup = function(appId, availableRole) { + $scope.showSpinner = true; if(!availableRole.active) - return confirmBoxService.showInformation('Edit is disabled! Please toggle the role to activate it.').then(isConfirmed => {}); + return confirmBoxService.showInformation('Edit is diabled! Please toggle the role to activate it.').then(isConfirmed => {}); $scope.editRole = availableRole; if(appId != undefined && availableRole.id != undefined){ - RoleService.getRole(appId, availableRole.id).then(function(data){ + RoleService.getRole(appId, availableRole.id).then(function(data){ + $scope.showSpinner = false; var response = JSON.parse(data.data); var role = JSON.parse(response.role); var availableRoles = JSON.parse(response.availableRoles); @@ -251,6 +253,7 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS }); },function(error){ $log.debug('Failed to editRole'); + $scope.showSpinner = false; }); } @@ -258,9 +261,11 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS // add Role $scope.addRoleModalPopup = function(appId) { + $scope.showSpinner = true; if(appId){ - var roleId = 0; + var roleId = -1; RoleService.getRole(appId, roleId).then(function(data){ + $scope.showSpinner = false; var response = JSON.parse(data.data); var role = JSON.parse(response.role); var availableRoles = JSON.parse(response.availableRoles);