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
Show 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
-
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,11 +7,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do
let!
(
:board
)
{
create
(
:board
,
project:
project
)
}
let!
(
:board2
)
{
create
(
:board
,
project:
project
)
}
context
'with multiple issue boards enabled'
do
before
do
stub_licensed_features
(
multiple_issue_boards:
true
)
end
context
'authorized user'
do
before
do
project
.
team
<<
[
user
,
:master
]
gitlab_sign_in
(
user
)
login_as
(
user
)
visit
project_boards_path
(
project
)
wait_for_requests
...
...
@@ -50,18 +55,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button
board
.
name
page
.
within
(
'.dropdown-menu'
)
do
click_link
'Edit board name
'
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'
click_button
'Creat
e'
end
wait_for_requests
page
.
within
(
'.dropdown-menu'
)
do
expect
(
page
).
to
have_content
(
'Testing'
)
end
expect
(
page
).
to
have_button
(
'This is a new board'
)
end
it
'edits board name'
do
...
...
@@ -158,4 +161,27 @@ describe 'Multiple Issue Boards', feature: true, js: true do
end
end
end
end
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
'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
).
to
have_content
(
'Delete board'
)
end
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