Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
186c4dd7
Commit
186c4dd7
authored
Nov 30, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken link for latest deployment
Updates changelog with MR ID
parent
5186618b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
app/helpers/environment_helper.rb
app/helpers/environment_helper.rb
+6
-0
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-2
changelogs/unreleased/25136-last-deployment-link.yml
changelogs/unreleased/25136-last-deployment-link.yml
+4
-0
spec/features/projects/builds_spec.rb
spec/features/projects/builds_spec.rb
+22
-0
No files found.
app/helpers/environment_helper.rb
View file @
186c4dd7
...
@@ -20,6 +20,12 @@ module EnvironmentHelper
...
@@ -20,6 +20,12 @@ module EnvironmentHelper
link_to
"#
#{
deployment
.
iid
}
"
,
[
deployment
.
project
.
namespace
.
becomes
(
Namespace
),
deployment
.
project
,
deployment
.
deployable
]
link_to
"#
#{
deployment
.
iid
}
"
,
[
deployment
.
project
.
namespace
.
becomes
(
Namespace
),
deployment
.
project
,
deployment
.
deployable
]
end
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
)
def
last_deployment_link_for_environment_build
(
project
,
build
)
environment
=
environment_for_build
(
project
,
build
)
environment
=
environment_for_build
(
project
,
build
)
return
unless
environment
return
unless
environment
...
...
app/views/projects/builds/show.html.haml
View file @
186c4dd7
...
@@ -46,8 +46,7 @@
...
@@ -46,8 +46,7 @@
-
else
-
else
This build is creating a deployment to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
This build is creating a deployment to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
-
if
environment
.
try
(
:last_deployment
)
-
if
environment
.
try
(
:last_deployment
)
and will overwrite the
and will overwrite the
#{
last_deployment_link
(
environment
.
last_deployment
,
'latest deployment'
)
}
=
link_to
'latest deployment'
,
deployment_link
(
environment
.
last_deployment
)
.prepend-top-default
.prepend-top-default
-
if
@build
.
erased?
-
if
@build
.
erased?
...
...
changelogs/unreleased/25136-last-deployment-link.yml
0 → 100644
View file @
186c4dd7
---
title
:
Fix Latest deployment link is broken
merge_request
:
7839
author
:
spec/features/projects/builds_spec.rb
View file @
186c4dd7
...
@@ -227,6 +227,28 @@ feature 'Builds', :feature do
...
@@ -227,6 +227,28 @@ feature 'Builds', :feature do
expect
(
page
).
to
have_selector
(
'.js-build-value'
,
text:
'TRIGGER_VALUE_1'
)
expect
(
page
).
to
have_selector
(
'.js-build-value'
,
text:
'TRIGGER_VALUE_1'
)
end
end
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
end
describe
"POST /:project/builds/:id/cancel"
do
describe
"POST /:project/builds/:id/cancel"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment