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
Léo-Paul Géneau
gitlab-ce
Commits
8077b728
Commit
8077b728
authored
Aug 31, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue BE backport
parent
f2a43ff5
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
55 additions
and
9 deletions
+55
-9
app/controllers/boards/issues_controller.rb
app/controllers/boards/issues_controller.rb
+1
-0
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+1
-0
app/controllers/concerns/boards_responses.rb
app/controllers/concerns/boards_responses.rb
+42
-0
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+1
-1
app/models/label.rb
app/models/label.rb
+1
-0
app/services/boards/lists/create_service.rb
app/services/boards/lists/create_service.rb
+1
-1
app/services/boards/lists/destroy_service.rb
app/services/boards/lists/destroy_service.rb
+1
-1
app/services/boards/lists/generate_service.rb
app/services/boards/lists/generate_service.rb
+1
-1
app/services/boards/lists/list_service.rb
app/services/boards/lists/list_service.rb
+1
-1
app/services/boards/lists/move_service.rb
app/services/boards/lists/move_service.rb
+1
-1
doc/README.md
doc/README.md
+1
-1
spec/controllers/boards/issues_controller_spec.rb
spec/controllers/boards/issues_controller_spec.rb
+0
-0
spec/controllers/boards/lists_controller_spec.rb
spec/controllers/boards/lists_controller_spec.rb
+0
-0
spec/fixtures/api/schemas/issue.json
spec/fixtures/api/schemas/issue.json
+1
-0
spec/services/boards/issues/move_service_spec.rb
spec/services/boards/issues/move_service_spec.rb
+1
-1
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-1
No files found.
app/controllers/boards/issues_controller.rb
View file @
8077b728
...
...
@@ -5,6 +5,7 @@ module Boards
before_action
:authorize_read_issue
,
only:
[
:index
]
before_action
:authorize_create_issue
,
only:
[
:create
]
before_action
:authorize_update_issue
,
only:
[
:update
]
skip_before_action
:authenticate_user!
,
only:
[
:index
]
def
index
issues
=
Boards
::
Issues
::
ListService
.
new
(
board_parent
,
current_user
,
filter_params
).
execute
...
...
app/controllers/boards/lists_controller.rb
View file @
8077b728
...
...
@@ -4,6 +4,7 @@ module Boards
before_action
:authorize_admin_list
,
only:
[
:create
,
:update
,
:destroy
,
:generate
]
before_action
:authorize_read_list
,
only:
[
:index
]
skip_before_action
:authenticate_user!
,
only:
[
:index
]
def
index
lists
=
Boards
::
Lists
::
ListService
.
new
(
board
.
parent
,
current_user
).
execute
(
board
)
...
...
app/controllers/concerns/boards_responses.rb
0 → 100644
View file @
8077b728
module
BoardsResponses
def
authorize_read_list
authorize_action_for!
(
board
.
parent
,
:read_list
)
end
def
authorize_read_issue
authorize_action_for!
(
board
.
parent
,
:read_issue
)
end
def
authorize_update_issue
authorize_action_for!
(
issue
,
:admin_issue
)
end
def
authorize_create_issue
authorize_action_for!
(
project
,
:admin_issue
)
end
def
authorize_admin_list
authorize_action_for!
(
board
.
parent
,
:admin_list
)
end
def
authorize_action_for!
(
resource
,
ability
)
return
render_403
unless
can?
(
current_user
,
ability
,
resource
)
end
def
respond_with_boards
respond_with
(
@boards
)
end
def
respond_with_board
respond_with
(
@board
)
end
def
respond_with
(
resource
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
serialize_as_json
(
resource
)
end
end
end
end
app/controllers/projects/boards_controller.rb
View file @
8077b728
class
Projects::BoardsController
<
Projects
::
ApplicationController
include
IssuableCollections
include
BoardsResponses
include
IssuableCollections
before_action
:authorize_read_board!
,
only:
[
:index
,
:show
]
before_action
:assign_endpoint_vars
...
...
app/models/label.rb
View file @
8077b728
...
...
@@ -173,6 +173,7 @@ class Label < ActiveRecord::Base
def
as_json
(
options
=
{})
super
(
options
).
tap
do
|
json
|
json
[
:type
]
=
self
.
type
json
[
:priority
]
=
priority
(
options
[
:project
])
if
options
.
key?
(
:project
)
end
end
...
...
app/services/boards/lists/create_service.rb
View file @
8077b728
module
Boards
module
Lists
class
CreateService
<
BaseService
class
CreateService
<
B
oards
::
B
aseService
def
execute
(
board
)
List
.
transaction
do
label
=
available_labels_for
(
board
).
find
(
params
[
:label_id
])
...
...
app/services/boards/lists/destroy_service.rb
View file @
8077b728
module
Boards
module
Lists
class
DestroyService
<
BaseService
class
DestroyService
<
B
oards
::
B
aseService
def
execute
(
list
)
return
false
unless
list
.
destroyable?
...
...
app/services/boards/lists/generate_service.rb
View file @
8077b728
module
Boards
module
Lists
class
GenerateService
<
BaseService
class
GenerateService
<
B
oards
::
B
aseService
def
execute
(
board
)
return
false
unless
board
.
lists
.
movable
.
empty?
...
...
app/services/boards/lists/list_service.rb
View file @
8077b728
module
Boards
module
Lists
class
ListService
<
BaseService
class
ListService
<
B
oards
::
B
aseService
def
execute
(
board
)
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
exists?
...
...
app/services/boards/lists/move_service.rb
View file @
8077b728
module
Boards
module
Lists
class
MoveService
<
BaseService
class
MoveService
<
B
oards
::
B
aseService
def
execute
(
list
)
@board
=
list
.
board
@old_position
=
list
.
position
...
...
doc/README.md
View file @
8077b728
...
...
@@ -82,7 +82,7 @@ Manage your [repositories](user/project/repository/index.md) from the UI (user i
-
[
Discussions
](
user/discussions/index.md
)
Threads, comments, and resolvable discussions in issues, commits, and merge requests.
-
[
Issues
](
user/project/issues/index.md
)
-
[
I
ssue Board
](
user/project/issue_board.md
)
-
[
Project i
ssue Board
](
user/project/issue_board.md
)
-
[
Issues and merge requests templates
](
user/project/description_templates.md
)
: Create templates for submitting new issues and merge requests.
-
[
Labels
](
user/project/labels.md
)
: Categorize your issues or merge requests based on descriptive titles.
-
[
Merge Requests
](
user/project/merge_requests/index.md
)
...
...
spec/controllers/
projects/
boards/issues_controller_spec.rb
→
spec/controllers/boards/issues_controller_spec.rb
View file @
8077b728
File moved
spec/controllers/
projects/
boards/lists_controller_spec.rb
→
spec/controllers/boards/lists_controller_spec.rb
View file @
8077b728
File moved
spec/fixtures/api/schemas/issue.json
View file @
8077b728
...
...
@@ -34,6 +34,7 @@
"type"
:
"string"
,
"pattern"
:
"^#[0-9A-Fa-f]{3}{1,2}+$"
},
"type"
:
{
"type"
:
"string"
},
"title"
:
{
"type"
:
"string"
},
"priority"
:
{
"type"
:
[
"integer"
,
"null"
]
}
},
...
...
spec/services/boards/issues/move_service_spec.rb
View file @
8077b728
...
...
@@ -98,7 +98,7 @@ describe Boards::Issues::MoveService do
issue
.
move_to_end
&&
issue
.
save!
end
params
.
merge!
(
move_after_i
id:
issue1
.
iid
,
move_before_iid:
issue2
.
i
id
)
params
.
merge!
(
move_after_i
d:
issue1
.
id
,
move_before_id:
issue2
.
id
)
described_class
.
new
(
project
,
user
,
params
).
execute
(
issue
)
...
...
spec/services/issues/update_service_spec.rb
View file @
8077b728
...
...
@@ -80,7 +80,7 @@ describe Issues::UpdateService, :mailer do
issue
.
save
end
opts
[
:move_between_i
ids
]
=
[
issue1
.
iid
,
issue2
.
i
id
]
opts
[
:move_between_i
ds
]
=
[
issue1
.
id
,
issue2
.
id
]
update_issue
(
opts
)
...
...
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