X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-FE-common%2Fclient%2Fapp%2Fviews%2Frole%2FrolefunctionpopupController.js;h=5cfb6c5a74e7262a29f456a12a2c5b4dc766e20d;hb=3f56b9fdb4d2ec891344d6c9048363e1cac587d2;hp=9144bcb16ac539cbf5985e9690a56aec40a79b4c;hpb=21a8761f684745bb300e075c7e98ad897ace9eed;p=portal.git 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 9144bcb1..5cfb6c5a 100644 --- a/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js +++ b/ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js @@ -33,7 +33,7 @@ * * ============LICENSE_END============================================ * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * */ app.controller('rolefunctionpopupController',function($scope, confirmBoxService, message, $http, $modalInstance, RoleService, conf, isEditing) { if (message.availableRoleFunction == null) { @@ -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) { @@ -114,15 +114,21 @@ app.controller('rolefunctionpopupController',function($scope, confirmBoxService, var exists = false, x; for (x in message.availableRoleFunctions) { console.log(message.availableRoleFunctions[x].name); - if (message.availableRoleFunctions[x].name == availableRoleFunction.name) { + if (message.availableRoleFunctions[x].type == availableRoleFunction.type + && message.availableRoleFunctions[x].code == availableRoleFunction.code + && message.availableRoleFunctions[x].action == availableRoleFunction.action + && message.availableRoleFunctions[x].name == availableRoleFunction.name) { confirmBoxService.showInformation("Role Function already exists."); exists = true; availableRoleFunction.name = $scope.tempText; break; } if (!isEditing) { - if (message.availableRoleFunctions[x].code == availableRoleFunction.code) { - confirmBoxService.showInformation("Code already exists. Please create a role function with a different code to proceed."); + if (message.availableRoleFunctions[x].type == availableRoleFunction.type + && message.availableRoleFunctions[x].code == availableRoleFunction.code + && message.availableRoleFunctions[x].action == availableRoleFunction.action + ) { + confirmBoxService.showInformation("Please make sure code, type and action is unique. Please create a role function with a different code or type or action to proceed."); exists = true; availableRoleFunction.name = $scope.tempText; break;