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
Léo-Paul Géneau
gitlab-ce
Commits
00e42e3c
Commit
00e42e3c
authored
Sep 05, 2018
by
schwedenmut
Committed by
Rémy Coutable
Sep 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "<link href=""> and <a href=""> not properly filled in activity RSS feed"
parent
4a3a7497
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
9 deletions
+59
-9
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+9
-7
app/views/events/_event_push.atom.haml
app/views/events/_event_push.atom.haml
+1
-1
app/views/users/calendar_activities.html.haml
app/views/users/calendar_activities.html.haml
+1
-1
changelogs/unreleased/50823-not-properly-filled-in-activity-RSS-feed-yml.yml
...ed/50823-not-properly-filled-in-activity-RSS-feed-yml.yml
+5
-0
spec/helpers/events_helper_spec.rb
spec/helpers/events_helper_spec.rb
+43
-0
No files found.
app/helpers/events_helper.rb
View file @
00e42e3c
...
...
@@ -110,10 +110,12 @@ module EventsHelper
event
.
note_target
)
elsif
event
.
note?
if
event
.
note_target
event_note_target_
path
(
event
)
event_note_target_
url
(
event
)
end
elsif
event
.
push?
push_event_feed_url
(
event
)
elsif
event
.
created_project?
project_url
(
event
.
project
)
end
end
...
...
@@ -145,13 +147,13 @@ module EventsHelper
end
end
def
event_note_target_
path
(
event
)
def
event_note_target_
url
(
event
)
if
event
.
commit_note?
project_commit_
path
(
event
.
project
,
event
.
note_target
,
anchor:
dom_id
(
event
.
target
))
project_commit_
url
(
event
.
project
,
event
.
note_target
,
anchor:
dom_id
(
event
.
target
))
elsif
event
.
project_snippet_note?
project_snippet_
path
(
event
.
project
,
event
.
note_target
,
anchor:
dom_id
(
event
.
target
))
project_snippet_
url
(
event
.
project
,
event
.
note_target
,
anchor:
dom_id
(
event
.
target
))
else
polymorphic_
path
([
event
.
project
.
namespace
.
becomes
(
Namespace
),
polymorphic_
url
([
event
.
project
.
namespace
.
becomes
(
Namespace
),
event
.
project
,
event
.
note_target
],
anchor:
dom_id
(
event
.
target
))
end
...
...
@@ -166,7 +168,7 @@ module EventsHelper
event
.
note_target_reference
end
link_to
(
text
,
event_note_target_
path
(
event
),
title:
event
.
target_title
,
class:
'has-tooltip'
)
link_to
(
text
,
event_note_target_
url
(
event
),
title:
event
.
target_title
,
class:
'has-tooltip'
)
else
content_tag
(
:strong
,
'(deleted)'
)
end
...
...
app/views/events/_event_push.atom.haml
View file @
00e42e3c
%div
{
xmlns:
"http://www.w3.org/1999/xhtml"
}
%p
%strong
=
event
.
author_name
=
link_to
"(
#{
truncate_sha
(
event
.
commit_id
)
}
)"
,
project_commit_path
(
event
.
project
,
event
.
commit_id
)
=
link_to
"(
#{
truncate_sha
(
event
.
commit_id
)
}
)"
,
event_feed_url
(
event
)
%i
at
=
event
.
created_at
.
to_s
(
:short
)
...
...
app/views/users/calendar_activities.html.haml
View file @
00e42e3c
...
...
@@ -18,7 +18,7 @@
=
event_action_name
(
event
)
%strong
-
if
event
.
note?
=
link_to
event
.
note_target
.
to_reference
,
event_note_target_
path
(
event
),
class:
'has-tooltip'
,
title:
event
.
target_title
=
link_to
event
.
note_target
.
to_reference
,
event_note_target_
url
(
event
),
class:
'has-tooltip'
,
title:
event
.
target_title
-
elsif
event
.
target
=
link_to
event
.
target
.
to_reference
,
[
event
.
project
.
namespace
.
becomes
(
Namespace
),
event
.
project
,
event
.
target
],
class:
'has-tooltip'
,
title:
event
.
target_title
...
...
changelogs/unreleased/50823-not-properly-filled-in-activity-RSS-feed-yml.yml
0 → 100644
View file @
00e42e3c
---
title
:
Fix links in RSS feed elements
merge_request
:
21424
author
:
Marc Schwede
type
:
fixed
spec/helpers/events_helper_spec.rb
View file @
00e42e3c
...
...
@@ -25,4 +25,47 @@ describe EventsHelper do
expect
(
helper
.
event_commit_title
(
"foo & bar"
)).
to
eq
(
"foo & bar"
)
end
end
describe
'#event_feed_url'
do
let
(
:event
)
{
create
(
:event
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
it
"returns project issue url"
do
event
.
target
=
create
(
:issue
)
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
project_issue_url
(
event
.
project
,
event
.
issue
))
end
it
"returns project merge_request url"
do
event
.
target
=
create
(
:merge_request
)
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
project_merge_request_url
(
event
.
project
,
event
.
merge_request
))
end
it
"returns project commit url"
do
event
.
target
=
create
(
:note_on_commit
,
project:
project
)
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
project_commit_url
(
event
.
project
,
event
.
note_target
))
end
it
"returns event note target url"
do
event
.
target
=
create
(
:note
)
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
event_note_target_url
(
event
))
end
it
"returns project url"
do
event
.
project
=
project
event
.
action
=
1
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
project_url
(
event
.
project
))
end
it
"returns push event feed url"
do
event
=
create
(
:push_event
)
create
(
:push_event_payload
,
event:
event
,
action: :pushed
)
expect
(
helper
.
event_feed_url
(
event
)).
to
eq
(
push_event_feed_url
(
event
))
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