keycloak-uncached

Details

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 5989f7d..ab50fb7 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 5bba036..4716d7f 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 @@
             <div class="form-group clearfix">
                 <label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}} <span class="required">*</span></label>
                 <div class="col-sm-6">
-                     <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." />
-                    <p/>
-                    <table class="table table-striped table-bordered" id="selected-policies">
+                    <table class="table table-striped table-bordered" style="margin-top: 0px" id="selected-policies">
                         <thead>
                         <tr>
-                            <th class="kc-table-actions" colspan="3">
-                                <div class="form-inline">
-                                    <div class="form-group">
-                                    </div>
-                                    <div class="pull-right">
-                                        <select id="create-policy" class="form-control" ng-model="policyType"
-                                                ng-options="p.name for p in policyProviders track by p.type"
-                                                data-ng-change="addPolicy(policyType);">
-                                            <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
-                                        </select>
+                            <th class="kc-table-actions" colspan="2">
+                                <div class="form-inline col-md-12" style="width: 107%">
+                                    <div class="form-group" style="width: 100%">
+                                        <div class="input-group" style="width: 100%">
+                                            <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..."/>
+                                        </div>
                                     </div>
                                 </div>
                             </th>
+                            <th class="kc-table-actions">
+                                <div class="pull-right" style="width: 100%">
+                                    <select id="create-policy" class="form-control" ng-model="policyType"
+                                            ng-options="p.name for p in policyProviders track by p.type"
+                                            data-ng-change="addPolicy(policyType);"
+                                            data-ng-hide="historyBackOnSaveOrCancel">
+                                        <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
+                                    </select>
+                                </div>
+                            </th>
                         </tr>
                         <tr data-ng-hide="!selectedPolicies || selectedPolicies.length == 0">
                             <th>{{:: 'name' | translate}}</th>
                             <th>{{:: 'description' | translate}}</th>
-                            <th>{{:: 'actions' | translate}}</th>
+                            <th width="20%">{{:: 'actions' | translate}}</th>
                         </tr>
                         </thead>
                         <tbody>
@@ -85,7 +89,7 @@
                             <td data-ng-hide="historyBackOnSaveOrCancel"><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
                             <td data-ng-show="historyBackOnSaveOrCancel">{{policy.name}}</td>
                             <td>{{policy.description}}</td>
-                            <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);">
+                            <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);" style="vertical-align: middle">
                                 {{:: 'remove' | translate}}
                             </td>
                         </tr>
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 37e8904..a7c5f3d 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 @@
             <div class="form-group clearfix">
                 <label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}} <span class="required">*</span></label>
                 <div class="col-sm-6">
-                    <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." />
-                    <p/>
-                    <table class="table table-striped table-bordered" id="selected-policies">
+                    <table class="table table-striped table-bordered" style="margin-top: 0px" id="selected-policies">
                         <thead>
                         <tr>
-                            <th class="kc-table-actions" colspan="3">
-                                <div class="form-inline">
-                                    <div class="form-group">
-                                    </div>
-                                    <div class="pull-right">
-                                        <select id="create-policy" class="form-control" ng-model="policyType"
-                                                ng-options="p.name for p in policyProviders track by p.type"
-                                                data-ng-change="addPolicy(policyType);">
-                                            <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
-                                        </select>
+                            <th class="kc-table-actions" colspan="2">
+                                <div class="form-inline col-md-12" style="width: 107%">
+                                    <div class="form-group" style="width: 100%">
+                                        <div class="input-group" style="width: 100%">
+                                            <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..."/>
+                                        </div>
                                     </div>
                                 </div>
                             </th>
+                            <th class="kc-table-actions">
+                                <div class="pull-right" style="width: 100%">
+                                    <select id="create-policy" class="form-control" ng-model="policyType"
+                                            ng-options="p.name for p in policyProviders track by p.type"
+                                            data-ng-change="addPolicy(policyType);"
+                                            data-ng-hide="historyBackOnSaveOrCancel">
+                                        <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
+                                    </select>
+                                </div>
+                            </th>
                         </tr>
                         <tr data-ng-hide="!selectedPolicies || selectedPolicies.length == 0">
                             <th>{{:: 'name' | translate}}</th>
                             <th>{{:: 'description' | translate}}</th>
-                            <th>{{:: 'actions' | translate}}</th>
+                            <th width="20%">{{:: 'actions' | translate}}</th>
                         </tr>
                         </thead>
                         <tbody>
@@ -89,7 +93,7 @@
                             <td data-ng-hide="historyBackOnSaveOrCancel"><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
                             <td data-ng-show="historyBackOnSaveOrCancel">{{policy.name}}</td>
                             <td>{{policy.description}}</td>
-                            <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);">
+                            <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);" style="vertical-align: middle">
                                 {{:: 'remove' | translate}}
                             </td>
                         </tr>
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 acaa7a2..25be65b 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 @@
             <div class="form-group clearfix">
                 <label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}} <span class="required">*</span></label>
                 <div class="col-sm-6">
-                    <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." data-ng-required="!selectedPolicies || selectedPolicies.length == 0"/>
-                    <p/>
-                    <table class="table table-striped table-bordered" id="selected-policies">
+                    <table class="table table-striped table-bordered" style="margin-top: 0px" id="selected-policies">
                         <thead>
                             <tr>
-                                <th class="kc-table-actions" colspan="3">
-                                    <div class="form-inline">
-                                        <div class="form-group">
-                                        </div>
-                                        <div class="pull-right">
-                                            <select id="create-policy" class="form-control" ng-model="policyType"
-                                                    ng-options="p.name for p in policyProviders track by p.type"
-                                                    data-ng-change="addPolicy(policyType);"
-                                                    data-ng-hide="historyBackOnSaveOrCancel">
-                                                <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
-                                            </select>
+                                <th class="kc-table-actions" colspan="2">
+                                    <div class="form-inline col-md-12" style="width: 107%">
+                                        <div class="form-group" style="width: 100%">
+                                            <div class="input-group" style="width: 100%">
+                                                <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." data-ng-required="!selectedPolicies || selectedPolicies.length == 0"/>
+                                            </div>
                                         </div>
                                     </div>
                                 </th>
+                                <th class="kc-table-actions">
+                                    <div class="pull-right" style="width: 100%">
+                                        <select id="create-policy" class="form-control" ng-model="policyType"
+                                                ng-options="p.name for p in policyProviders track by p.type"
+                                                data-ng-change="addPolicy(policyType);"
+                                                data-ng-hide="historyBackOnSaveOrCancel">
+                                            <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
+                                        </select>
+                                    </div>
+                                </th>
                             </tr>
                             <tr data-ng-hide="!selectedPolicies || selectedPolicies.length == 0">
                                 <th>{{:: 'name' | translate}}</th>
                                 <th>{{:: 'description' | translate}}</th>
-                                <th>{{:: 'actions' | translate}}</th>
+                                <th width="20%">{{:: 'actions' | translate}}</th>
                             </tr>
                         </thead>
                         <tbody>
@@ -66,7 +69,7 @@
                                 <td data-ng-hide="historyBackOnSaveOrCancel"><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
                                 <td data-ng-show="historyBackOnSaveOrCancel">{{policy.name}}</td>
                                 <td>{{policy.description}}</td>
-                                <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);">
+                                <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);" style="vertical-align: middle">
                                     {{:: 'remove' | translate}}
                                 </td>
                             </tr>