keycloak-memoizeit
Changes
forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js 11(+6 -5)
forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html 2(+1 -1)
forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-list.html 2(+1 -1)
Details
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js
index 3d80c2b..784f1b8 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/applications.js
@@ -332,10 +332,11 @@ module.controller('ApplicationRoleDetailCtrl', function($scope, realm, applicati
$scope.changed = false;
role = angular.copy($scope.role);
- var l = headers().location;
- var id = l.substring(l.lastIndexOf("/") + 1);
- $location.url("/realms/" + realm.realm + "/applications/" + application.id + "/roles/" + id);
- Notifications.success("The role has been created.");
+ ApplicationRole.get({ realm: realm.realm, application : application.id, role: role.name }, function(role) {
+ var id = role.id;
+ $location.url("/realms/" + realm.realm + "/applications/" + application.id + "/roles/" + id);
+ Notifications.success("The role has been created.");
+ });
});
} else {
$scope.update();
@@ -347,7 +348,7 @@ module.controller('ApplicationRoleDetailCtrl', function($scope, realm, applicati
$scope.role.$remove({
realm : realm.realm,
application : application.id,
- role : $scope.role.name
+ role : $scope.role.id
}, function() {
$location.url("/realms/" + realm.realm + "/applications/" + application.id + "/roles");
Notifications.success("The role has been deleted.");
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
index 780362b..3c06e25 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
@@ -866,10 +866,11 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, roles, applica
$scope.changed = false;
role = angular.copy($scope.role);
- var l = headers().location;
- var id = l.substring(l.lastIndexOf("/") + 1);
- $location.url("/realms/" + realm.realm + "/roles/" + id);
- Notifications.success("The role has been created.");
+ Role.get({ realm: realm.realm, role: role.name }, function(role) {
+ var id = role.id;
+ $location.url("/realms/" + realm.realm + "/roles/" + id);
+ Notifications.success("The role has been created.");
+ });
});
} else {
$scope.update();
@@ -880,7 +881,7 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, roles, applica
Dialog.confirmDelete($scope.role.name, 'role', function () {
$scope.role.$remove({
realm: realm.realm,
- role: $scope.role.name
+ role: $scope.role.id
}, function () {
$location.url("/realms/" + realm.realm + "/roles");
Notifications.success("The role has been deleted.");
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/loaders.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/loaders.js
index 4551615..66f160c 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/loaders.js
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/loaders.js
@@ -137,8 +137,8 @@ module.factory('UserSocialLinksLoader', function(Loader, UserSocialLinks, $route
-module.factory('RoleLoader', function(Loader, Role, $route, $q) {
- return Loader.get(Role, function() {
+module.factory('RoleLoader', function(Loader, RoleById, $route, $q) {
+ return Loader.get(RoleById, function() {
return {
realm : $route.current.params.realm,
role : $route.current.params.role
@@ -154,8 +154,8 @@ module.factory('RoleListLoader', function(Loader, Role, $route, $q) {
});
});
-module.factory('ApplicationRoleLoader', function(Loader, ApplicationRole, $route, $q) {
- return Loader.get(ApplicationRole, function() {
+module.factory('ApplicationRoleLoader', function(Loader, RoleById, $route, $q) {
+ return Loader.get(RoleById, function() {
return {
realm : $route.current.params.realm,
application : $route.current.params.application,
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html
index e0ff6a6..48d290d 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html
@@ -40,7 +40,7 @@
required> -->
</div>
</div>
- <div class="form-group clearfix block">
+ <div class="form-group clearfix block" data-ng-hide="create">
<label class="col-sm-2 control-label" for="compositeSwitch" class="control-label">Composite Roles</label>
<div class="col-sm-4">
<input ng-model="compositeSwitch" name="compositeSwitch" id="compositeSwitch" ng-disabled="compositeSwitchDisabled" onoffswitch />
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-list.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-list.html
index e21b12d..b9b7011 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-list.html
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-list.html
@@ -52,7 +52,7 @@
-->
<tbody>
<tr ng-repeat="role in roles">
- <td><a href="#/realms/{{realm.realm}}/applications/{{application.id}}/roles/{{role.name}}">{{role.name}}</a></td>
+ <td><a href="#/realms/{{realm.realm}}/applications/{{application.id}}/roles/{{role.id}}">{{role.name}}</a></td>
<td>{{role.composite}}</td>
<td>{{role.description}}</td>
</tr>
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html
index 23aaea8..06fa783 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html
@@ -29,7 +29,7 @@
<textarea class="form-control" rows="5" cols="50" id="description" name="description" data-ng-model="role.description"></textarea>
</div>
</div>
- <div class="form-group">
+ <div class="form-group" data-ng-hide="create">
<label class="col-sm-2 control-label" for="compositeSwitch" class="control-label">Composite Roles</label>
<div class="col-sm-4">
<input ng-model="compositeSwitch" name="compositeSwitch" id="compositeSwitch" ng-disabled="compositeSwitchDisabled" onoffswitch />
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-list.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-list.html
index 21cc9ea..74a8670 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-list.html
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-list.html
@@ -46,7 +46,7 @@
-->
<tbody>
<tr ng-repeat="role in roles | filter:{name: searchQuery}">
- <td><a href="#/realms/{{realm.realm}}/roles/{{role.name}}">{{role.name}}</a></td>
+ <td><a href="#/realms/{{realm.realm}}/roles/{{role.id}}">{{role.name}}</a></td>
<td>{{role.composite}}</td>
<td>{{role.description}}</td>
</tr>