Commit 82b46827 authored by Miguel Rincon's avatar Miguel Rincon

Display project runner identifiers consistently

This MR updates the runner identifiers (id and token) in the
project settings view.
parent 4b459f99
%li.runner{ id: dom_id(runner) } %li{ id: dom_id(runner) }
%h4.gl-font-weight-normal .gl-display-flex.gl-justify-content-space-between
= runner_status_icon(runner, size: 16, icon_class: "gl-vertical-align-middle!") %div
= runner_status_icon(runner, size: 16)
- if @project_runners.include?(runner) - if @project_runners.include?(runner)
= link_to _("%{token}...") % { token: runner.short_sha }, project_runner_path(@project, runner), class: 'commit-sha has-tooltip', title: _("Partial token for reference only") = link_to "##{runner.id} (#{runner.short_sha})", project_runner_path(@project, runner)
- else
%span
= "##{runner.id} (#{runner.short_sha})"
- if runner.locked? - if runner.locked?
%span.has-tooltip{ title: _('Locked to current projects') } %span.has-tooltip{ title: _('Locked to current projects') }
= sprite_icon('lock') = sprite_icon('lock')
.gl-ml-2
= link_to edit_project_runner_path(@project, runner), class: 'btn gl-button btn-sm btn-icon', data: { testid: 'edit-runner-link' } do .btn-group.btn-group-sm
= sprite_icon('pencil') - if @project_runners.include?(runner)
= link_to edit_project_runner_path(@project, runner), class: 'btn gl-button btn-icon', title: _('Edit'), aria: { label: _('Edit') }, data: { testid: 'edit-runner-link', toggle: 'tooltip', placement: 'top', container: 'body' } do
- else = sprite_icon('pencil')
%span.commit-sha - if runner.active?
= runner.short_sha = link_to pause_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-icon', title: _('Pause'), aria: { label: _('Pause') }, data: { toggle: 'tooltip', placement: 'top', container: 'body', confirm: _("Are you sure?") } do
= sprite_icon('pause')
.float-right - else
- if @project_runners.include?(runner) = link_to resume_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-icon', title: _('Resume'), aria: { label: _('Resume') }, data: { toggle: 'tooltip', placement: 'top', container: 'body' } do
- if runner.active? = sprite_icon('play')
= link_to _('Pause'), pause_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-sm btn-danger', data: { confirm: _("Are you sure?") } - if runner.belongs_to_one_project?
- else = link_to _('Remove runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger'
= link_to _('Resume'), resume_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-confirm btn-sm' - else
- if runner.belongs_to_one_project? - runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord
= link_to _('Remove runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger btn-sm' = link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger'
- else - elsif runner.project_type?
- runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord = form_for [@project, @project.runner_projects.new] do |f|
= link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger btn-sm' = f.hidden_field :runner_id, value: runner.id
- elsif runner.project_type? = f.submit _('Enable for this project'), class: 'btn gl-button'
= form_for [@project, @project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: runner.id
= f.submit _('Enable for this project'), class: 'btn gl-button btn-sm'
.float-right
%small.light
\##{runner.id}
- if runner.description.present? - if runner.description.present?
%p.runner-description %p.gl-my-2
= runner.description = runner.description
- if runner.tags.present? - if runner.tags.present?
%p .gl-my-2
- runner.tags.map(&:name).sort.each do |tag| - runner.tags.map(&:name).sort.each do |tag|
%span.badge.gl-badge.sm.badge-pill.badge-primary %span.badge.gl-badge.sm.badge-pill.badge-primary
= tag = tag
---
title: Display project settings runners identifiers consistently
merge_request: 59383
author:
type: changed
...@@ -925,9 +925,6 @@ msgstr "" ...@@ -925,9 +925,6 @@ msgstr ""
msgid "%{title} changes" msgid "%{title} changes"
msgstr "" msgstr ""
msgid "%{token}..."
msgstr ""
msgid "%{totalCpu} (%{freeSpacePercentage}%{percentSymbol} free)" msgid "%{totalCpu} (%{freeSpacePercentage}%{percentSymbol} free)"
msgstr "" msgstr ""
...@@ -22772,9 +22769,6 @@ msgstr "" ...@@ -22772,9 +22769,6 @@ msgstr ""
msgid "Part of merge request changes" msgid "Part of merge request changes"
msgstr "" msgstr ""
msgid "Partial token for reference only"
msgstr ""
msgid "Participants" msgid "Participants"
msgstr "" msgstr ""
......
...@@ -49,19 +49,19 @@ RSpec.describe 'Runners' do ...@@ -49,19 +49,19 @@ RSpec.describe 'Runners' do
visit project_runners_path(project) visit project_runners_path(project)
within '.activated-specific-runners' do within '.activated-specific-runners' do
expect(page).to have_content('Pause') expect(page).to have_link('Pause')
end end
click_on 'Pause' click_on 'Pause'
within '.activated-specific-runners' do within '.activated-specific-runners' do
expect(page).to have_content('Resume') expect(page).to have_link('Resume')
end end
click_on 'Resume' click_on 'Resume'
within '.activated-specific-runners' do within '.activated-specific-runners' do
expect(page).to have_content('Pause') expect(page).to have_link('Pause')
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