Commit d25a1f30 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch '21192-retried-builds' into 'master'

Fix retried builds styling

#### What does this MR do?
Adds background color to retried builds and an icon + tooltip on retried builds in build list

#### Screenshots (if relevant)
<img src="/uploads/4138dd277c185de3c271b2eb9b459761/Screen_Shot_2016-10-13_at_2.44.27_PM.png" width="500px">
<img src="/uploads/99227d5ed3816a509660fe5a84da5b2a/Screen_Shot_2016-10-13_at_3.01.13_PM.png" width="500px">
#### What are the relevant issue numbers?
Closes #21192

See merge request !6109
parents 24b73bc9 d61f8a18
...@@ -16,6 +16,7 @@ $white-light: #fff; ...@@ -16,6 +16,7 @@ $white-light: #fff;
$white-normal: #ededed; $white-normal: #ededed;
$white-dark: #ececec; $white-dark: #ececec;
$gray-lightest: #fdfdfd;
$gray-light: #fafafa; $gray-light: #fafafa;
$gray-lighter: #f9f9f9; $gray-lighter: #f9f9f9;
$gray-normal: #f5f5f5; $gray-normal: #f5f5f5;
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
.build-job { .build-job {
position: relative; position: relative;
.fa { .fa-arrow-right {
position: absolute; position: absolute;
left: 15px; left: 15px;
top: 20px; top: 20px;
...@@ -205,14 +205,23 @@ ...@@ -205,14 +205,23 @@
&.active { &.active {
font-weight: bold; font-weight: bold;
.fa { .fa-arrow-right {
display: block; display: block;
} }
} }
&.retried {
background-color: $gray-lightest;
}
&:hover { &:hover {
background-color: $row-hover; background-color: $row-hover;
} }
.fa-refresh {
font-size: 13px;
margin-left: 3px;
}
} }
} }
} }
......
...@@ -73,6 +73,10 @@ ...@@ -73,6 +73,10 @@
border-top-width: 1px; border-top-width: 1px;
} }
.build.retried {
background-color: $gray-lightest;
}
.commit-link { .commit-link {
.ci-status { .ci-status {
...@@ -109,7 +113,8 @@ ...@@ -109,7 +113,8 @@
.fa { .fa {
font-size: 12px; font-size: 12px;
color: $table-text-gray; color: $gl-text-color;
margin-left: 5px;
} }
.commit-id { .commit-id {
......
module BuildsHelper
def sidebar_build_class(build, current_build)
build_class = ''
build_class += ' active' if build == current_build
build_class += ' retried' if build.retried?
build_class
end
end
...@@ -5,6 +5,7 @@ module HasStatus ...@@ -5,6 +5,7 @@ module HasStatus
STARTED_STATUSES = %w[running success failed skipped] STARTED_STATUSES = %w[running success failed skipped]
ACTIVE_STATUSES = %w[pending running] ACTIVE_STATUSES = %w[pending running]
COMPLETED_STATUSES = %w[success failed canceled] COMPLETED_STATUSES = %w[success failed canceled]
ORDERED_STATUSES = %w[failed pending running canceled success skipped]
class_methods do class_methods do
def status_sql def status_sql
......
- builds = @build.pipeline.builds.latest.to_a - builds = @build.pipeline.builds.to_a
- statuses = ["failed", "pending", "running", "canceled", "success", "skipped"]
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar %aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
.block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default .block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
...@@ -124,9 +123,9 @@ ...@@ -124,9 +123,9 @@
%a.stage-item= stage %a.stage-item= stage
.builds-container .builds-container
- statuses.each do |build_status| - HasStatus::ORDERED_STATUSES.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build| - builds.select{|build| build.status == build_status}.each do |build|
.build-job{class: ('active' if build == @build), data: {stage: build.stage}} .build-job{class: sidebar_build_class(build, @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do = link_to namespace_project_build_path(@project.namespace, @project, build) do
= icon('arrow-right') = icon('arrow-right')
= ci_icon_for_status(build.status) = ci_icon_for_status(build.status)
...@@ -135,11 +134,5 @@ ...@@ -135,11 +134,5 @@
= build.name = build.name
- else - else
= build.id = build.id
- if build.retried?
- if @build.retried? %i.fa.fa-refresh.has-tooltip{data: { container: 'body', placement: 'bottom' }, title: 'Build was retried'}
%li.active
%a
Build ##{@build.id}
&middot;
%i.fa.fa-warning
This build was retried.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- coverage = local_assigns.fetch(:coverage, false) - coverage = local_assigns.fetch(:coverage, false)
- allow_retry = local_assigns.fetch(:allow_retry, false) - allow_retry = local_assigns.fetch(:allow_retry, false)
%tr.build.commit %tr.build.commit{class: ('retried' if retried)}
%td.status %td.status
- if can?(current_user, :read_build, build) - if can?(current_user, :read_build, build)
= ci_status_with_icon(build.status, namespace_project_build_url(build.project.namespace, build.project, build)) = ci_status_with_icon(build.status, namespace_project_build_url(build.project.namespace, build.project, build))
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
- if build.stuck? - if build.stuck?
= icon('warning', class: 'text-warning has-tooltip', title: 'Build is stuck. Check runners.') = icon('warning', class: 'text-warning has-tooltip', title: 'Build is stuck. Check runners.')
- if retried - if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Build was retried.') = icon('refresh', class: 'text-warning has-tooltip', title: 'Build was retried')
.label-container .label-container
- if build.tags.any? - if build.tags.any?
...@@ -47,8 +48,6 @@ ...@@ -47,8 +48,6 @@
%span.label.label-info triggered %span.label.label-info triggered
- if build.try(:allow_failure) - if build.try(:allow_failure)
%span.label.label-danger allowed to fail %span.label.label-danger allowed to fail
- if retried
%span.label.label-warning retried
- if build.manual? - if build.manual?
%span.label.label-info manual %span.label.label-info manual
......
...@@ -177,7 +177,7 @@ describe "Pipelines" do ...@@ -177,7 +177,7 @@ describe "Pipelines" do
before { click_on 'Retry failed' } before { click_on 'Retry failed' }
it { expect(page).not_to have_content('Retry failed') } it { expect(page).not_to have_content('Retry failed') }
it { expect(page).to have_content('retried') } it { expect(page).to have_selector('.retried') }
end end
end end
......
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