From 66242b4176a001759b09ab295e742c20ce11701f Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 30 Apr 2015 14:00:44 +0200 Subject: [PATCH] KEYCLOAK-1244 Save button on user federation redirects to user federation list --- .../base/admin/resources/js/controllers/users.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 efc33b8556..29ef06908c 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 @@ -384,7 +384,7 @@ module.controller('UserFederationCtrl', function($scope, $location, realm, UserF }); -module.controller('GenericUserFederationCtrl', function($scope, $location, Notifications, Dialog, realm, instance, providerFactory, UserFederationInstances, UserFederationSync) { +module.controller('GenericUserFederationCtrl', function($scope, $location, Notifications, $route, Dialog, realm, instance, providerFactory, UserFederationInstances, UserFederationSync) { console.log('GenericUserFederationCtrl'); $scope.create = !instance.providerName; @@ -453,9 +453,13 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif $scope.save = function() { $scope.changed = false; if ($scope.create) { - UserFederationInstances.save({realm: realm.realm}, $scope.instance, function () { + UserFederationInstances.save({realm: realm.realm}, $scope.instance, function (data, headers) { $scope.changed = false; - $location.url("/realms/" + realm.realm + "/user-federation"); + + 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 { @@ -463,11 +467,9 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif 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."); }); - } };