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
Tatuya Kamada
gitlab-ce
Commits
41b6cfcf
Commit
41b6cfcf
authored
Jan 20, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
automatically redirect urls containing author_id or assignee_id
parent
ff75bd04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+18
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
41b6cfcf
...
@@ -23,6 +23,8 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -23,6 +23,8 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to
:html
respond_to
:html
def
index
def
index
return
redirect_to_fixed_params
if
params
[
:assignee_id
].
present?
||
params
[
:author_id
].
present?
@issues
=
issues_collection
@issues
=
issues_collection
@issues
=
@issues
.
page
(
params
[
:page
])
@issues
=
@issues
.
page
(
params
[
:page
])
if
@issues
.
out_of_range?
&&
@issues
.
total_pages
!=
0
if
@issues
.
out_of_range?
&&
@issues
.
total_pages
!=
0
...
@@ -211,6 +213,22 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -211,6 +213,22 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
end
end
def
redirect_to_fixed_params
fixed_params
=
params
.
except
(
:assignee_id
,
:author_id
)
if
params
[
:assignee_id
].
present?
assignee
=
User
.
find_by_id
(
params
[
:assignee_id
])
fixed_params
.
merge!
(
assignee_username:
assignee
.
username
)
if
assignee
end
if
params
[
:author_id
].
present?
author
=
User
.
find_by_id
(
params
[
:author_id
])
fixed_params
.
merge!
(
author_username:
author
.
username
)
if
author
end
redirect_to
url_for
(
fixed_params
)
end
# Since iids are implemented only in 6.1
# Since iids are implemented only in 6.1
# user may navigate to issue page using old global ids.
# user may navigate to issue page using old global ids.
#
#
...
...
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