Commit 44f1a288 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch...

Merge branch '334874-convert-table-in-admin-applications-and-admin-deploy-keys-table-to-pajamas-css' into 'master'

Update admin deploy keys table to comply with Pajamas design system

See merge request gitlab-org/gitlab!73860
parents 36923f1a 62bdd95d
.deploy-keys-list {
width: 100%;
overflow: auto;
table {
border: 1px solid $table-border-color;
}
}
.deploy-keys-title { .deploy-keys-title {
padding-bottom: 2px; padding-bottom: 2px;
line-height: 2; line-height: 2;
......
...@@ -7,31 +7,38 @@ ...@@ -7,31 +7,38 @@
%h3.page-title.deploy-keys-title %h3.page-title.deploy-keys-title
= _('Public deploy keys (%{deploy_keys_count})') % { deploy_keys_count: @deploy_keys.load.size } = _('Public deploy keys (%{deploy_keys_count})') % { deploy_keys_count: @deploy_keys.load.size }
= link_to _('New deploy key'), new_admin_deploy_key_path, class: 'float-right btn gl-button btn-confirm btn-md gl-button' = link_to _('New deploy key'), new_admin_deploy_key_path, class: 'float-right btn gl-button btn-confirm btn-md gl-button'
.table-holder.deploy-keys-list %table.table.b-table.gl-table.b-table-stacked-lg{ data: { testid: 'deploy-keys-list' } }
%table.table %thead
%thead %tr
%th= _('Title')
%th= _('Fingerprint')
%th= _('Projects with write access')
%th= _('Created')
%th.gl-lg-w-1px.gl-white-space-nowrap
%span.gl-sr-only
= _('Actions')
%tbody
- @deploy_keys.each do |deploy_key|
%tr %tr
%th.col-sm-2= _('Title') %td{ data: { label: _('Title') } }
%th.col-sm-4= _('Fingerprint') %div
%th.col-sm-2= _('Projects with write access') = deploy_key.title
%th.col-sm-2= _('Added at') %td{ data: { label: _('Fingerprint') } }
%th.col-sm-2 %div
%tbody %code= deploy_key.fingerprint
- @deploy_keys.each do |deploy_key| %td{ data: { label: _('Projects with write access') } }
%tr %div
%td
%strong= deploy_key.title
%td
%code.key-fingerprint= deploy_key.fingerprint
%td
- deploy_key.projects_with_write_access.each do |project| - deploy_key.projects_with_write_access.each do |project|
= link_to project.full_name, admin_project_path(project), class: 'label deploy-project-label' = link_to project.full_name, admin_project_path(project), class: 'gl-display-block'
%td %td{ data: { label: _('Created') } }
%span.cgray %div
= _('added %{created_at_timeago}').html_safe % { created_at_timeago: time_ago_with_tooltip(deploy_key.created_at) } = time_ago_with_tooltip(deploy_key.created_at)
%td %td.gl-lg-w-1px.gl-white-space-nowrap{ data: { label: _('Actions') } }
.float-right %div
= link_to _('Edit'), edit_admin_deploy_key_path(deploy_key), class: 'btn gl-button btn-sm' = link_to edit_admin_deploy_key_path(deploy_key), class: 'btn btn-default btn-md gl-button btn-icon gl-mr-3', aria: { label: _('Edit deploy key') } do
= link_to _('Remove'), admin_deploy_key_path(deploy_key), data: { confirm: _('Are you sure?') }, method: :delete, class: 'gl-button btn btn-sm btn-danger delete-key' = sprite_icon('pencil', css_class: 'gl-button-icon')
= link_to admin_deploy_key_path(deploy_key), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn btn-danger btn-md gl-button btn-icon', aria: { label: _('Remove deploy key') } do
= sprite_icon('remove', css_class: 'gl-button-icon')
- else - else
= render 'shared/empty_states/deploy_keys' = render 'shared/empty_states/deploy_keys'
...@@ -2166,9 +2166,6 @@ msgstr "" ...@@ -2166,9 +2166,6 @@ msgstr ""
msgid "Added an issue to an epic." msgid "Added an issue to an epic."
msgstr "" msgstr ""
msgid "Added at"
msgstr ""
msgid "Added for this merge request" msgid "Added for this merge request"
msgstr "" msgstr ""
...@@ -12465,6 +12462,9 @@ msgstr "" ...@@ -12465,6 +12462,9 @@ msgstr ""
msgid "Edit deploy freeze" msgid "Edit deploy freeze"
msgstr "" msgstr ""
msgid "Edit deploy key"
msgstr ""
msgid "Edit description" msgid "Edit description"
msgstr "" msgstr ""
...@@ -40173,9 +40173,6 @@ msgstr "" ...@@ -40173,9 +40173,6 @@ msgstr ""
msgid "added" msgid "added"
msgstr "" msgstr ""
msgid "added %{created_at_timeago}"
msgstr ""
msgid "added %{emails}" msgid "added %{emails}"
msgstr "" msgstr ""
......
...@@ -17,7 +17,7 @@ RSpec.describe 'admin deploy keys' do ...@@ -17,7 +17,7 @@ RSpec.describe 'admin deploy keys' do
it 'show all public deploy keys' do it 'show all public deploy keys' do
visit admin_deploy_keys_path visit admin_deploy_keys_path
page.within(find('.deploy-keys-list', match: :first)) do page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do
expect(page).to have_content(deploy_key.title) expect(page).to have_content(deploy_key.title)
expect(page).to have_content(another_deploy_key.title) expect(page).to have_content(another_deploy_key.title)
end end
...@@ -28,7 +28,7 @@ RSpec.describe 'admin deploy keys' do ...@@ -28,7 +28,7 @@ RSpec.describe 'admin deploy keys' do
visit admin_deploy_keys_path visit admin_deploy_keys_path
page.within(find('.deploy-keys-list', match: :first)) do page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do
expect(page).to have_content(write_key.project.full_name) expect(page).to have_content(write_key.project.full_name)
end end
end end
...@@ -48,7 +48,7 @@ RSpec.describe 'admin deploy keys' do ...@@ -48,7 +48,7 @@ RSpec.describe 'admin deploy keys' do
expect(current_path).to eq admin_deploy_keys_path expect(current_path).to eq admin_deploy_keys_path
page.within(find('.deploy-keys-list', match: :first)) do page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do
expect(page).to have_content('laptop') expect(page).to have_content('laptop')
end end
end end
...@@ -66,7 +66,7 @@ RSpec.describe 'admin deploy keys' do ...@@ -66,7 +66,7 @@ RSpec.describe 'admin deploy keys' do
expect(current_path).to eq admin_deploy_keys_path expect(current_path).to eq admin_deploy_keys_path
page.within(find('.deploy-keys-list', match: :first)) do page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do
expect(page).to have_content('new-title') expect(page).to have_content('new-title')
end end
end end
...@@ -81,7 +81,7 @@ RSpec.describe 'admin deploy keys' do ...@@ -81,7 +81,7 @@ RSpec.describe 'admin deploy keys' do
find('tr', text: deploy_key.title).click_link('Remove') find('tr', text: deploy_key.title).click_link('Remove')
expect(current_path).to eq admin_deploy_keys_path expect(current_path).to eq admin_deploy_keys_path
page.within(find('.deploy-keys-list', match: :first)) do page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do
expect(page).not_to have_content(deploy_key.title) expect(page).not_to have_content(deploy_key.title)
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