Use switch statements instead of if/else chains.
This commit is contained in:
parent
b2a79554c3
commit
737e5226f8
2 changed files with 10 additions and 8 deletions
|
@ -55,9 +55,10 @@ class @MergeRequestWidget
|
|||
$('.mr-state-widget').replaceWith(data)
|
||||
|
||||
ciLabelForStatus: (status) ->
|
||||
if status is 'success'
|
||||
switch status
|
||||
when 'success'
|
||||
'passed'
|
||||
else if status is 'success_with_warnings'
|
||||
when 'success_with_warnings'
|
||||
'passed with warnings'
|
||||
else
|
||||
status
|
||||
|
|
|
@ -15,9 +15,10 @@ module CiStatusHelper
|
|||
end
|
||||
|
||||
def ci_label_for_status(status)
|
||||
if status == 'success'
|
||||
case status
|
||||
when 'success'
|
||||
'passed'
|
||||
elsif status == 'success_with_warnings'
|
||||
when 'success_with_warnings'
|
||||
'passed with warnings'
|
||||
else
|
||||
status
|
||||
|
|
Loading…
Reference in a new issue