summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-04-06 17:04:22 +0100
committerPhil Hughes <me@iamphill.com>2016-04-11 17:20:47 +0100
commit843bc44aa9dea8a19af21dd13a82ecc02bf8840c (patch)
tree7e66979e90ea0307b04d241b6ae8e53cef41b8f6
parent552cde76fa96282dec4ba002cd1850d003a5b29f (diff)
downloadgitlab-ce-843bc44aa9dea8a19af21dd13a82ecc02bf8840c.tar.gz
Preparing build text
-rw-r--r--app/assets/javascripts/merge_request_widget.js.coffee16
-rw-r--r--app/views/projects/merge_requests/widget/_show.html.haml9
2 files changed, 21 insertions, 4 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee
index 63f75be2dad..a522f9189ab 100644
--- a/app/assets/javascripts/merge_request_widget.js.coffee
+++ b/app/assets/javascripts/merge_request_widget.js.coffee
@@ -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,
->
diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml
index 003477dda1a..804ca3783e3 100644
--- a/app/views/projects/merge_requests/widget/_show.html.haml
+++ b/app/views/projects/merge_requests/widget/_show.html.haml
@@ -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)}"
};