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
Boxiang Sun
gitlab-ce
Commits
ecefe090
Commit
ecefe090
authored
Aug 31, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render link to branch only when branch still exists
parent
472f2d56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+5
-1
changelogs/unreleased/42611-removed-branch-link.yml
changelogs/unreleased/42611-removed-branch-link.yml
+5
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+17
-0
No files found.
app/views/projects/pipelines/_info.html.haml
View file @
ecefe090
...
@@ -13,7 +13,11 @@
...
@@ -13,7 +13,11 @@
=
pluralize
@pipeline
.
total_size
,
"job"
=
pluralize
@pipeline
.
total_size
,
"job"
-
if
@pipeline
.
ref
-
if
@pipeline
.
ref
from
from
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
-
if
@project
.
repository
.
branch_exists?
(
@pipeline
.
ref
)
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
-
else
%span
.ref-name
=
@pipeline
.
ref
-
if
@pipeline
.
duration
-
if
@pipeline
.
duration
in
in
=
time_interval_in_words
(
@pipeline
.
duration
)
=
time_interval_in_words
(
@pipeline
.
duration
)
...
...
changelogs/unreleased/42611-removed-branch-link.yml
0 → 100644
View file @
ecefe090
---
title
:
Only render link to branch when branch still exists in pipeline page
merge_request
:
author
:
type
:
fixed
spec/features/projects/pipelines/pipeline_spec.rb
View file @
ecefe090
...
@@ -63,6 +63,11 @@ describe 'Pipeline', :js do
...
@@ -63,6 +63,11 @@ describe 'Pipeline', :js do
expect
(
page
).
to
have_css
(
'#js-tab-pipeline.active'
)
expect
(
page
).
to
have_css
(
'#js-tab-pipeline.active'
)
end
end
it
'shows link to the pipeline ref'
do
expect
(
page
).
to
have_link
(
pipeline
.
ref
)
end
it_behaves_like
'showing user status'
do
it_behaves_like
'showing user status'
do
let
(
:user_with_status
)
{
pipeline
.
user
}
let
(
:user_with_status
)
{
pipeline
.
user
}
...
@@ -208,6 +213,18 @@ describe 'Pipeline', :js do
...
@@ -208,6 +213,18 @@ describe 'Pipeline', :js do
it
{
expect
(
page
).
not_to
have_content
(
'Cancel running'
)
}
it
{
expect
(
page
).
not_to
have_content
(
'Cancel running'
)
}
end
end
end
end
context
'with deleted branch'
do
before
do
DeleteBranchService
.
new
(
@project
,
@user
).
execute
(
pipeline
.
ref
)
end
it
'does not render link to the pipeline ref'
do
expect
(
page
).
not_to
have_link
(
pipeline
.
ref
)
expect
(
page
).
to
have_content
(
pipeline
.
ref
)
end
end
end
end
context
'when user does not have access to read jobs'
do
context
'when user does not have access to read jobs'
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