keycloak-uncached

KEYCLOAK-1257

5/5/2015 1:33:13 AM

Details

diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js
index 29ef069..bf5662b 100755
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js
@@ -454,8 +454,6 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
         $scope.changed = false;
         if ($scope.create) {
             UserFederationInstances.save({realm: realm.realm}, $scope.instance,  function (data, headers) {
-                $scope.changed = false;
-
                 var l = headers().location;
                 var id = l.substring(l.lastIndexOf("/") + 1);
 
@@ -479,7 +477,11 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
     };
 
     $scope.cancel = function() {
-        $location.url("/realms/" + realm.realm + "/user-federation");
+        if ($scope.create) {
+            $location.url("/realms/" + realm.realm + "/user-federation");
+        } else {
+            $route.reload();
+        }
     };
 
     $scope.remove = function() {
@@ -514,7 +516,7 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
 });
 
 
-module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog, realm, instance, UserFederationInstances, UserFederationSync, RealmLDAPConnectionTester) {
+module.controller('LDAPCtrl', function($scope, $location, $route, Notifications, Dialog, realm, instance, UserFederationInstances, UserFederationSync, RealmLDAPConnectionTester) {
     console.log('LDAPCtrl');
     var DEFAULT_BATCH_SIZE = "1000";
 
@@ -620,9 +622,11 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
         }
 
         if ($scope.create) {
-            UserFederationInstances.save({realm: realm.realm}, $scope.instance,  function () {
-                $scope.changed = false;
-                $location.url("/realms/" + realm.realm + "/user-federation");
+            UserFederationInstances.save({realm: realm.realm}, $scope.instance,  function (data, headers) {
+                var l = headers().location;
+                var id = l.substring(l.lastIndexOf("/") + 1);
+
+                $location.url("/realms/" + realm.realm + "/user-federation/providers/" + $scope.instance.providerName + "/" + id);
                 Notifications.success("The provider has been created.");
             });
         } else {
@@ -630,8 +634,7 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
                                           instance: instance.id
                 },
                 $scope.instance,  function () {
-                $scope.changed = false;
-                $location.url("/realms/" + realm.realm + "/user-federation");
+                $route.reload();
                 Notifications.success("The provider has been updated.");
             });
 
@@ -639,8 +642,7 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
     };
 
     $scope.reset = function() {
-        initFederationSettings();
-        $scope.instance = angular.copy(instance);
+        $route.reload();
     };
 
     $scope.cancel = function() {
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-kerberos.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-kerberos.html
index fa43ef3..2294abb 100644
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-kerberos.html
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-kerberos.html
@@ -93,7 +93,7 @@
 
         <div class="form-group">
             <div class="col-md-10 col-md-offset-2" data-ng-show="create && access.manageUsers">
-                <button kc-save data-ng-show="changed">Save</button>
+                <button kc-save>Save</button>
                 <button kc-cancel data-ng-click="cancel()">Cancel</button>
             </div>
         </div>
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-ldap.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-ldap.html
index babb0f7..64728a3 100755
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-ldap.html
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-ldap.html
@@ -232,7 +232,7 @@
 
         <div class="form-group">
             <div class="col-md-10 col-md-offset-2" data-ng-show="create && access.manageUsers">
-                <button kc-save data-ng-show="changed">Save</button>
+                <button kc-save>Save</button>
                 <button kc-cancel data-ng-click="cancel()">Cancel</button>
             </div>
         </div>