summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/merge_request_widget.js.coffee5
-rw-r--r--app/controllers/projects/merge_requests_controller.rb3
-rw-r--r--app/views/projects/merge_requests/widget/_show.html.haml5
3 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee
index 9afb6a0ce86..b74b8c21fd5 100644
--- a/app/assets/javascripts/merge_request_widget.js.coffee
+++ b/app/assets/javascripts/merge_request_widget.js.coffee
@@ -42,6 +42,8 @@ class @MergeRequestWidget
getCIStatus: ->
urlToCICheck = @opts.url_to_ci_check
+ _this = @
+
@fetchBuildStatusInterval = setInterval ( =>
return if not @readyForCICheck
@@ -55,6 +57,7 @@ class @MergeRequestWidget
if data.status isnt @opts.current_status
message = @opts.ci_message.replace('{{status}}', @ciLabelForStatus(data.status))
message = message.replace('{{sha}}', data.sha)
+ message = message.replace('{{title}}', data.title)
notify(
"Build #{_this.ciLabelForStatus(data.status)}",
@@ -62,7 +65,7 @@ class @MergeRequestWidget
@opts.gitlab_icon,
->
@close()
- Turbolinks.visit "#{window.location.pathname}/builds"
+ Turbolinks.visit _this.opts.builds_path
)
@opts.current_status = data.status
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 2cc94596d2b..728d743045f 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -233,7 +233,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
response = {
- sha: merge_request.last_commit.sha,
+ title: merge_request.title,
+ sha: merge_request.last_commit_short_sha,
status: status,
coverage: coverage
}
diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml
index 8193bb4d180..6507c534a02 100644
--- a/app/views/projects/merge_requests/widget/_show.html.haml
+++ b/app/views/projects/merge_requests/widget/_show.html.haml
@@ -15,9 +15,10 @@
url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
current_status: "",
- ci_message: "Build {{status}} for {{sha}}"
+ ci_message: "Build {{status}} for {{title}}\n{{sha}}",
+ builds_path: "#{builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
};
-
+
if(typeof merge_request_widget === 'undefined') {
merge_request_widget = new MergeRequestWidget(opts);
}