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