diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-07-15 23:08:27 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-07-19 21:31:24 +0300 |
commit | 737e5226f87b06c2fe8633819bce1fde16308f19 (patch) | |
tree | d5755143f325959fdff83ad7d5da990882180ff5 /app/assets/javascripts | |
parent | b2a79554c339a583b6cc0d471b8224a24f11c96d (diff) |
Use switch statements instead of if/else chains.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/merge_request_widget.js.coffee | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee index 31f5cb93a51..963a0550c35 100644 --- a/app/assets/javascripts/merge_request_widget.js.coffee +++ b/app/assets/javascripts/merge_request_widget.js.coffee @@ -55,12 +55,13 @@ class @MergeRequestWidget $('.mr-state-widget').replaceWith(data) ciLabelForStatus: (status) -> - if status is 'success' - 'passed' - else if status is 'success_with_warnings' - 'passed with warnings' - else - status + switch status + when 'success' + 'passed' + when 'success_with_warnings' + 'passed with warnings' + else + status pollCIStatus: -> @fetchBuildStatusInterval = setInterval ( => |