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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
07016077
Commit
07016077
authored
Jun 30, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide `new board`link when multiple issue boards isn't available
parent
fd3c2b5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
89 deletions
+117
-89
app/views/projects/boards/_switcher.html.haml
app/views/projects/boards/_switcher.html.haml
+5
-3
spec/features/boards/multiple_boards_spec.rb
spec/features/boards/multiple_boards_spec.rb
+112
-86
No files found.
app/views/projects/boards/_switcher.html.haml
View file @
07016077
...
...
@@ -43,9 +43,11 @@
-
if
can?
(
current_user
,
:admin_board
,
@project
)
.dropdown-footer
{
"v-if"
=>
"currentPage === ''"
}
%ul
.dropdown-footer-list
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('new')"
}
Create new board
-
if
@project
.
feature_available?
(
:multiple_issue_boards
)
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('new')"
}
Create new board
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('edit')"
}
Edit board name
...
...
spec/features/boards/multiple_boards_spec.rb
View file @
07016077
...
...
@@ -7,154 +7,180 @@ describe 'Multiple Issue Boards', feature: true, js: true do
let!
(
:board
)
{
create
(
:board
,
project:
project
)
}
let!
(
:board2
)
{
create
(
:board
,
project:
project
)
}
context
'
authorized user
'
do
context
'
with multiple issue boards enabled
'
do
before
do
project
.
team
<<
[
user
,
:master
]
stub_licensed_features
(
multiple_issue_boards:
true
)
end
gitlab_sign_in
(
user
)
context
'authorized user'
do
before
do
project
.
team
<<
[
user
,
:master
]
visit
project_boards_path
(
project
)
wait_for_requests
end
login_as
(
user
)
it
'shows current board name'
do
page
.
within
(
'.boards-switcher'
)
do
expect
(
page
).
to
have_content
(
board
.
name
)
visit
project_boards_path
(
project
)
wait_for_requests
end
end
it
'shows a list of boards'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
board
.
name
)
expect
(
page
).
to
have_content
(
board2
.
name
)
it
'shows current board name'
do
page
.
within
(
'.boards-switcher'
)
do
expect
(
page
).
to
have_content
(
board
.
name
)
end
end
end
it
'switches current board
'
do
click_button
board
.
name
it
'shows a list of boards
'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
click_link
board2
.
name
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
board
.
name
)
expect
(
page
).
to
have_content
(
board2
.
name
)
end
end
wait_for_requests
it
'switches current board'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
click_link
board2
.
name
end
page
.
within
(
'.boards-switcher'
)
do
expect
(
page
).
to
have_content
(
board2
.
name
)
wait_for_requests
page
.
within
(
'.boards-switcher'
)
do
expect
(
page
).
to
have_content
(
board2
.
name
)
end
end
end
it
'creates new board'
do
click_button
board
.
name
it
'creates new board'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Edit board name
'
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Create new board
'
fill_in
'board-new-name'
,
with:
'Testing
'
fill_in
'board-new-name'
,
with:
'This is a new board
'
click_button
'Sav
e'
end
click_button
'Creat
e'
end
wait_for_requests
wait_for_requests
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
'Testing'
)
expect
(
page
).
to
have_button
(
'This is a new board'
)
end
end
it
'edits board name'
do
click_button
board
.
name
it
'edits board name'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Edit board name'
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Edit board name'
fill_in
'board-new-name'
,
with:
'Testing'
fill_in
'board-new-name'
,
with:
'Testing'
click_button
'Save'
end
click_button
'Save'
end
wait_for_requests
wait_for_requests
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
'Testing'
)
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
'Testing'
)
end
end
end
it
'deletes board'
do
click_button
board
.
name
it
'deletes board'
do
click_button
board
.
name
wait_for_requests
wait_for_requests
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Delete board'
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Delete board'
page
.
within
(
'.dropdown-title'
)
do
expect
(
page
).
to
have_content
(
'Delete board'
)
page
.
within
(
'.dropdown-title'
)
do
expect
(
page
).
to
have_content
(
'Delete board'
)
end
click_link
'Delete'
end
click_link
'Delete'
click_button
board2
.
name
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
not_to
have_content
(
board
.
name
)
expect
(
page
).
to
have_content
(
board2
.
name
)
end
end
click_button
board2
.
name
it
'adds a list to the none default board'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
not_to
have_content
(
board
.
name
)
expect
(
page
).
to
have_content
(
board2
.
name
)
end
end
page
.
within
(
'.dropdown-menu'
)
do
click_link
board2
.
name
end
it
'adds a list to the none default board'
do
click_button
board
.
name
wait_for_requests
page
.
within
(
'.dropdown-menu
'
)
do
click_link
board2
.
name
end
page
.
within
(
'.boards-switcher
'
)
do
expect
(
page
).
to
have_content
(
board2
.
name
)
end
wait_for_requests
click_button
'Add list'
page
.
within
(
'.boards-switcher'
)
do
expect
(
page
).
to
have_content
(
board2
.
name
)
end
wait_for_requests
click_button
'Add list'
page
.
within
'.dropdown-menu-issues-board-new'
do
click_link
planning
.
title
end
wait_for_requests
wait_for_requests
page
.
within
'.dropdown-menu-issues-board-new'
do
click_link
planning
.
title
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
wait_for_requests
click_button
board2
.
name
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
page
.
within
(
'.dropdown-menu'
)
do
click_link
board
.
name
end
click_button
board2
.
name
wait_for_requests
page
.
within
(
'.dropdown-menu'
)
do
click_link
board
.
name
expect
(
page
).
to
have_selector
(
'.board'
,
count:
2
)
end
end
context
'unauthorized user'
do
before
do
visit
project_boards_path
(
project
)
wait_for_requests
end
wait_for_requests
it
'does not show action links'
do
click_button
board
.
name
expect
(
page
).
to
have_selector
(
'.board'
,
count:
2
)
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
not_to
have_content
(
'Create new board'
)
expect
(
page
).
not_to
have_content
(
'Edit board name'
)
expect
(
page
).
not_to
have_content
(
'Delete board'
)
end
end
end
end
context
'
unauthorized user
'
do
context
'
with multiple issue boards disabled
'
do
before
do
stub_licensed_features
(
multiple_issue_boards:
false
)
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
visit
project_boards_path
(
project
)
wait_for_requests
end
it
'
does not show action links
'
do
it
'
hides the link to create a new board
'
do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
'Edit board name'
)
expect
(
page
).
not_to
have_content
(
'Create new board'
)
expect
(
page
).
not_to
have_content
(
'Edit board name'
)
expect
(
page
).
not_to
have_content
(
'Delete board'
)
expect
(
page
).
to
have_content
(
'Delete board'
)
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