From 59f189229c8cb4a1c61e6a9f69cf0a1e9698b0b4 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 21 Jul 2015 12:43:50 +0200 Subject: [PATCH] KEYCLOAK-1427 Add remove client button to all client tabs --- .../admin/resources/js/controllers/clients.js | 28 ++++---- .../resources/partials/client-clustering.html | 2 - .../partials/client-credentials.html | 2 - .../resources/partials/client-detail.html | 4 -- .../partials/client-installation.html | 2 - .../admin/resources/partials/client-keys.html | 2 - .../resources/partials/client-mappers.html | 2 - .../resources/partials/client-revocation.html | 2 - .../resources/partials/client-role-list.html | 2 - .../partials/client-scope-mappings.html | 2 - .../resources/partials/client-sessions.html | 2 - .../resources/templates/kc-tabs-client.html | 66 +++++++++++-------- 12 files changed, 51 insertions(+), 65 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index 13167668e2..13639198b2 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -4,6 +4,20 @@ Array.prototype.remove = function(from, to) { return this.push.apply(this, rest); }; +module.controller('ClientTabCtrl', function(Dialog, $scope, Current, Notifications, $location) { + $scope.removeClient = function() { + Dialog.confirmDelete($scope.client.clientId, 'client', function() { + $scope.client.$remove({ + realm : Current.realm.realm, + client : $scope.client.id + }, function() { + $location.url("/realms/" + Current.realm.realm + "/clients"); + Notifications.success("The client has been deleted."); + }); + }); + }; +}); + module.controller('ClientRoleListCtrl', function($scope, $location, realm, client, roles) { $scope.realm = realm; $scope.roles = roles; @@ -834,20 +848,6 @@ module.controller('ClientDetailCtrl', function($scope, realm, client, $route, se $scope.cancel = function() { $location.url("/realms/" + realm.realm + "/clients"); }; - - $scope.remove = function() { - Dialog.confirmDelete($scope.client.clientId, 'client', function() { - $scope.client.$remove({ - realm : realm.realm, - client : $scope.client.id - }, function() { - $location.url("/realms/" + realm.realm + "/clients"); - Notifications.success("The client has been deleted."); - }); - }); - }; - - }); module.controller('ClientScopeMappingCtrl', function($scope, $http, realm, client, clients, Notifications, diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html index 2fa5e24e6f..0a734d5408 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-clustering.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    -
    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html index 540dddb2a4..b58af1e866 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html index d8ea26567f..9cf66f00f6 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html @@ -6,10 +6,6 @@
  • {{client.clientId}}
  • -

    Add Client

    -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html index e6886f0a22..375343a8f5 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-installation.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html index f1a0803f4d..bd1faa37cc 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-keys.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html index b62902d77f..88be5e1868 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-mappers.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html index 962b802904..6a0c639743 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-revocation.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html index e6e7f2c53e..bf4f06201f 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    -
    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html index b5a26271c8..6f68ed81d4 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    -

    {{client.clientId}} Scope Mappings

    diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html index 846cd92326..9c1dc586b3 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-sessions.html @@ -5,8 +5,6 @@
  • {{client.clientId}}
  • -

    {{client.clientId|capitalize}}

    - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html index e350e5d090..8af84972eb 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-client.html @@ -1,33 +1,41 @@ - + \ No newline at end of file