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
2de0bcf8
Commit
2de0bcf8
authored
Feb 27, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redirecting to last visited board
Move this to EE-only. It isn't useful here since there's only one board
parent
7d5ee418
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
56 deletions
+0
-56
app/controllers/concerns/boards_actions.rb
app/controllers/concerns/boards_actions.rb
+0
-16
spec/controllers/groups/boards_controller_spec.rb
spec/controllers/groups/boards_controller_spec.rb
+0
-20
spec/controllers/projects/boards_controller_spec.rb
spec/controllers/projects/boards_controller_spec.rb
+0
-20
No files found.
app/controllers/concerns/boards_actions.rb
View file @
2de0bcf8
...
@@ -7,7 +7,6 @@ module BoardsActions
...
@@ -7,7 +7,6 @@ module BoardsActions
included
do
included
do
include
BoardsResponses
include
BoardsResponses
before_action
:redirect_to_recent_board
,
only: :index
before_action
:boards
,
only: :index
before_action
:boards
,
only: :index
before_action
:board
,
only: :show
before_action
:board
,
only: :show
end
end
...
@@ -25,21 +24,6 @@ module BoardsActions
...
@@ -25,21 +24,6 @@ module BoardsActions
private
private
def
redirect_to_recent_board
return
if
request
.
format
.
json?
if
recently_visited
=
Boards
::
Visits
::
LatestService
.
new
(
board_parent
,
current_user
).
execute
board_path
=
case
board_parent
when
Project
namespace_project_board_path
(
id:
recently_visited
.
board_id
)
when
Group
group_board_path
(
id:
recently_visited
.
board_id
)
end
redirect_to
board_path
end
end
def
boards
def
boards
strong_memoize
(
:boards
)
do
strong_memoize
(
:boards
)
do
Boards
::
ListService
.
new
(
parent
,
current_user
).
execute
Boards
::
ListService
.
new
(
parent
,
current_user
).
execute
...
...
spec/controllers/groups/boards_controller_spec.rb
View file @
2de0bcf8
...
@@ -22,26 +22,6 @@ describe Groups::BoardsController do
...
@@ -22,26 +22,6 @@ describe Groups::BoardsController do
expect
(
response
.
content_type
).
to
eq
'text/html'
expect
(
response
.
content_type
).
to
eq
'text/html'
end
end
it
'redirects to latest visited board'
do
board
=
create
(
:board
,
group:
group
)
create
(
:board_group_recent_visit
,
group:
board
.
group
,
board:
board
,
user:
user
)
list_boards
expect
(
response
).
to
redirect_to
(
group_board_path
(
id:
board
.
id
))
end
it
'renders template if visited board is not found'
do
temporary_board
=
create
(
:board
,
group:
group
)
create
(
:board_group_recent_visit
,
group:
temporary_board
.
group
,
board:
temporary_board
,
user:
user
)
temporary_board
.
delete
list_boards
expect
(
response
).
to
render_template
:index
expect
(
response
.
content_type
).
to
eq
'text/html'
end
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_cross_project
,
:global
).
and_return
(
true
)
...
...
spec/controllers/projects/boards_controller_spec.rb
View file @
2de0bcf8
...
@@ -28,26 +28,6 @@ describe Projects::BoardsController do
...
@@ -28,26 +28,6 @@ describe Projects::BoardsController do
expect
(
response
.
content_type
).
to
eq
'text/html'
expect
(
response
.
content_type
).
to
eq
'text/html'
end
end
it
'redirects to latest visited board'
do
board
=
create
(
:board
,
project:
project
)
create
(
:board_project_recent_visit
,
project:
board
.
project
,
board:
board
,
user:
user
)
list_boards
expect
(
response
).
to
redirect_to
(
namespace_project_board_path
(
id:
board
.
id
))
end
it
'renders template if visited board is not found'
do
temporary_board
=
create
(
:board
,
project:
project
)
create
(
:board_project_recent_visit
,
project:
temporary_board
.
project
,
board:
temporary_board
,
user:
user
)
temporary_board
.
delete
list_boards
expect
(
response
).
to
render_template
:index
expect
(
response
.
content_type
).
to
eq
'text/html'
end
context
'with unauthorized user'
do
context
'with unauthorized user'
do
before
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project
,
project
).
and_return
(
true
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project
,
project
).
and_return
(
true
)
...
...
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