diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js index cbe254a1a4..9147e17d5b 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js @@ -183,8 +183,6 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $ht module.controller('UserListCtrl', function($scope, realm, User) { $scope.realm = realm; - $scope.users = []; - //$scope.search = "Search..."; $scope.searchQuery = function() { console.log('search: ' + $scope.search); @@ -253,9 +251,15 @@ module.controller('UserDetailCtrl', function($scope, realm, user, User, $locatio }; }); -module.controller('RoleListCtrl', function($scope, realm, roles) { +module.controller('RoleListCtrl', function($scope, $location, realm, roles) { $scope.realm = realm; $scope.roles = roles; + + $scope.$watch(function() { + return $location.path(); + }, function() { + $scope.path = $location.path().substring(1).split("/"); + }); }); module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $location, Dialog, Notifications) { @@ -265,6 +269,12 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $locatio $scope.changed = $scope.create; + $scope.$watch(function() { + return $location.path(); + }, function() { + $scope.path = $location.path().substring(1).split("/"); + }); + $scope.$watch('role', function() { if (!angular.equals($scope.role, role)) { $scope.changed = true; @@ -272,34 +282,28 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $locatio }, true); $scope.save = function() { - if ($scope.roleForm.$valid) { + if ($scope.create) { + Role.save({ + realm: realm.id + }, $scope.role, function (data, headers) { + $scope.changed = false; + role = angular.copy($scope.role); - if ($scope.create) { - Role.save({ - realm: realm.id - }, $scope.role, function (data, headers) { - $scope.changed = false; - role = angular.copy($scope.role); + var l = headers().location; + var id = l.substring(l.lastIndexOf("/") + 1); + $location.url("/realms/" + realm.id + "/roles/" + id); + Notifications.success("Created role"); - var l = headers().location; - var id = l.substring(l.lastIndexOf("/") + 1); - $location.url("/realms/" + realm.id + "/roles/" + id); - Notifications.success("Created role"); - - }); - } else { - Role.update({ - realm : realm.id, - roleId : role.id - }, $scope.role, function() { - $scope.changed = false; - role = angular.copy($scope.role); - Notifications.success("Saved changes to role"); - }); - } - - } else { - $scope.roleForm.showErrors = true; + }); + } else { + Role.update({ + realm : realm.id, + roleId : role.id + }, $scope.role, function() { + $scope.changed = false; + role = angular.copy($scope.role); + Notifications.success("Saved changes to role"); + }); } }; diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-detail.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-detail.html index ddf08bc63e..8bd656f9ba 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-detail.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-detail.html @@ -2,16 +2,24 @@
-
+ +

New Application

Application {{application.name}}

diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-list.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-list.html index 4128751ace..174f65d544 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-list.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/application-list.html @@ -2,18 +2,19 @@
-
+

Applications

- + + - + - +
Table of realm applicationsTable of realm applicationsNo configured applications...
@@ -30,7 +31,7 @@
Base URL
diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html index b997e5dc4a..cd3d0ba18b 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html @@ -4,9 +4,9 @@
diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html index cee7ac9ccb..73f0ae592c 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html @@ -1,5 +1,5 @@
    -
  • Realm Settings
  • +
  • Realm Settings
  • Users
  • Applications
  • diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-detail.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-detail.html index 0c68075d40..0aeae23552 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-detail.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-detail.html @@ -1,60 +1,59 @@
    - -
    - -
    -

    New Role

    - -

    - Realm Role {{role.name}} -

    - -
    Please fill in - all required fields +
    +
    + -

    * Required fields

    +
    +

    New Realm Role

    +

    Realm Role {{role.name}}

    +

    * Required fields

    +
    +
    + Details +
    + * - -
    - Details -
    - - -
    - +
    + +
    +
    + + +
    + +
    +
    +
    +
    + +
    -
    - - -
    - -
    +
    + + +
    -
    -
    - - -
    -
    - - - -
    - -
    + +
    diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-list.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-list.html index 7f27c7cf49..a8194521cf 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-list.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/role-list.html @@ -1,26 +1,57 @@
    - -
    - -
    -

    - Realm Roles -

    - - - - - - - - - - - - -
    NameDescription
    {{role.name}}{{role.description}}
    +
    +
    + +
    +

    Realm Roles

    + + + + + + + + + + + + + + + + + + + + + + + +
    Table of realm rolesNo configured realm roles...
    +
    + + +
    +
    Role NameDescription
    + +
    {{role.name}}{{role.description}}
    +
    -
    \ No newline at end of file +
    diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-detail.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-detail.html index 0a5f7b27e3..655c7f70e4 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-detail.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-detail.html @@ -4,12 +4,16 @@
      +
    • New User
    • +
    • Query Users
    • Attributes
    • Credentials
    • Role Mappings
    • diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-list.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-list.html index 3e1e104288..d87de2ec2a 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-list.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/user-list.html @@ -4,14 +4,14 @@

      Query Users

      - + - + @@ -34,7 +34,7 @@ - + - - - + + +
      Table of realm usersTable of realm users
      @@ -26,7 +26,7 @@
      Username Last Name First Name
      @@ -49,9 +49,9 @@
      {{user.username}}{{user.lastName{{user.firstName{{user.email{{user.lastName}}{{user.firstName}}{{user.email}}
      diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index 524b9f839f..32bc8543cf 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -65,6 +65,7 @@ public class RealmAdminResource { List roles = new ArrayList(); for (RoleModel roleModel : roleModels) { RoleRepresentation role = new RoleRepresentation(roleModel.getName(), roleModel.getDescription()); + role.setId(roleModel.getId()); roles.add(role); } return roles;