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
9410fbef
Commit
9410fbef
authored
Dec 19, 2017
by
Mario de la Ossa
Committed by
Rémy Coutable
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tags in the Activity tab not being clickable
parent
0be4b0b7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
1 deletion
+62
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+2
-1
changelogs/unreleased/33028-event-tag-links.yml
changelogs/unreleased/33028-event-tag-links.yml
+5
-0
spec/views/events/event/_push.html.haml_spec.rb
spec/views/events/event/_push.html.haml_spec.rb
+55
-0
No files found.
app/views/events/event/_push.html.haml
View file @
9410fbef
...
...
@@ -7,7 +7,8 @@
%span
.pushed
#{
event
.
action_name
}
#{
event
.
ref_type
}
%strong
-
commits_link
=
project_commits_path
(
project
,
event
.
ref_name
)
=
link_to_if
project
.
repository
.
branch_exists?
(
event
.
ref_name
),
event
.
ref_name
,
commits_link
,
class:
'ref-name'
-
should_link
=
event
.
tag?
?
project
.
repository
.
tag_exists?
(
event
.
ref_name
)
:
project
.
repository
.
branch_exists?
(
event
.
ref_name
)
=
link_to_if
should_link
,
event
.
ref_name
,
commits_link
,
class:
'ref-name'
=
render
"events/event_scope"
,
event:
event
...
...
changelogs/unreleased/33028-event-tag-links.yml
0 → 100644
View file @
9410fbef
---
title
:
Fix tags in the Activity tab not being clickable
merge_request
:
15996
author
:
Mario de la Ossa
type
:
fixed
spec/views/events/event/_push.html.haml_spec.rb
0 → 100644
View file @
9410fbef
require
'spec_helper'
describe
'events/event/_push.html.haml'
do
let
(
:event
)
{
build_stubbed
(
:push_event
)
}
context
'with a branch'
do
let
(
:payload
)
{
build_stubbed
(
:push_event_payload
,
event:
event
)
}
before
do
allow
(
event
).
to
receive
(
:push_event_payload
).
and_return
(
payload
)
end
it
'links to the branch'
do
allow
(
event
.
project
.
repository
).
to
receive
(
:branch_exists?
).
with
(
event
.
ref_name
).
and_return
(
true
)
link
=
project_commits_path
(
event
.
project
,
event
.
ref_name
)
render
partial:
'events/event/push'
,
locals:
{
event:
event
}
expect
(
rendered
).
to
have_link
(
event
.
ref_name
,
href:
link
)
end
context
'that has been deleted'
do
it
'does not link to the branch'
do
render
partial:
'events/event/push'
,
locals:
{
event:
event
}
expect
(
rendered
).
not_to
have_link
(
event
.
ref_name
)
end
end
end
context
'with a tag'
do
let
(
:payload
)
{
build_stubbed
(
:push_event_payload
,
event:
event
,
ref_type: :tag
,
ref:
'v0.1.0'
)
}
before
do
allow
(
event
).
to
receive
(
:push_event_payload
).
and_return
(
payload
)
end
it
'links to the tag'
do
allow
(
event
.
project
.
repository
).
to
receive
(
:tag_exists?
).
with
(
event
.
ref_name
).
and_return
(
true
)
link
=
project_commits_path
(
event
.
project
,
event
.
ref_name
)
render
partial:
'events/event/push'
,
locals:
{
event:
event
}
expect
(
rendered
).
to
have_link
(
event
.
ref_name
,
href:
link
)
end
context
'that has been deleted'
do
it
'does not link to the tag'
do
render
partial:
'events/event/push'
,
locals:
{
event:
event
}
expect
(
rendered
).
not_to
have_link
(
event
.
ref_name
)
end
end
end
end
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