Commit 33aeaf6a authored by Phil Hughes's avatar Phil Hughes

Merge request title is in the notification

Short commit instead of long commit sha
parent fcba2551
......@@ -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
......
......@@ -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
}
......
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment