From d4a85d6abc1c9b89085882df88f20b0e6f8c9429 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Wed, 14 Jun 2017 18:10:51 -0300 Subject: [PATCH] [KEYCLOAK-5054] - Checking name availability only in cases name is filled --- .../base/admin/resources/js/authz/authz-controller.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js index 2cce1381b6..6ccdb943a4 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js @@ -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,