summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-30 11:57:38 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-07 10:41:35 +0000
commit186c4dd7b4f6d4edc68c6fd65703665d14877e3e (patch)
tree9819280d0ecb67630d44db0c5483840c45f809f2 /app
parent5186618bb0220383ae4668b7d023bfbbb52c8948 (diff)
downloadgitlab-ce-186c4dd7b4f6d4edc68c6fd65703665d14877e3e.tar.gz
Fix broken link for latest deployment
Updates changelog with MR ID
Diffstat (limited to 'app')
-rw-r--r--app/helpers/environment_helper.rb6
-rw-r--r--app/views/projects/builds/show.html.haml3
2 files changed, 7 insertions, 2 deletions
diff --git a/app/helpers/environment_helper.rb b/app/helpers/environment_helper.rb
index 27975b7ddb7..5fde912ab2c 100644
--- a/app/helpers/environment_helper.rb
+++ b/app/helpers/environment_helper.rb
@@ -20,6 +20,12 @@ module EnvironmentHelper
link_to "##{deployment.iid}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
end
+ def last_deployment_link(deployment, link_text)
+ return unless deployment
+
+ link_to link_text, [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
+ end
+
def last_deployment_link_for_environment_build(project, build)
environment = environment_for_build(project, build)
return unless environment
diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml
index 108674dbba6..46a1969b348 100644
--- a/app/views/projects/builds/show.html.haml
+++ b/app/views/projects/builds/show.html.haml
@@ -46,8 +46,7 @@
- else
This build is creating a deployment to #{environment_link_for_build(@build.project, @build)}
- if environment.try(:last_deployment)
- and will overwrite the
- = link_to 'latest deployment', deployment_link(environment.last_deployment)
+ and will overwrite the #{last_deployment_link(environment.last_deployment, 'latest deployment')}
.prepend-top-default
- if @build.erased?