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
9a425c3f
Commit
9a425c3f
authored
Aug 17, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed permissions around create new list button
parent
77a074a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+1
-1
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+27
-1
No files found.
app/views/shared/issuable/_filter.html.haml
View file @
9a425c3f
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
.pull-right
.pull-right
-
if
controller
.
controller_name
!=
'boards'
-
if
controller
.
controller_name
!=
'boards'
=
render
'shared/sort_dropdown'
=
render
'shared/sort_dropdown'
-
elsif
current_user
-
if
can?
(
current_user
,
:admin_list
,
@project
)
.dropdown
.dropdown
%button
.btn.btn-create.js-new-board-list
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
labels:
labels_filter_path
,
project_id:
@project
.
try
(
:id
)
}
}
%button
.btn.btn-create.js-new-board-list
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
labels:
labels_filter_path
,
project_id:
@project
.
try
(
:id
)
}
}
Create new list
Create new list
...
...
spec/features/boards/boards_spec.rb
View file @
9a425c3f
...
@@ -3,7 +3,7 @@ require 'rails_helper'
...
@@ -3,7 +3,7 @@ require 'rails_helper'
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
include
WaitForAjax
include
WaitForAjax
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:user2
)
{
create
(
:user
)
}
let!
(
:user2
)
{
create
(
:user
)
}
...
@@ -561,6 +561,32 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -561,6 +561,32 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
context
'signed out user'
do
before
do
logout
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
end
it
'does not show create new list'
do
expect
(
page
).
not_to
have_selector
(
'.js-new-board-list'
)
end
end
context
'as guest user'
do
let
(
:user_guest
)
{
create
(
:user
)
}
before
do
project
.
team
<<
[
user_guest
,
:guest
]
logout
login_as
(
user_guest
)
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
end
it
'does not show create new list'
do
expect
(
page
).
not_to
have_selector
(
'.js-new-board-list'
)
end
end
def
drag_to
(
list_from_index:
0
,
card_index:
0
,
to_index:
0
,
list_to_index:
0
,
selector:
'.board-list'
)
def
drag_to
(
list_from_index:
0
,
card_index:
0
,
to_index:
0
,
list_to_index:
0
,
selector:
'.board-list'
)
evaluate_script
(
"simulateDrag({scrollable: document.getElementById('board-app'), from: {el: $('
#{
selector
}
').eq(
#{
list_from_index
}
).get(0), index:
#{
card_index
}
}, to: {el: $('.board-list').eq(
#{
list_to_index
}
).get(0), index:
#{
to_index
}
}});"
)
evaluate_script
(
"simulateDrag({scrollable: document.getElementById('board-app'), from: {el: $('
#{
selector
}
').eq(
#{
list_from_index
}
).get(0), index:
#{
card_index
}
}, to: {el: $('.board-list').eq(
#{
list_to_index
}
).get(0), index:
#{
to_index
}
}});"
)
...
...
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