From 3846cfdb4fa7e84e64cfcdf4edf4d95926ac66cd Mon Sep 17 00:00:00 2001 From: pedroigor Date: Tue, 19 Dec 2017 17:28:46 -0200 Subject: [PATCH] [KEYCLOAK-5806] - Changing apply policy component and more tests --- .../resources/js/authz/authz-controller.js | 12 ++++--- ...esource-server-policy-resource-detail.html | 34 ++++++++++-------- .../resource-server-policy-scope-detail.html | 34 ++++++++++-------- ...source-server-policy-aggregate-detail.html | 35 ++++++++++--------- 4 files changed, 65 insertions(+), 50 deletions(-) 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 5989f7d818..ab50fb70b5 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 @@ -1309,8 +1309,10 @@ module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route var policies = []; - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); + if ($scope.selectedPolicies) { + for (i = 0; i < $scope.selectedPolicies.length; i++) { + policies.push($scope.selectedPolicies[i].id); + } } $scope.policy.policies = policies; @@ -1355,8 +1357,10 @@ module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route var policies = []; - for (i = 0; i < $scope.selectedPolicies.length; i++) { - policies.push($scope.selectedPolicies[i].id); + if ($scope.selectedPolicies) { + for (i = 0; i < $scope.selectedPolicies.length; i++) { + policies.push($scope.selectedPolicies[i].id); + } } $scope.policy.policies = policies; diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html index 5bba03660c..4716d7fcbc 100644 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html @@ -55,29 +55,33 @@
- -

- +
- + - + @@ -85,7 +89,7 @@ - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html index 37e89045df..a7c5f3da1d 100644 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html @@ -59,29 +59,33 @@
- -

-

-
-
-
-
- +
+
+
+
+ +
+
+ +
+
{{:: 'name' | translate}} {{:: 'description' | translate}}{{:: 'actions' | translate}}{{:: 'actions' | translate}}
{{policy.name}} {{policy.name}} {{policy.description}} + {{:: 'remove' | translate}}
+
- + - + @@ -89,7 +93,7 @@ - diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html index acaa7a28e6..25be65b18d 100644 --- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html @@ -35,30 +35,33 @@
- -

-

-
-
-
-
- +
+
+
+
+ +
+
+ +
+
{{:: 'name' | translate}} {{:: 'description' | translate}}{{:: 'actions' | translate}}{{:: 'actions' | translate}}
{{policy.name}} {{policy.name}} {{policy.description}} + {{:: 'remove' | translate}}
+
- + - + @@ -66,7 +69,7 @@ -
-
-
-
-
- +
+
+
+
+ +
+
+ +
+
{{:: 'name' | translate}} {{:: 'description' | translate}}{{:: 'actions' | translate}}{{:: 'actions' | translate}}
{{policy.name}} {{policy.name}} {{policy.description}} + {{:: 'remove' | translate}}