diff options
author | hb123f <hbindu@research.att.com> | 2019-03-20 12:20:44 -0400 |
---|---|---|
committer | hb123f <hbindu@research.att.com> | 2019-03-20 14:13:55 -0400 |
commit | a70761c096192e38800bf38d6c7f61f52bf72007 (patch) | |
tree | cdc5264cec030bc7e677ff1d74c939c56ee51d0d /ecomp-portal-FE-common/client/app/views/role | |
parent | 3992004ee5f2b0b1635e2aef19c375db87079b52 (diff) |
CADI AAF Integration and merging the code
Issue-ID: PORTAL-319
CADI AAF Integration and code merge
Change-Id: I6e44f3b2741858d8d403b77a49ec9a0153084801
Signed-off-by: hb123f <hbindu@research.att.com>
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/role')
-rw-r--r-- | ecomp-portal-FE-common/client/app/views/role/bulk-upload-dialogs/bulk-upload-role-functions-controller.js | 13 | ||||
-rw-r--r-- | ecomp-portal-FE-common/client/app/views/role/role-list-controller.js | 12 |
2 files changed, 18 insertions, 7 deletions
diff --git a/ecomp-portal-FE-common/client/app/views/role/bulk-upload-dialogs/bulk-upload-role-functions-controller.js b/ecomp-portal-FE-common/client/app/views/role/bulk-upload-dialogs/bulk-upload-role-functions-controller.js index 722c634d..13036476 100644 --- a/ecomp-portal-FE-common/client/app/views/role/bulk-upload-dialogs/bulk-upload-role-functions-controller.js +++ b/ecomp-portal-FE-common/client/app/views/role/bulk-upload-dialogs/bulk-upload-role-functions-controller.js @@ -107,8 +107,17 @@ // Caches the file name supplied by the event handler. $scope.fileChangeHandler = (event, files) => { - this.fileSelected = true; - this.fileToRead = files[0]; + var fileName = files[0].name; + var validFormats = ['csv', 'txt']; + //Get file extension + var ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase(); + //Check for valid format + if(validFormats.indexOf(ext) == -1){ + this.fileSelected = false; + }else{ + this.fileSelected = true; + this.fileToRead = files[0]; + } if (debug) $log.debug("BulkRoleAndFunctionsModalCtrl::fileChangeHandler: file is ", this.fileToRead); }; // file change handler 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..6f280313 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 @@ -170,14 +170,16 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS $scope.syncRolesFromExternalAuthSystem = function(appId){ applicationsService.syncRolesEcompFromExtAuthSystem(appId).then(function(res){ - if(res.status == 200){ + if(res.data != null || res.data.status != null || res.data.status == 'OK'){ confirmBoxService.showInformation('Sync operation completed successfully!').then(isConfirmed => { $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); + }); }; @@ -218,7 +220,7 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS // edit Role $scope.editRoleModalPopup = function(appId, availableRole) { 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){ @@ -259,7 +261,7 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS // add Role $scope.addRoleModalPopup = function(appId) { if(appId){ - var roleId = 0; + var roleId = -1; RoleService.getRole(appId, roleId).then(function(data){ var response = JSON.parse(data.data); var role = JSON.parse(response.role); |