Improve pipeline view
This commit is contained in:
parent
c351b9f599
commit
cb6f035141
|
@ -1,5 +1,6 @@
|
|||
class Projects::PipelinesController < Projects::ApplicationController
|
||||
before_action :pipeline, except: [:index, :new, :create]
|
||||
before_action :commit, only: [:show]
|
||||
before_action :authorize_read_pipeline!
|
||||
before_action :authorize_create_pipeline!, only: [:new, :create]
|
||||
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
|
||||
|
@ -85,4 +86,8 @@ class Projects::PipelinesController < Projects::ApplicationController
|
|||
def pipeline
|
||||
@pipeline ||= project.ci_commits.find_by!(id: params[:id])
|
||||
end
|
||||
|
||||
def commit
|
||||
@commit ||= @pipeline.commit_data
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
= pluralize ci_commit.statuses.count(:id), "build"
|
||||
- if ci_commit.ref
|
||||
for
|
||||
%span.label.label-info
|
||||
= ci_commit.ref
|
||||
= link_to ci_commit.ref, namespace_project_commits_path(@project.namespace, @project, ci_commit.ref), class: "monospace"
|
||||
- if defined?(link_to_commit) && link_to_commit
|
||||
for commit
|
||||
= link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.pull-right
|
||||
%div
|
||||
- if @notes_count > 0
|
||||
- if defined?(@notes_count) && @notes_count > 0
|
||||
%span.btn.disabled.btn-grouped
|
||||
%i.fa.fa-comment
|
||||
= @notes_count
|
||||
|
@ -42,7 +42,14 @@
|
|||
- @commit.parents.each do |parent|
|
||||
= link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace"
|
||||
|
||||
- if @commit.status
|
||||
- if defined?(pipeline) && pipeline
|
||||
.pull-right
|
||||
= link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status ci-#{pipeline.status}" do
|
||||
= ci_icon_for_status(pipeline.status)
|
||||
pipeline:
|
||||
= ci_label_for_status(pipeline.status)
|
||||
|
||||
- elsif @commit.status
|
||||
.pull-right
|
||||
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status ci-#{@commit.status}" do
|
||||
= ci_icon_for_status(@commit.status)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
- page_title "Pipeline"
|
||||
|
||||
= render "header_title"
|
||||
.prepend-top-default
|
||||
- if @commit
|
||||
= render "projects/commit/commit_box", pipeline: @pipeline
|
||||
%div.block-connector
|
||||
|
||||
= render "projects/commit/ci_commit", ci_commit: @pipeline
|
||||
|
|
Loading…
Reference in New Issue