From 7a1932cab4e57676d4ff010479c7481624afe2f3 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 21 Jul 2015 13:32:00 +0200 Subject: [PATCH] KEYCLOAK-1427 Add remove identity provider button to all identity provider tabs --- .../theme/base/admin/resources/js/app.js | 9 ++++++ .../admin/resources/js/controllers/realm.js | 28 +++++++++++-------- .../partials/identity-provider-mappers.html | 8 +----- .../realm-identity-provider-export.html | 9 +----- .../realm-identity-provider-oidc.html | 4 +-- .../realm-identity-provider-saml.html | 10 +------ .../realm-identity-provider-social.html | 9 +----- .../resources/templates/kc-tabs-client.html | 2 +- .../templates/kc-tabs-identity-provider.html | 13 +++++++++ 9 files changed, 44 insertions(+), 48 deletions(-) create mode 100644 forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-identity-provider.html 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 a500ad5e9b..25bf1e39fe 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 @@ -1606,6 +1606,15 @@ module.directive('kcNavigationUser', function () { } }); +module.directive('kcTabsIdentityProvider', function () { + return { + scope: true, + restrict: 'E', + replace: true, + templateUrl: resourceUrl + '/templates/kc-tabs-identity-provider.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/realm.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 154681d51f..84effdad56 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -595,6 +595,22 @@ module.controller('RealmDefaultRolesCtrl', function ($scope, Realm, realm, clien }); + + +module.controller('IdentityProviderTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { + $scope.removeIdentityProvider = function() { + Dialog.confirmDelete($scope.identityProvider.alias, 'provider', function() { + $scope.identityProvider.$remove({ + realm : Current.realm.realm, + alias : $scope.identityProvider.alias + }, function() { + $location.url("/realms/" + Current.realm.realm + "/identity-provider-settings"); + Notifications.success("The identity provider has been deleted."); + }); + }); + }; +}); + module.controller('RealmIdentityProviderCtrl', function($scope, $filter, $upload, $http, $route, realm, instance, providerFactory, IdentityProvider, serverInfo, $location, Notifications, Dialog) { console.log('RealmIdentityProviderCtrl'); @@ -804,18 +820,6 @@ module.controller('RealmIdentityProviderCtrl', function($scope, $filter, $upload $location.url("/create/identity-provider/" + realm.realm + "/" + provider.id); }; - $scope.remove = function() { - Dialog.confirmDelete($scope.identityProvider.alias, 'provider', function() { - $scope.identityProvider.$remove({ - realm : realm.realm, - alias : $scope.identityProvider.alias - }, function() { - $location.url("/realms/" + realm.realm + "/identity-provider-settings"); - Notifications.success("The client has been deleted."); - }); - }); - }; - $scope.save = function() { if ($scope.newIdentityProvider) { if (!$scope.identityProvider.alias) { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html index 24409e2c06..676a1166e3 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/identity-provider-mappers.html @@ -4,13 +4,7 @@
  • {{identityProvider.alias}}
  • -

    {{identityProvider.alias|capitalize}}

    - - + diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-export.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-export.html index c79b92b917..e811dc9d4b 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-export.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-export.html @@ -4,14 +4,7 @@
  • {{identityProvider.alias}}
  • -

    {{identityProvider.alias|capitalize}}

    -

    Add OpenID Connect Identity Provider

    - - +
    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html index 2fad5c99b9..fbe6a6a888 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/realm-identity-provider-oidc.html @@ -4,9 +4,7 @@
  • {{identityProvider.alias}}
  • -

    {{identityProvider.alias|capitalize}}

    -

    Add OpenID Connect Identity Provider

    +