diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-16 16:34:42 -0500 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-16 16:48:27 -0500 |
commit | bf4dc75801176c95b49763ff6ab5e03305c91f73 (patch) | |
tree | 213e775f27af7534af0f0a5c2306e6f877779087 | |
parent | 003526e2ee408bc6be3596436288213cc57d1bcd (diff) | |
download | gitlab-ce-bf4dc75801176c95b49763ff6ab5e03305c91f73.tar.gz |
Improve the pipelines design
-rw-r--r-- | app/assets/stylesheets/pages/pipelines.scss | 5 | ||||
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 2 | ||||
-rw-r--r-- | app/models/commit_status.rb | 1 | ||||
-rw-r--r-- | app/views/projects/ci/commits/_commit.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/commit/_ci_stage.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/commit/_commit_box.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/pipelines/index.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/pipelines/new.html.haml | 4 |
8 files changed, 21 insertions, 17 deletions
diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss new file mode 100644 index 00000000000..7d90a4bebc5 --- /dev/null +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -0,0 +1,5 @@ +.pipeline-stage { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 78b85ea9a71..19071cc9e43 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -25,7 +25,7 @@ class Projects::PipelinesController < Projects::ApplicationController flash[:alert] = e.message render 'new' rescue - flash[:alert] = 'Undefined error' + flash[:alert] = 'The pipeline could not be created. Please try again.' render 'new' end end diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 6fef1c038e9..1548a51e942 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -14,6 +14,7 @@ class CommitStatus < ActiveRecord::Base alias_attribute :author, :user scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :commit_id)) } + scope :retried, -> { where.not(id: latest) } scope :ordered, -> { order(:name) } scope :ignored, -> { where(allow_failure: true, status: [:failed, :canceled]) } diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/commits/_commit.html.haml index 90ac41666d0..13162b41f9b 100644 --- a/app/views/projects/ci/commits/_commit.html.haml +++ b/app/views/projects/ci/commits/_commit.html.haml @@ -19,7 +19,7 @@ - if commit.triggered? %span.label.label-primary triggered - 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?) %span.label.label-warning stuck @@ -36,7 +36,7 @@ %td - if status = stages_status[stage] - 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) %td @@ -74,4 +74,4 @@ - 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 - = icon("remove", class: "cred") + = icon("remove") diff --git a/app/views/projects/commit/_ci_stage.html.haml b/app/views/projects/commit/_ci_stage.html.haml index bdadf2944c4..aaa318e1eb3 100644 --- a/app/views/projects/commit/_ci_stage.html.haml +++ b/app/views/projects/commit/_ci_stage.html.haml @@ -1,16 +1,14 @@ -- latest = statuses.latest -- retried = statuses.where.not(id: latest) %tr %th{colspan: 10} %strong - - status = latest.status + - status = statuses.latest.status %span{class: "ci-status-link ci-status-icon-#{status}"} = ci_icon_for_status(status) - if stage = stage.titleize.pluralize - = render latest.ordered, coverage: @project.build_coverage_enabled?, tage: false, ref: false, allow_retry: true - = render retried.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, retried: true + = render statuses.latest.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, allow_retry: true + = render statuses.retried.ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, retried: true %tr %td{colspan: 10} diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 77fb0bc7357..30ec47cc8e3 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -27,14 +27,14 @@ .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: + 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) - build: + Build: = ci_label_for_status(@commit.status) %span.light Authored by diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index af55ef42a6e..9d5b6d367c9 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -27,7 +27,7 @@ - if can? current_user, :create_pipeline, @project = link_to new_namespace_project_pipeline_path(@project.namespace, @project), class: 'btn btn-create' do = icon('plus') - New + New pipeline - unless @repository.gitlab_ci_yml = link_to 'Get started with Pipelines', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info' @@ -36,7 +36,7 @@ = icon('wrench') %span CI Lint -.gray-content-block +.row-content-block - if @scope == 'running' Running pipelines for this project - elsif @scope.nil? @@ -57,8 +57,8 @@ %th Commit - stages.each do |stage| %th - %span.has-tooltip(title="#{stage.titleize}") - = truncate(stage.titleize.pluralize, length: 8) + %span.pipeline-stage.has-tooltip{ title: "#{stage.titleize}" } + = stage.titleize.pluralize %th %th = render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages diff --git a/app/views/projects/pipelines/new.html.haml b/app/views/projects/pipelines/new.html.haml index 39b1571b9cf..534a495dd85 100644 --- a/app/views/projects/pipelines/new.html.haml +++ b/app/views/projects/pipelines/new.html.haml @@ -9,7 +9,7 @@ New Pipeline %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 = label_tag :ref, 'Create for', class: 'control-label' .col-sm-10 @@ -22,4 +22,4 @@ :javascript var availableRefs = #{@project.repository.ref_names.to_json}; - new NewBranchForm($('.js-create-branch-form'), availableRefs) + new NewBranchForm($('.js-new-pipeline-form'), availableRefs) |