Commit 4e66551a authored by Annabel Dunstone's avatar Annabel Dunstone

Add deploy btn in graph; fix JS to toggle one graph at a time if multiple pipelines

parent 49e7070a
function toggleGraph() {
$('.pipeline-graph, .toggle-pipeline-btn').toggleClass('graph-collapsed');
const indexOfBtn = $('.toggle-pipeline-btn').index($(this));
const $btnText = $('.toggle-pipeline-btn .btn-text');
const graphCollapsed = $('.pipeline-graph').hasClass('graph-collapsed');
$($('.pipeline-graph')[indexOfBtn]).toggleClass('graph-collapsed');
$($('.toggle-pipeline-btn')[indexOfBtn]).toggleClass('graph-collapsed');
const $btnText = $($('.toggle-pipeline-btn .btn-text')[indexOfBtn]);
const graphCollapsed = $($('.pipeline-graph')[indexOfBtn]).hasClass('graph-collapsed');
graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
}
......
......@@ -298,6 +298,10 @@
width: 150px;
margin-bottom: 10px;
&.deployable {
background-color: $gray-light;
}
.build-content {
width: 130px;
white-space: nowrap;
......@@ -315,6 +319,10 @@
margin-right: 5px;
}
.fa {
font-size: 13px;
}
// Connect first build in each stage with right horizontal line
&:first-child {
&::after {
......
......@@ -39,14 +39,14 @@ module CiStatusHelper
when 'running'
'icon_status_running'
when 'play'
'icon_status_warning'
'play'
when 'created'
'icon_status_pending'
else
'icon_status_cancel'
end
custom_icon(icon_name)
status == 'play' ? icon(icon_name + ' fw') : custom_icon(icon_name)
end
def render_commit_status(commit, tooltip_placement: 'auto left')
......
%li.build
%li.build{class: ("deployable" if subject.playable? && can?(current_user, :update_build, @project))}
.build-content
- if subject.playable? && can?(current_user, :update_build, @project)
= link_to play_namespace_project_build_path(subject.project.namespace, subject.project, subject, return_to: request.original_url), method: :post, title: 'Play' do
......@@ -11,4 +11,3 @@
- else
= render_status_with_link('build', subject.status)
= ci_icon_for_status(subject.status)
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