mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 19:16:39 +10:00
Preparing build text
This commit is contained in:
@@ -47,7 +47,7 @@ class @MergeRequestWidget
|
||||
$('.mr-state-widget').replaceWith(data)
|
||||
|
||||
ciLabelForStatus: (status) ->
|
||||
if status == 'success'
|
||||
if status is 'success'
|
||||
'passed'
|
||||
else
|
||||
status
|
||||
@@ -86,12 +86,22 @@ class @MergeRequestWidget
|
||||
@showCICoverage data.coverage
|
||||
|
||||
if showNotification
|
||||
message = @opts.ci_message.replace('{{status}}', @ciLabelForStatus(data.status))
|
||||
status = @ciLabelForStatus(data.status)
|
||||
|
||||
if status is "preparing"
|
||||
title = @opts.ci_title.preparing
|
||||
status = status.charAt(0).toUpperCase() + status.slice(1);
|
||||
message = @opts.ci_message.preparing.replace('{{status}}', status)
|
||||
else
|
||||
title = @opts.ci_title.normal
|
||||
message = @opts.ci_message.normal.replace('{{status}}', status)
|
||||
|
||||
title = title.replace('{{status}}', status)
|
||||
message = message.replace('{{sha}}', data.sha)
|
||||
message = message.replace('{{title}}', data.title)
|
||||
|
||||
notify(
|
||||
"Build #{@ciLabelForStatus(data.status)}",
|
||||
title,
|
||||
message,
|
||||
@opts.gitlab_icon,
|
||||
->
|
||||
|
||||
@@ -14,8 +14,15 @@
|
||||
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_message: "Build {{status}} for \"{{title}}\"",
|
||||
ci_message: {
|
||||
normal: "Build {{status}} for \"{{title}}\"",
|
||||
preparing: "{{status}} build for \"{{title}}\""
|
||||
},
|
||||
ci_enable: #{@project.ci_service ? "true" : "false"},
|
||||
ci_title: {
|
||||
preparing: "{{status}} build",
|
||||
normal: "Build {{status}}"
|
||||
},
|
||||
builds_path: "#{builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user