Commit 971e57cf authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-issue-1741' into 'master'

Remove show actions from Admin and Project DeployKeys

Example styling after:

> ![Screen_Shot_2015-06-03_at_6.04.51_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/105801a7e390224066721bba200c4909/Screen_Shot_2015-06-03_at_6.04.51_PM.png)

Closes #1741

See merge request !763
parents 83e59db5 793d9799
...@@ -23,6 +23,13 @@ pre { ...@@ -23,6 +23,13 @@ pre {
font-family: $monospace_font; font-family: $monospace_font;
} }
code {
&.key-fingerprint {
background: $body-bg;
color: $text-color;
}
}
/** /**
* Wiki typography * Wiki typography
* *
......
class Admin::DeployKeysController < Admin::ApplicationController class Admin::DeployKeysController < Admin::ApplicationController
before_action :deploy_keys, only: [:index] before_action :deploy_keys, only: [:index]
before_action :deploy_key, only: [:show, :destroy] before_action :deploy_key, only: [:destroy]
def index def index
end
def show
end end
def new def new
......
...@@ -18,10 +18,6 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -18,10 +18,6 @@ class Projects::DeployKeysController < Projects::ApplicationController
@available_public_keys -= @available_project_keys @available_public_keys -= @available_project_keys
end end
def show
@key = @project.deploy_keys.find(params[:id])
end
def new def new
@key = @project.deploy_keys.new @key = @project.deploy_keys.new
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
= link_to admin_deploy_key_path(deploy_key) do = link_to admin_deploy_key_path(deploy_key) do
%strong= deploy_key.title %strong= deploy_key.title
%td %td
%span %code.key-fingerprint= deploy_key.fingerprint
(#{deploy_key.fingerprint})
%td %td
%span.cgray %span.cgray
added #{time_ago_with_tooltip(deploy_key.created_at)} added #{time_ago_with_tooltip(deploy_key.created_at)}
......
- page_title @deploy_key.title, "Deploy Keys"
.row
.col-md-4
.panel.panel-default
.panel-heading
Deploy Key
%ul.well-list
%li
%span.light Title:
%strong= @deploy_key.title
%li
%span.light Created on:
%strong= @deploy_key.created_at.stamp("Aug 21, 2011")
.panel.panel-default
.panel-heading Projects (#{@deploy_key.deploy_keys_projects.count})
- if @deploy_key.deploy_keys_projects.any?
%ul.well-list
- @deploy_key.projects.each do |project|
%li
%span
%strong
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project]
.pull-right
= link_to disable_namespace_project_deploy_key_path(project.namespace, project, @deploy_key), data: { confirm: "Are you sure?" }, method: :put, class: "btn-xs btn btn-remove", title: 'Remove deploy key from project' do
%i.fa.fa-times.fa-inverse
.col-md-8
%p
%span.light Fingerprint:
%strong= @deploy_key.fingerprint
%pre.well-pre
= @deploy_key.key
.pull-right
= link_to 'Remove', admin_deploy_key_path(@deploy_key), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key"
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
= link_to path_to_key(key, is_admin) do = link_to path_to_key(key, is_admin) do
%strong= key.title %strong= key.title
%td %td
%span %code.key-fingerprint= key.fingerprint
(#{key.fingerprint})
%td %td
%span.cgray %span.cgray
added #{time_ago_with_tooltip(key.created_at)} added #{time_ago_with_tooltip(key.created_at)}
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
.col-md-8 .col-md-8
%p %p
%span.light Fingerprint: %span.light Fingerprint:
%strong= @key.fingerprint %code.key-fingerprint= @key.fingerprint
%pre.well-pre %pre.well-pre
= @key.key = @key.key
.pull-right .pull-right
......
...@@ -2,24 +2,20 @@ ...@@ -2,24 +2,20 @@
.pull-right .pull-right
- if @available_keys.include?(deploy_key) - if @available_keys.include?(deploy_key)
= link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do = link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do
%i.fa.fa-plus = icon('plus')
Enable Enable
- else - else
- if deploy_key.destroyed_when_orphaned? && deploy_key.almost_orphaned? - if deploy_key.destroyed_when_orphaned? && deploy_key.almost_orphaned?
= link_to 'Remove', disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :put, class: "btn btn-remove delete-key btn-sm pull-right" = link_to 'Remove', disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :put, class: "btn btn-remove delete-key btn-sm pull-right"
- else - else
= link_to disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do = link_to disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do
%i.fa.fa-power-off = icon('power-off')
Disable Disable
- if project = project_for_deploy_key(deploy_key) = icon('key')
= link_to namespace_project_deploy_key_path(project.namespace, project, deploy_key) do
%i.fa.fa-key
%strong= deploy_key.title %strong= deploy_key.title
- else %br
%i.fa.fa-key %code.key-fingerprint= deploy_key.fingerprint
%strong= deploy_key.title
%p.light.prepend-top-10 %p.light.prepend-top-10
- if deploy_key.public? - if deploy_key.public?
......
- page_title @key.title, "Deploy Keys"
%h3.page-title
Deploy key:
= @key.title
%small
created on
= @key.created_at.stamp("Aug 21, 2011")
.back-link
= link_to namespace_project_deploy_keys_path(@project.namespace, @project) do
&larr; To keys list
%hr
%pre= @key.key
.pull-right
= link_to 'Remove', namespace_project_deploy_key_path(@project.namespace, @project, @key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn-remove btn delete-key"
...@@ -165,7 +165,7 @@ Gitlab::Application.routes.draw do ...@@ -165,7 +165,7 @@ Gitlab::Application.routes.draw do
end end
end end
resources :deploy_keys, only: [:index, :show, :new, :create, :destroy] resources :deploy_keys, only: [:index, :new, :create, :destroy]
resources :hooks, only: [:index, :create, :destroy] do resources :hooks, only: [:index, :create, :destroy] do
get :test get :test
...@@ -421,7 +421,7 @@ Gitlab::Application.routes.draw do ...@@ -421,7 +421,7 @@ Gitlab::Application.routes.draw do
end end
end end
resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :show, :new, :create] do resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
member do member do
put :enable put :enable
put :disable put :disable
......
...@@ -8,11 +8,6 @@ Feature: Admin Deploy Keys ...@@ -8,11 +8,6 @@ Feature: Admin Deploy Keys
When I visit admin deploy keys page When I visit admin deploy keys page
Then I should see all public deploy keys Then I should see all public deploy keys
Scenario: Deploy Keys show
When I visit admin deploy keys page
And I click on first deploy key
Then I should see deploy key details
Scenario: Deploy Keys new Scenario: Deploy Keys new
When I visit admin deploy keys page When I visit admin deploy keys page
And I click 'New Deploy Key' And I click 'New Deploy Key'
......
...@@ -14,17 +14,6 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps ...@@ -14,17 +14,6 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
end end
end end
step 'I click on first deploy key' do
click_link DeployKey.are_public.first.title
end
step 'I should see deploy key details' do
deploy_key = DeployKey.are_public.first
current_path.should == admin_deploy_key_path(deploy_key)
page.should have_content(deploy_key.title)
page.should have_content(deploy_key.key)
end
step 'I visit admin deploy key page' do step 'I visit admin deploy key page' do
visit admin_deploy_key_path(deploy_key) visit admin_deploy_key_path(deploy_key)
end end
......
...@@ -172,7 +172,7 @@ end ...@@ -172,7 +172,7 @@ end
# DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy # DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy
describe Projects::DeployKeysController, 'routing' do describe Projects::DeployKeysController, 'routing' do
it_behaves_like 'RESTful project resources' do it_behaves_like 'RESTful project resources' do
let(:actions) { [:index, :show, :new, :create] } let(:actions) { [:index, :new, :create] }
let(:controller) { 'deploy_keys' } let(:controller) { 'deploy_keys' }
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment