Merge pull request #4228 from pedroigor/KEYCLOAK-5054

[KEYCLOAK-5054] - Checking name availability only in cases name is filled
This commit is contained in:
Pedro Igor 2017-06-16 10:30:44 -03:00 committed by GitHub
commit 222541ab5c

View file

@ -367,6 +367,9 @@ module.controller('ResourceServerResourceDetailCtrl', function($scope, $http, $r
}
this.checkNameAvailability = function (onSuccess) {
if (!$scope.resource.name || $scope.resource.name.trim().length == 0) {
return;
}
ResourceServerResource.search({
realm : $route.current.params.realm,
client : client.id,
@ -593,6 +596,9 @@ module.controller('ResourceServerScopeDetailCtrl', function($scope, $http, $rout
}
this.checkNameAvailability = function (onSuccess) {
if (!$scope.scope.name || $scope.scope.name.trim().length == 0) {
return;
}
ResourceServerScope.search({
realm : $route.current.params.realm,
client : client.id,
@ -2060,6 +2066,9 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
this.checkNameAvailability = function (onSuccess) {
if (!$scope.policy.name || $scope.policy.name.trim().length == 0) {
return;
}
ResourceServerPolicy.search({
realm: $route.current.params.realm,
client: client.id,