summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/role
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/role')
-rw-r--r--ecomp-portal-FE-common/client/app/views/role/role-controller.js2
-rw-r--r--ecomp-portal-FE-common/client/app/views/role/role-list-controller.js7
-rw-r--r--ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js4
3 files changed, 10 insertions, 3 deletions
diff --git a/ecomp-portal-FE-common/client/app/views/role/role-controller.js b/ecomp-portal-FE-common/client/app/views/role/role-controller.js
index f55d1e0e..7be5118a 100644
--- a/ecomp-portal-FE-common/client/app/views/role/role-controller.js
+++ b/ecomp-portal-FE-common/client/app/views/role/role-controller.js
@@ -114,6 +114,8 @@ app.controller('roleController', function ($scope, $http, confirmBoxService, ngD
}
if (exists) {
confirmBoxService.showInformation( "Role already exists.");
+ } else if($scope.role.name.toLowerCase() == "admin"){
+ confirmBoxService.showInformation( "Role '"+$scope.role.name+"' is not acceptable.");
}
else {
var uuu = conf.api.saveRole + "?role_id="+$stateParams.roleId;
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 6f280313..b4813114 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
@@ -219,11 +219,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 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);
@@ -253,6 +255,7 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS
});
},function(error){
$log.debug('Failed to editRole');
+ $scope.showSpinner = false;
});
}
@@ -260,9 +263,11 @@ app.controller('roleListController', function ($scope,RoleService, applicationsS
// add Role
$scope.addRoleModalPopup = function(appId) {
+ $scope.showSpinner = true;
if(appId){
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);
diff --git a/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js b/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js
index bda90af9..5cfb6c5a 100644
--- a/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js
+++ b/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js
@@ -98,10 +98,10 @@ app.controller('rolefunctionpopupController',function($scope, confirmBoxService,
confirmBoxService.showInformation('Instance can only contain alphanumeric characters, hyphens(-), dots(.), colons(:), forwardSlash(/) , asterisk(*) and underscores(_)').then(isConfirmed => {});
return;
}
- if(/[^a-zA-Z0-9\-\_ \.]/.test(availableRoleFunction.name)){
+/* if(/[^a-zA-Z0-9\-\_ \.]/.test(availableRoleFunction.name)){
confirmBoxService.showInformation('Name can only contain alphanumeric characters, spaces, hyphens(-), dots(.) and underscores(_)').then(isConfirmed => {});
return;
- }
+ }*/
confirmBoxService.confirm(
"You are about to Create the role function "+ availableRoleFunction.name+ ". Do you want to continue?")
.then(function(confirmed) {