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
a21fda3f
Commit
a21fda3f
authored
Jul 28, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to manage group boards and lists
parent
951fbe6d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
13 deletions
+60
-13
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+1
-1
app/controllers/ee/boards/boards_controller.rb
app/controllers/ee/boards/boards_controller.rb
+18
-6
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+11
-0
app/controllers/groups/labels_controller.rb
app/controllers/groups/labels_controller.rb
+7
-1
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+18
-0
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+2
-2
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+3
-3
No files found.
app/controllers/boards/lists_controller.rb
View file @
a21fda3f
...
...
@@ -34,7 +34,7 @@ module Boards
def
destroy
list
=
board
.
lists
.
destroyable
.
find
(
params
[
:id
])
service
=
Boards
::
Lists
::
DestroyService
.
new
(
projec
t
,
current_user
)
service
=
Boards
::
Lists
::
DestroyService
.
new
(
board_paren
t
,
current_user
)
if
service
.
execute
(
list
)
head
:ok
...
...
app/controllers/ee/boards/boards_controller.rb
View file @
a21fda3f
...
...
@@ -9,7 +9,7 @@ module EE
end
def
create
board
=
::
Boards
::
CreateService
.
new
(
p
rojec
t
,
current_user
,
board_params
).
execute
board
=
::
Boards
::
CreateService
.
new
(
p
aren
t
,
current_user
,
board_params
).
execute
respond_to
do
|
format
|
format
.
json
do
...
...
@@ -23,7 +23,7 @@ module EE
end
def
update
service
=
::
Boards
::
UpdateService
.
new
(
p
rojec
t
,
current_user
,
board_params
)
service
=
::
Boards
::
UpdateService
.
new
(
p
aren
t
,
current_user
,
board_params
)
service
.
execute
(
@board
)
...
...
@@ -39,18 +39,18 @@ module EE
end
def
destroy
service
=
::
Boards
::
DestroyService
.
new
(
p
rojec
t
,
current_user
)
service
=
::
Boards
::
DestroyService
.
new
(
p
aren
t
,
current_user
)
service
.
execute
(
@board
)
respond_to
do
|
format
|
format
.
html
{
redirect_to
project_boards_path
(
@project
)
,
status:
302
}
format
.
html
{
redirect_to
boards_path
,
status:
302
}
end
end
private
def
authorize_admin_board!
return
render_404
unless
can?
(
current_user
,
:admin_board
,
p
rojec
t
)
return
render_404
unless
can?
(
current_user
,
:admin_board
,
p
aren
t
)
end
def
board_params
...
...
@@ -58,7 +58,19 @@ module EE
end
def
find_board
@board
=
project
.
boards
.
find
(
params
[
:id
])
@board
=
parent
.
boards
.
find
(
params
[
:id
])
end
def
parent
@parent
||=
@project
||
@group
end
def
boards_path
if
parent
.
is_a?
(
Group
)
group_boards_path
(
parent
)
else
project_boards_path
(
parent
)
end
end
def
serialize_as_json
(
resource
)
...
...
app/controllers/groups/boards_controller.rb
View file @
a21fda3f
...
...
@@ -15,6 +15,17 @@ class Groups::BoardsController < Groups::ApplicationController
end
end
def
show
@board
=
group
.
boards
.
find
(
params
[
:id
])
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
serialize_as_json
(
@board
)
end
end
end
def
assign_endpoint_vars
@boards_endpoint
=
group_boards_path
(
group
)
@issues_path
=
issues_group_path
(
group
)
...
...
app/controllers/groups/labels_controller.rb
View file @
a21fda3f
...
...
@@ -14,7 +14,13 @@ class Groups::LabelsController < Groups::ApplicationController
end
format
.
json
do
available_labels
=
LabelsFinder
.
new
(
current_user
,
group_id:
@group
.
id
).
execute
available_labels
=
if
params
[
:group_labels_only
]
LabelsFinder
.
new
(
current_user
,
group_id:
@group
.
id
).
execute
else
group
.
labels
end
render
json:
LabelSerializer
.
new
.
represent_appearance
(
available_labels
)
end
end
...
...
app/helpers/boards_helper.rb
View file @
a21fda3f
...
...
@@ -53,4 +53,22 @@ module BoardsHelper
def
current_board_parent
@current_board_parent
||=
@project
||
@group
end
def
can_create_board_list?
board_parent
=
@project
||
@group
can?
(
current_user
,
:admin_list
,
board_parent
)
end
def
board_list_data
namespace_path
=
current_board_parent
.
try
(
:path
)
||
current_board_parent
.
namespace
.
try
(
:path
)
{
toggle:
"dropdown"
,
labels:
labels_filter_path
(
only_group_labels:
true
),
namespace_path:
namespace_path
,
project_path:
@project
&
.
try
(
:path
),
# Change this one on JS to use a single property: parent_path
group_path:
@group
&
.
try
(
:path
)
# Same here
}
end
end
app/helpers/labels_helper.rb
View file @
a21fda3f
...
...
@@ -121,8 +121,8 @@ module LabelsHelper
end
end
def
labels_filter_path
return
group_labels_path
(
@group
,
:json
)
if
@group
def
labels_filter_path
(
only_group_labels
=
false
)
return
group_labels_path
(
@group
,
:json
,
only_group_labels:
only_group_labels
)
if
@group
project
=
@target_project
||
@project
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
a21fda3f
...
...
@@ -116,13 +116,13 @@
=
icon
(
'times'
)
.filter-dropdown-container
-
if
type
==
:boards
-
if
can
?
(
current_user
,
:admin_list
,
@project
)
-
if
can
_create_board_list?
.dropdown.prepend-left-10
#js-add-list
%button
.btn.btn-create.btn-inverted.js-new-board-list
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
labels:
labels_filter_path
,
namespace_path:
@project
.
try
(
:namespace
).
try
(
:path
),
project_path:
@project
.
try
(
:path
)
}
}
%button
.btn.btn-create.btn-inverted.js-new-board-list
{
type:
"button"
,
data:
board_list_data
}
Add list
.dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
show_footer:
true
,
show_create:
true
,
show_boards_content:
true
,
title:
"Add list"
}
-
if
can?
(
current_user
,
:admin_label
,
@projec
t
)
-
if
can?
(
current_user
,
:admin_label
,
current_board_paren
t
)
=
render
partial:
"shared/issuable/label_page_create"
=
dropdown_loading
#js-add-issues-btn
.prepend-left-10
...
...
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