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
c3880d10
Commit
c3880d10
authored
Aug 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract `Projects::Boards::ApplicationController`
parent
57737785
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
app/controllers/projects/boards/application_controller.rb
app/controllers/projects/boards/application_controller.rb
+15
-0
app/controllers/projects/boards/issues_controller.rb
app/controllers/projects/boards/issues_controller.rb
+1
-9
app/controllers/projects/boards/lists_controller.rb
app/controllers/projects/boards/lists_controller.rb
+1
-9
No files found.
app/controllers/projects/boards/application_controller.rb
0 → 100644
View file @
c3880d10
module
Projects
module
Boards
class
ApplicationController
<
Projects
::
ApplicationController
respond_to
:json
rescue_from
ActiveRecord
::
RecordNotFound
,
with: :record_not_found
private
def
record_not_found
(
exception
)
render
json:
{
error:
exception
.
message
},
status: :not_found
end
end
end
end
app/controllers/projects/boards/issues_controller.rb
View file @
c3880d10
module
Projects
module
Projects
module
Boards
module
Boards
class
IssuesController
<
Projects
::
ApplicationController
class
IssuesController
<
Boards
::
ApplicationController
respond_to
:json
before_action
:authorize_read_issue!
,
only:
[
:index
]
before_action
:authorize_read_issue!
,
only:
[
:index
]
before_action
:authorize_update_issue!
,
only:
[
:update
]
before_action
:authorize_update_issue!
,
only:
[
:update
]
rescue_from
ActiveRecord
::
RecordNotFound
,
with: :record_not_found
def
index
def
index
issues
=
::
Boards
::
Issues
::
ListService
.
new
(
project
,
current_user
,
filter_params
).
execute
issues
=
::
Boards
::
Issues
::
ListService
.
new
(
project
,
current_user
,
filter_params
).
execute
issues
=
issues
.
page
(
params
[
:page
])
issues
=
issues
.
page
(
params
[
:page
])
...
@@ -47,10 +43,6 @@ module Projects
...
@@ -47,10 +43,6 @@ module Projects
def
move_params
def
move_params
params
.
permit
(
:id
,
:from_list_id
,
:to_list_id
)
params
.
permit
(
:id
,
:from_list_id
,
:to_list_id
)
end
end
def
record_not_found
(
exception
)
render
json:
{
error:
exception
.
message
},
status: :not_found
end
end
end
end
end
end
end
app/controllers/projects/boards/lists_controller.rb
View file @
c3880d10
module
Projects
module
Projects
module
Boards
module
Boards
class
ListsController
<
Projects
::
ApplicationController
class
ListsController
<
Boards
::
ApplicationController
respond_to
:json
before_action
:authorize_admin_list!
before_action
:authorize_admin_list!
rescue_from
ActiveRecord
::
RecordNotFound
,
with: :record_not_found
def
create
def
create
list
=
::
Boards
::
Lists
::
CreateService
.
new
(
project
,
current_user
,
list_params
).
execute
list
=
::
Boards
::
Lists
::
CreateService
.
new
(
project
,
current_user
,
list_params
).
execute
...
@@ -60,10 +56,6 @@ module Projects
...
@@ -60,10 +56,6 @@ module Projects
def
move_params
def
move_params
params
.
require
(
:list
).
permit
(
:position
).
merge
(
id:
params
[
:id
])
params
.
require
(
:list
).
permit
(
:position
).
merge
(
id:
params
[
:id
])
end
end
def
record_not_found
(
exception
)
render
json:
{
error:
exception
.
message
},
status: :not_found
end
end
end
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