diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 25bf1e39fe..f26a8edb31 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -1615,6 +1615,15 @@ module.directive('kcTabsIdentityProvider', function () { } }); +module.directive('kcTabsUserFederation', function () { + return { + scope: true, + restrict: 'E', + replace: true, + templateUrl: resourceUrl + '/templates/kc-tabs-user-federation.html' + } +}); + module.controller('RoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) { console.log('realm: ' + realm.realm); $scope.selectedRealmRole = { 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 e885f7ee8c..b55fe2dd10 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 @@ -520,11 +520,27 @@ module.controller('UserFederationCtrl', function($scope, $location, realm, UserF }); +module.controller('UserFederationTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { + $scope.removeUserFederation = function() { + Dialog.confirm('Delete', 'Are you sure you want to permanently delete this provider? All imported users will also be deleted.', function() { + $scope.instance.$remove({ + realm : Current.realm.realm, + instance : $scope.instance.id + }, function() { + $location.url("/realms/" + Current.realm.realm + "/user-federation"); + Notifications.success("The provider has been deleted."); + }); + }); + }; +}); + + module.controller('GenericUserFederationCtrl', function($scope, $location, Notifications, $route, Dialog, realm, instance, providerFactory, UserFederationInstances, UserFederationSync) { console.log('GenericUserFederationCtrl'); $scope.create = !instance.providerName; $scope.providerFactory = providerFactory; + $scope.provider = instance; console.log("providerFactory: " + providerFactory.id); @@ -620,18 +636,6 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif } }; - $scope.remove = function() { - Dialog.confirm('Delete', 'Are you sure you want to permanently delete this provider? All imported users will also be deleted.', function() { - $scope.instance.$remove({ - realm : realm.realm, - instance : $scope.instance.id - }, function() { - $location.url("/realms/" + realm.realm + "/user-federation"); - Notifications.success("The provider has been deleted."); - }); - }); - }; - $scope.triggerFullSync = function() { console.log('GenericCtrl: triggerFullSync'); triggerSync('triggerFullSync'); @@ -882,6 +886,7 @@ module.controller('UserFederationMapperListCtrl', function($scope, $location, No $scope.realm = realm; $scope.provider = provider; + $scope.instance = provider; $scope.mapperTypes = mapperTypes; $scope.mappers = mappers; diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-generic.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-generic.html index 002c965acf..a8d72a4fff 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-generic.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/federated-generic.html @@ -5,14 +5,7 @@