Commit bf4dc758 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve the pipelines design

parent 003526e2
.pipeline-stage {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
...@@ -25,7 +25,7 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -25,7 +25,7 @@ class Projects::PipelinesController < Projects::ApplicationController
flash[:alert] = e.message flash[:alert] = e.message
render 'new' render 'new'
rescue rescue
flash[:alert] = 'Undefined error' flash[:alert] = 'The pipeline could not be created. Please try again.'
render 'new' render 'new'
end end
end end
......
...@@ -14,6 +14,7 @@ class CommitStatus < ActiveRecord::Base ...@@ -14,6 +14,7 @@ class CommitStatus < ActiveRecord::Base
alias_attribute :author, :user alias_attribute :author, :user
scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :commit_id)) } scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :commit_id)) }
scope :retried, -> { where.not(id: latest) }
scope :ordered, -> { order(:name) } scope :ordered, -> { order(:name) }
scope :ignored, -> { where(allow_failure: true, status: [:failed, :canceled]) } scope :ignored, -> { where(allow_failure: true, status: [:failed, :canceled]) }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
- if commit.triggered? - if commit.triggered?
%span.label.label-primary triggered %span.label.label-primary triggered
- if commit.yaml_errors.present? - if commit.yaml_errors.present?
%span.label.label-danger.has-tooltip(title="#{commit.yaml_errors}") yaml invalid %span.label.label-danger.has-tooltip{ title: "#{commit.yaml_errors}" } yaml invalid
- if commit.builds.any?(&:stuck?) - if commit.builds.any?(&:stuck?)
%span.label.label-warning stuck %span.label.label-warning stuck
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
%td %td
- if status = stages_status[stage] - if status = stages_status[stage]
- tooltip = "#{stage.titleize}: #{status}" - tooltip = "#{stage.titleize}: #{status}"
%span.has-tooltip(title="#{tooltip}"){class: "ci-status-icon-#{status}"} %span.has-tooltip{ title: "#{tooltip}", class: "ci-status-icon-#{status}" }
= ci_icon_for_status(status) = ci_icon_for_status(status)
%td %td
...@@ -74,4 +74,4 @@ ...@@ -74,4 +74,4 @@
&nbsp; &nbsp;
- if commit.active? - if commit.active?
= link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do = link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
= icon("remove", class: "cred") = icon("remove")
- latest = statuses.latest
- retried = statuses.where.not(id: latest)
%tr %tr
%th{colspan: 10} %th{colspan: 10}
%strong %strong
- status = latest.status - status = statuses.latest.status
%span{class: "ci-status-link ci-status-icon-#{status}"} %span{class: "ci-status-link ci-status-icon-#{status}"}
= ci_icon_for_status(status) = ci_icon_for_status(status)
- if stage - if stage
&nbsp; &nbsp;
= stage.titleize.pluralize = stage.titleize.pluralize
= render latest.ordered, coverage: @project.build_coverage_enabled?, tage: false, ref: false, allow_retry: true = render statuses.latest.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, allow_retry: true
= render retried.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, retried: true = render statuses.retried.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, retried: true
%tr %tr
%td{colspan: 10} %td{colspan: 10}
&nbsp; &nbsp;
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
.pull-right .pull-right
= link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status ci-#{pipeline.status}" do = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status ci-#{pipeline.status}" do
= ci_icon_for_status(pipeline.status) = ci_icon_for_status(pipeline.status)
pipeline: Pipeline:
= ci_label_for_status(pipeline.status) = ci_label_for_status(pipeline.status)
- elsif @commit.status - elsif @commit.status
.pull-right .pull-right
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status ci-#{@commit.status}" do = 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) = ci_icon_for_status(@commit.status)
build: Build:
= ci_label_for_status(@commit.status) = ci_label_for_status(@commit.status)
%span.light Authored by %span.light Authored by
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
- if can? current_user, :create_pipeline, @project - if can? current_user, :create_pipeline, @project
= link_to new_namespace_project_pipeline_path(@project.namespace, @project), class: 'btn btn-create' do = link_to new_namespace_project_pipeline_path(@project.namespace, @project), class: 'btn btn-create' do
= icon('plus') = icon('plus')
New New pipeline
- unless @repository.gitlab_ci_yml - unless @repository.gitlab_ci_yml
= link_to 'Get started with Pipelines', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info' = link_to 'Get started with Pipelines', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info'
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
= icon('wrench') = icon('wrench')
%span CI Lint %span CI Lint
.gray-content-block .row-content-block
- if @scope == 'running' - if @scope == 'running'
Running pipelines for this project Running pipelines for this project
- elsif @scope.nil? - elsif @scope.nil?
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
%th Commit %th Commit
- stages.each do |stage| - stages.each do |stage|
%th %th
%span.has-tooltip(title="#{stage.titleize}") %span.pipeline-stage.has-tooltip{ title: "#{stage.titleize}" }
= truncate(stage.titleize.pluralize, length: 8) = stage.titleize.pluralize
%th %th
%th %th
= render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages = render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
New Pipeline New Pipeline
%hr %hr
= form_tag namespace_project_pipelines_path, method: :post, id: "new-pipeline-form", class: "form-horizontal js-create-branch-form js-requires-input" do = form_tag namespace_project_pipelines_path, method: :post, id: "new-pipeline-form", class: "form-horizontal js-new-pipeline-form js-requires-input" do
.form-group .form-group
= label_tag :ref, 'Create for', class: 'control-label' = label_tag :ref, 'Create for', class: 'control-label'
.col-sm-10 .col-sm-10
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
:javascript :javascript
var availableRefs = #{@project.repository.ref_names.to_json}; var availableRefs = #{@project.repository.ref_names.to_json};
new NewBranchForm($('.js-create-branch-form'), availableRefs) new NewBranchForm($('.js-new-pipeline-form'), availableRefs)
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