BigW Consortium Gitlab

Commit fee7992c by Kamil Trzcinski

Fix pipelines visualisation rendering

parent ef767268
......@@ -102,7 +102,7 @@ module Ci
end
def playable?
project.builds_enabled? && commands.present? && manual?
project.builds_enabled? && commands.present? && manual? && skipped?
end
def play(current_user = nil)
......
......@@ -34,6 +34,10 @@ module Ci
CommitStatus.where(pipeline: pluck(:id)).stages
end
def stages
statuses.order(:stage_idx).latest.group_by(&:stage)
end
def project_id
project.id
end
......
.row-content-block.build-content.middle-block.pipeline-graph
.pipeline-visualization
%ul.stage-column-list
- pipeline.statuses.stages.each do |stage|
- statuses = pipeline.statuses.where(stage: stage)
- status = statuses.latest.status
- stages = pipeline.statuses.latest.order(:stage_idx).group_by(&:stage)
- stages.each do |stage, builds|
%li.stage-column
.stage-name
%a{name: stage}
......@@ -11,11 +10,16 @@
= stage.titleize
.builds-container
%ul
- statuses.each do |build|
- builds.each do |build|
%li.build
.build-content
%span{class: "ci-status-link ci-status-icon-#{status}"}
= ci_icon_for_status(status)
%span{class: "ci-status-link ci-status-icon-#{build.status}"}
- if build.try(:playable?)
= link_to play_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Play' do
= icon('play')
- else
= link_to namespace_project_build_url(build.project.namespace, build.project, build) do
= ci_icon_for_status(build.status)
= build.name
.row-content-block.build-content.middle-block.pipeline-graph
......
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