diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-20 13:45:40 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-04-20 15:34:04 +0300 |
commit | 9cc8444a52fec03b38d82e9556ea8b9a6de5b1b3 (patch) | |
tree | 8b18763075541551900770f04d5d0fb4aa3596fc /app | |
parent | bd2c22d65518e5c581f30099fd24aea07622306f (diff) |
Merge branch 'fix/29125' into 'master'
Port of fix/29125-ee to CE
Closes #29125
See merge request !10796
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/merge_request_widget.js | 8 | ||||
-rw-r--r-- | app/views/projects/merge_requests/widget/_open.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/widget/open/_error.html.haml | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js b/app/assets/javascripts/merge_request_widget.js index bbc5379a260..43969f30499 100644 --- a/app/assets/javascripts/merge_request_widget.js +++ b/app/assets/javascripts/merge_request_widget.js @@ -154,7 +154,7 @@ require('./smart_interval'); $('.ci-widget-fetching').show(); return $.getJSON(this.opts.ci_status_url, (function(_this) { return function(data) { - var message, status, title; + var message, status, title, callback; _this.status = data.status; _this.hasCi = data.has_ci; _this.updateMergeButton(_this.status, _this.hasCi); @@ -175,6 +175,12 @@ require('./smart_interval'); _this.opts.ci_sha = data.sha; _this.updateCommitUrls(data.sha); } + if (data.status === "success" || data.status === "failed") { + callback = function() { + return _this.getMergeStatus(); + }; + return setTimeout(callback, 2000); + } if (showNotification && data.status) { status = _this.ciLabelForStatus(data.status); if (status === "preparing") { diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml index bc426f1dc0c..0872a1a0503 100644 --- a/app/views/projects/merge_requests/widget/_open.html.haml +++ b/app/views/projects/merge_requests/widget/_open.html.haml @@ -19,6 +19,8 @@ = render 'projects/merge_requests/widget/open/conflicts' - elsif @merge_request.work_in_progress? = render 'projects/merge_requests/widget/open/wip' + - elsif @merge_request.merge_when_pipeline_succeeds? && @merge_request.merge_error.present? + = render 'projects/merge_requests/widget/open/error' - elsif @merge_request.merge_when_pipeline_succeeds? = render 'projects/merge_requests/widget/open/merge_when_pipeline_succeeds' - elsif !@merge_request.can_be_merged_by?(current_user) diff --git a/app/views/projects/merge_requests/widget/open/_error.html.haml b/app/views/projects/merge_requests/widget/open/_error.html.haml new file mode 100644 index 00000000000..bbdc053609f --- /dev/null +++ b/app/views/projects/merge_requests/widget/open/_error.html.haml @@ -0,0 +1,6 @@ +%h4 + = icon('exclamation-triangle') + This merge request failed to be merged automatically + +%p + = @merge_request.merge_error |