Merge request title is in the notification
Short commit instead of long commit sha
This commit is contained in:
parent
fcba255153
commit
33aeaf6a9c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue