Commit 1cd9b3b8 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Split pipeline status item for Commit Status and Build

parent fd09311d
...@@ -78,8 +78,8 @@ module Ci ...@@ -78,8 +78,8 @@ module Ci
CommitStatus.where(pipeline: pluck(:id)).stages CommitStatus.where(pipeline: pluck(:id)).stages
end end
def stages def stages_with_latest_statuses
statuses.order(:stage_idx).latest.group_by(&:stage) statuses.latest.order(:stage_idx).group_by(&:stage)
end end
def project_id def project_id
......
%li.build
.build-content
%span{class: "ci-status-link ci-status-icon-#{subject.status}"}
- 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
= icon('play')
- elsif can?(current_user, :read_build, @project) && subject.started?
= link_to namespace_project_build_path(subject.project.namespace, subject.project, subject) do
= ci_icon_for_status(subject.status)
- else
= ci_icon_for_status(subject.status)
= subject.name
.row-content-block.build-content.middle-block.pipeline-graph .row-content-block.build-content.middle-block.pipeline-graph
.pipeline-visualization .pipeline-visualization
%ul.stage-column-list %ul.stage-column-list
- stages = pipeline.statuses.latest.order(:stage_idx).group_by(&:stage) - stages = pipeline.stages_with_latest_statuses
- stages.each do |stage, builds| - stages.each do |stage, statuses|
%li.stage-column %li.stage-column
.stage-name .stage-name
%a{name: stage} %a{name: stage}
...@@ -10,17 +10,8 @@ ...@@ -10,17 +10,8 @@
= stage.titleize = stage.titleize
.builds-container .builds-container
%ul %ul
- builds.each do |build| - statuses.each do |status|
%li.build = render "projects/#{status.to_partial_path}_pipeline", subject: status
.build-content
%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 .row-content-block.build-content.middle-block.pipeline-graph
.pull-right .pull-right
......
%li.build
.build-content
%span{class: "ci-status-link ci-status-icon-#{subject.status}"}
- if subject.target_url
- link_to subject.target_url do
= ci_icon_for_status(subject.status)
- else
= ci_icon_for_status(subject.status)
= subject.name
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