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
d84eb9ab
Commit
d84eb9ab
authored
Nov 03, 2016
by
Lucas Deschamps
Committed by
Rémy Coutable
Nov 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issues atom feed url reflect filters on dashboard
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
651bdd7c
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
104 additions
and
12 deletions
+104
-12
app/views/dashboard/issues.atom.builder
app/views/dashboard/issues.atom.builder
+1
-1
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+2
-2
app/views/groups/issues.atom.builder
app/views/groups/issues.atom.builder
+1
-1
app/views/groups/issues.html.haml
app/views/groups/issues.html.haml
+2
-2
app/views/projects/issues/index.atom.builder
app/views/projects/issues/index.atom.builder
+1
-1
app/views/projects/issues/index.html.haml
app/views/projects/issues/index.html.haml
+2
-2
changelogs/unreleased/22947-fix_issues_atom_feed_url.yml
changelogs/unreleased/22947-fix_issues_atom_feed_url.yml
+4
-0
spec/features/atom/dashboard_issues_spec.rb
spec/features/atom/dashboard_issues_spec.rb
+11
-0
spec/features/atom/issues_spec.rb
spec/features/atom/issues_spec.rb
+28
-1
spec/features/dashboard_issues_spec.rb
spec/features/dashboard_issues_spec.rb
+18
-2
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+34
-0
No files found.
app/views/dashboard/issues.atom.builder
View file @
d84eb9ab
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "#{current_user.name} issues"
xml.link href:
issues_dashboard_url(format: :atom, private_token: current_user.try(:private_token)
), rel: "self", type: "application/atom+xml"
xml.link href:
url_for(params
), rel: "self", type: "application/atom+xml"
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
xml.id issues_dashboard_url
xml.updated @issues.first.created_at.xmlschema if @issues.reorder(nil).any?
...
...
app/views/dashboard/issues.html.haml
View file @
d84eb9ab
...
...
@@ -2,13 +2,13 @@
-
header_title
"Issues"
,
issues_dashboard_path
(
assignee_id:
current_user
.
id
)
=
content_for
:meta_tags
do
-
if
current_user
=
auto_discovery_link_tag
(
:atom
,
issues_dashboard_url
(
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
current_user
.
name
}
issues"
)
=
auto_discovery_link_tag
(
:atom
,
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
title:
"
#{
current_user
.
name
}
issues"
)
.top-area
=
render
'shared/issuable/nav'
,
type: :issues
.nav-controls
-
if
current_user
=
link_to
issues_dashboard_url
(
format: :atom
,
private_token:
current_user
.
private_token
),
class:
'btn'
do
=
link_to
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
class:
'btn'
do
=
icon
(
'rss'
)
%span
.icon-label
Subscribe
...
...
app/views/groups/issues.atom.builder
View file @
d84eb9ab
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "#{@group.name} issues"
xml.link href:
issues_group_url(format: :atom, private_token: current_user.try(:private_token)
), rel: "self", type: "application/atom+xml"
xml.link href:
url_for(params
), rel: "self", type: "application/atom+xml"
xml.link href: issues_group_url, rel: "alternate", type: "text/html"
xml.id issues_group_url
xml.updated @issues.first.created_at.xmlschema if @issues.reorder(nil).any?
...
...
app/views/groups/issues.html.haml
View file @
d84eb9ab
-
page_title
"Issues"
=
content_for
:meta_tags
do
-
if
current_user
=
auto_discovery_link_tag
(
:atom
,
issues_group_url
(
@group
,
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@group
.
name
}
issues"
)
=
auto_discovery_link_tag
(
:atom
,
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
title:
"
#{
@group
.
name
}
issues"
)
.top-area
=
render
'shared/issuable/nav'
,
type: :issues
.nav-controls
-
if
current_user
=
link_to
issues_group_url
(
@group
,
format: :atom
,
private_token:
current_user
.
private_token
),
class:
'btn'
do
=
link_to
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
class:
'btn'
do
=
icon
(
'rss'
)
%span
.icon-label
Subscribe
...
...
app/views/projects/issues/index.atom.builder
View file @
d84eb9ab
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "#{@project.name} issues"
xml.link href:
namespace_project_issues_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)
), rel: "self", type: "application/atom+xml"
xml.link href:
url_for(params
), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.id namespace_project_issues_url(@project.namespace, @project)
xml.updated @issues.first.created_at.xmlschema if @issues.reorder(nil).any?
...
...
app/views/projects/issues/index.html.haml
View file @
d84eb9ab
...
...
@@ -8,7 +8,7 @@
=
content_for
:meta_tags
do
-
if
current_user
=
auto_discovery_link_tag
(
:atom
,
namespace_project_issues_url
(
@project
.
namespace
,
@project
,
:atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@project
.
name
}
issues"
)
=
auto_discovery_link_tag
(
:atom
,
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
title:
"
#{
@project
.
name
}
issues"
)
%div
{
class:
(
container_class
)
}
-
if
@project
.
issues
.
any?
...
...
@@ -16,7 +16,7 @@
=
render
'shared/issuable/nav'
,
type: :issues
.nav-controls
-
if
current_user
=
link_to
namespace_project_issues_path
(
@project
.
namespace
,
@project
,
:atom
,
{
private_token:
current_user
.
private_token
}
),
class:
'btn append-right-10'
do
=
link_to
url_for
(
params
.
merge
(
format: :atom
,
private_token:
current_user
.
private_token
)
),
class:
'btn append-right-10'
do
=
icon
(
'rss'
)
%span
.icon-label
Subscribe
...
...
changelogs/unreleased/22947-fix_issues_atom_feed_url.yml
0 → 100644
View file @
d84eb9ab
---
title
:
Issues atom feed url reflect filters on dashboard
merge_request
:
7114
author
:
Lucas Deschamps
spec/features/atom/dashboard_issues_spec.rb
View file @
d84eb9ab
...
...
@@ -19,6 +19,17 @@ describe "Dashboard Issues Feed", feature: true do
expect
(
body
).
to
have_selector
(
'title'
,
text:
"
#{
user
.
name
}
issues"
)
end
it
"renders atom feed with url parameters"
do
visit
issues_dashboard_path
(
:atom
,
private_token:
user
.
private_token
,
state:
'opened'
,
assignee_id:
user
.
id
)
link
=
find
(
'link[type="application/atom+xml"]'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'state'
=>
[
'opened'
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
context
"issue with basic fields"
do
let!
(
:issue2
)
{
create
(
:issue
,
author:
user
,
assignee:
user
,
project:
project2
,
description:
'test desc'
)
}
...
...
spec/features/atom/issues_spec.rb
View file @
d84eb9ab
...
...
@@ -3,10 +3,14 @@ require 'spec_helper'
describe
'Issues Feed'
,
feature:
true
do
describe
'GET /issues'
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:issue
)
{
create
(
:issue
,
author:
user
,
project:
project
)
}
before
{
project
.
team
<<
[
user
,
:developer
]
}
before
do
project
.
team
<<
[
user
,
:developer
]
group
.
add_developer
(
user
)
end
context
'when authenticated'
do
it
'renders atom feed'
do
...
...
@@ -33,5 +37,28 @@ describe 'Issues Feed', feature: true do
expect
(
body
).
to
have_selector
(
'entry summary'
,
text:
issue
.
title
)
end
end
it
"renders atom feed with url parameters for project issues"
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
,
private_token:
user
.
private_token
,
state:
'opened'
,
assignee_id:
user
.
id
)
link
=
find
(
'link[type="application/atom+xml"]'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'state'
=>
[
'opened'
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
it
"renders atom feed with url parameters for group issues"
do
visit
issues_group_path
(
group
,
:atom
,
private_token:
user
.
private_token
,
state:
'opened'
,
assignee_id:
user
.
id
)
link
=
find
(
'link[type="application/atom+xml"]'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'state'
=>
[
'opened'
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
end
end
spec/features/dashboard_issues_spec.rb
View file @
d84eb9ab
...
...
@@ -44,6 +44,22 @@ describe "Dashboard Issues filtering", feature: true, js: true do
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
it
'updates atom feed link'
do
visit_issues
(
milestone_title:
''
,
assignee_id:
user
.
id
)
link
=
find
(
'.nav-controls a'
,
text:
'Subscribe'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
::
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
end
def
show_milestone_dropdown
...
...
@@ -51,7 +67,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.dropdown-content'
,
visible:
true
)
end
def
visit_issues
visit
issues_dashboard_path
def
visit_issues
(
*
args
)
visit
issues_dashboard_path
(
*
args
)
end
end
spec/features/issues/filter_issues_spec.rb
View file @
d84eb9ab
...
...
@@ -4,6 +4,7 @@ describe 'Filter issues', feature: true do
include
WaitForAjax
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
)
}
...
...
@@ -11,6 +12,7 @@ describe 'Filter issues', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
group
.
add_developer
(
user
)
login_as
(
user
)
create
(
:issue
,
project:
project
)
end
...
...
@@ -347,4 +349,36 @@ describe 'Filter issues', feature: true do
end
end
end
it
'updates atom feed link for project issues'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_title:
''
,
assignee_id:
user
.
id
)
link
=
find
(
'.nav-controls a'
,
text:
'Subscribe'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
::
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
it
'updates atom feed link for group issues'
do
visit
issues_group_path
(
group
,
milestone_title:
''
,
assignee_id:
user
.
id
)
link
=
find
(
'.nav-controls a'
,
text:
'Subscribe'
)
params
=
CGI
::
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
::
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'private_token'
=>
[
user
.
private_token
])
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
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