diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-07-20 21:57:01 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-07-20 21:57:01 +0300 |
commit | 5eb307a1e087e9b11cbe637f28f27b3d84923c48 (patch) | |
tree | 968505eb0727886c75d6171607c30177ecd51b7d /app/assets/javascripts | |
parent | f3ea58ef1b75df3ddebdada64a74eb75af8f5477 (diff) | |
parent | 2016f367f0e6f718e8e938bd85cd81d7a99d6c10 (diff) |
Merge branch 'cs-warn-on-failure' into 'master'
Warn on failure
## What does this MR do?
Adds styling and HTML for a `success_with_warnings` status in the MR widget. Unfinished as it needs some plumbing in the relevant CI controllers and models.
## Are there points in the code the reviewer needs to double check?
Not at the moment, though I think I'll probably need help getting this to work in the backend.
## What are the relevant issue numbers?
#17669
## Screenshots (if relevant)
![Screen_Shot_2016-06-29_at_12.02.49_PM](/uploads/af4a915689633fe028f44bb34ae7a5b1/Screen_Shot_2016-06-29_at_12.02.49_PM.png)
## Does this MR meet the acceptance criteria?
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
cc: @ayufan
See merge request !5004
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/merge_request_widget.js.coffee | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee index 779f536d9f0..963a0550c35 100644 --- a/app/assets/javascripts/merge_request_widget.js.coffee +++ b/app/assets/javascripts/merge_request_widget.js.coffee @@ -55,10 +55,13 @@ class @MergeRequestWidget $('.mr-state-widget').replaceWith(data) ciLabelForStatus: (status) -> - if status is 'success' - 'passed' - else - status + switch status + when 'success' + 'passed' + when 'success_with_warnings' + 'passed with warnings' + else + status pollCIStatus: -> @fetchBuildStatusInterval = setInterval ( => @@ -116,7 +119,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 +127,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() |