summaryrefslogtreecommitdiff
path: root/app/views/projects/merge_requests
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-05-27 11:36:01 +0000
committerJacob Schatz <jschatz@gitlab.com>2016-05-27 11:36:01 +0000
commit952db59f0726e6efbcecc50d777cda4b3bf7d626 (patch)
tree141206799cc8ac113226b998d4b2fa378018bca3 /app/views/projects/merge_requests
parent61072a02444092040fcabdc582f029670ccd4ae2 (diff)
parent9a7951f7dd980438d9f92152deb1040c4dc16cbe (diff)
downloadgitlab-ce-952db59f0726e6efbcecc50d777cda4b3bf7d626.tar.gz
Merge branch 'fix-multiple-ci-status-poll' into 'master'
Fixed potential issue with 2 ci status polling events happening Possible cause for double notifications was if the request was slow & then you changed page whilst this request was happening it would finish on another page & then launch another interval - this stops that issue. Also passed in the CI status as an option value rather than waiting for the first ajax request to finish See merge request !3869
Diffstat (limited to 'app/views/projects/merge_requests')
-rw-r--r--app/views/projects/merge_requests/widget/_show.html.haml8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml
index 3c68d61c4b5..b79508bdc34 100644
--- a/app/views/projects/merge_requests/widget/_show.html.haml
+++ b/app/views/projects/merge_requests/widget/_show.html.haml
@@ -13,7 +13,7 @@
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
- ci_status: "",
+ ci_status: "#{@merge_request.ci_commit ? @merge_request.ci_commit.status : ''}",
ci_message: {
normal: "Build {{status}} for \"{{title}}\"",
preparing: "{{status}} build for \"{{title}}\""
@@ -26,4 +26,10 @@
builds_path: "#{builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
};
+ if (typeof merge_request_widget !== 'undefined') {
+ clearInterval(merge_request_widget.fetchBuildStatusInterval);
+ merge_request_widget.cancelPolling();
+ merge_request_widget.clearEventListeners();
+ }
+
merge_request_widget = new MergeRequestWidget(opts);