Starting work on the warn_on_failure feature for the MR build status.

This commit is contained in:
Connor Shea 2016-06-29 11:06:41 -06:00
parent 1d7ac1641e
commit f668a785cd
No known key found for this signature in database
GPG key ID: E52237E5B35A83E6
5 changed files with 23 additions and 5 deletions

View file

@ -57,6 +57,8 @@ class @MergeRequestWidget
ciLabelForStatus: (status) ->
if status is 'success'
'passed'
else if status is 'success_with_warnings'
'passed with warnings'
else
status
@ -116,7 +118,7 @@ class @MergeRequestWidget
showCIStatus: (state) ->
return if not state?
$('.ci_widget').hide()
allowed_states = ["failed", "canceled", "running", "pending", "success", "skipped", "not_found"]
allowed_states = ["failed", "canceled", "running", "pending", "success", "success_with_warnings", "skipped", "not_found"]
if state in allowed_states
$('.ci_widget.ci-' + state).show()
switch state
@ -124,7 +126,7 @@ class @MergeRequestWidget
@setMergeButtonClass('btn-danger')
when "running"
@setMergeButtonClass('btn-warning')
when "success"
when "success", "success_with_warnings"
@setMergeButtonClass('btn-create')
else
$('.ci_widget.ci-error').show()

View file

@ -68,6 +68,14 @@
color: $gl-success;
}
&.ci-success_with_warnings {
color: $gl-success;
i {
color: $gl-warning;
}
}
&.ci-skipped {
background-color: #eee;
color: #888;

View file

@ -15,7 +15,8 @@
border-color: $gl-danger;
}
&.ci-success {
&.ci-success,
&.ci-success_with_warnings {
color: $gl-success;
border-color: $gl-success;
}
@ -49,9 +50,12 @@
.ci-status-icon-failed {
color: $gl-danger;
}
.ci-status-icon-pending {
.ci-status-icon-pending,
.ci-status-icon-success_with_warning {
color: $gl-warning;
}
.ci-status-icon-running {
color: $blue-normal;
}

View file

@ -17,6 +17,8 @@ module CiStatusHelper
def ci_label_for_status(status)
if status == 'success'
'passed'
elsif status == 'success_with_warnings'
'passed with warnings'
else
status
end
@ -27,6 +29,8 @@ module CiStatusHelper
case status
when 'success'
'check'
when 'success_with_warnings'
'exclamation-triangle'
when 'failed'
'close'
when 'pending'

View file

@ -1,6 +1,6 @@
- if @pipeline
.mr-widget-heading
- %w[success skipped canceled failed running pending].each do |status|
- %w[success success_with_warnings skipped canceled failed running pending].each do |status|
.ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) }
= ci_icon_for_status(status)
%span