Fix broken link for latest deployment
Updates changelog with MR ID
This commit is contained in:
parent
5186618bb0
commit
186c4dd7b4
4 changed files with 33 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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?
|
||||
|
|
4
changelogs/unreleased/25136-last-deployment-link.yml
Normal file
4
changelogs/unreleased/25136-last-deployment-link.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Fix Latest deployment link is broken
|
||||
merge_request: 7839
|
||||
author:
|
|
@ -227,6 +227,28 @@ feature 'Builds', :feature do
|
|||
expect(page).to have_selector('.js-build-value', text: 'TRIGGER_VALUE_1')
|
||||
end
|
||||
end
|
||||
|
||||
context "Build starts environment" do
|
||||
context "Build is successfull and has deployment" do
|
||||
it "shows a link for the build" do
|
||||
-# link to environment.name
|
||||
expect(page).to have_link()
|
||||
end
|
||||
end
|
||||
|
||||
context "Build is complete and not successfull" do
|
||||
it "shows a link for the build" do
|
||||
-# link to environment.name
|
||||
expect(page).to have_link()
|
||||
end
|
||||
end
|
||||
|
||||
context "Build creates a new deployment" do
|
||||
it "shows a link to lastest deployment" do
|
||||
expect(page).to have_link("latest deployment")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /:project/builds/:id/cancel" do
|
||||
|
|
Loading…
Reference in a new issue