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
9c2c1f3c
Commit
9c2c1f3c
authored
Aug 25, 2017
by
Sean McGivern
Committed by
Bryce Johnson
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Projects::IssuesController#service_desk action
parent
5bf11d02
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+2
-2
config/routes/project.rb
config/routes/project.rb
+2
-0
ee/app/controllers/ee/projects/issues_controller.rb
ee/app/controllers/ee/projects/issues_controller.rb
+36
-0
ee/app/views/projects/issues/service_desk.html.haml
ee/app/views/projects/issues/service_desk.html.haml
+0
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
9c2c1f3c
...
@@ -6,8 +6,6 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -6,8 +6,6 @@ class Projects::IssuesController < Projects::ApplicationController
include
IssuableCollections
include
IssuableCollections
include
SpammableActions
include
SpammableActions
prepend
::
EE
::
Projects
::
IssuesController
prepend_before_action
:authenticate_user!
,
only:
[
:new
,
:export_csv
]
prepend_before_action
:authenticate_user!
,
only:
[
:new
,
:export_csv
]
before_action
:check_issues_available!
before_action
:check_issues_available!
...
@@ -22,6 +20,8 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -22,6 +20,8 @@ class Projects::IssuesController < Projects::ApplicationController
# Allow create a new branch and empty WIP merge request from current issue
# Allow create a new branch and empty WIP merge request from current issue
before_action
:authorize_create_merge_request!
,
only:
[
:create_merge_request
]
before_action
:authorize_create_merge_request!
,
only:
[
:create_merge_request
]
prepend
::
EE
::
Projects
::
IssuesController
respond_to
:html
respond_to
:html
def
index
def
index
...
...
config/routes/project.rb
View file @
9c2c1f3c
...
@@ -349,6 +349,8 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -349,6 +349,8 @@ constraints(ProjectUrlConstrainer.new) do
collection
do
collection
do
post
:bulk_update
post
:bulk_update
post
:export_csv
post
:export_csv
get
:service_desk
## EE-specific
end
end
resources
:issue_links
,
only:
[
:index
,
:create
,
:destroy
],
as:
'links'
,
path:
'links'
resources
:issue_links
,
only:
[
:index
,
:create
,
:destroy
],
as:
'links'
,
path:
'links'
...
...
ee/app/controllers/ee/projects/issues_controller.rb
View file @
9c2c1f3c
...
@@ -5,6 +5,31 @@ module EE
...
@@ -5,6 +5,31 @@ module EE
prepended
do
prepended
do
before_action
:check_export_issues_available!
,
only:
[
:export_csv
]
before_action
:check_export_issues_available!
,
only:
[
:export_csv
]
before_action
:check_service_desk_available!
,
only:
[
:service_desk
]
skip_before_action
:issue
,
only:
[
:service_desk
]
end
def
service_desk
@collection_type
=
"Issue"
@issues
=
issues_collection
@issues
=
@issues
.
page
(
params
[
:page
])
@issuable_meta_data
=
issuable_meta_data
(
@issues
,
@collection_type
)
if
@issues
.
out_of_range?
&&
@issues
.
total_pages
!=
0
return
redirect_to
url_for
(
params
.
merge
(
page:
@issues
.
total_pages
,
only_path:
true
))
end
if
params
[
:label_name
].
present?
@labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
title:
params
[
:label_name
]).
execute
end
@users
=
[]
if
params
[
:assignee_id
].
present?
assignee
=
User
.
find_by_id
(
params
[
:assignee_id
])
@users
.
push
(
assignee
)
if
assignee
end
end
end
def
export_csv
def
export_csv
...
@@ -14,6 +39,8 @@ module EE
...
@@ -14,6 +39,8 @@ module EE
redirect_to
(
index_path
,
notice:
"Your CSV export has started. It will be emailed to
#{
current_user
.
notification_email
}
when complete."
)
redirect_to
(
index_path
,
notice:
"Your CSV export has started. It will be emailed to
#{
current_user
.
notification_email
}
when complete."
)
end
end
private
def
issue_params_attributes
def
issue_params_attributes
attrs
=
super
attrs
=
super
attrs
.
unshift
(
:weight
)
if
project
.
feature_available?
(
:issue_weights
)
attrs
.
unshift
(
:weight
)
if
project
.
feature_available?
(
:issue_weights
)
...
@@ -25,8 +52,17 @@ module EE
...
@@ -25,8 +52,17 @@ module EE
params
=
super
params
=
super
params
.
reject!
{
|
key
|
key
==
'weight'
}
unless
project
.
feature_available?
(
:issue_weights
)
params
.
reject!
{
|
key
|
key
==
'weight'
}
unless
project
.
feature_available?
(
:issue_weights
)
if
action_name
==
'service_desk'
params
.
reject!
{
|
key
|
key
==
'author_username'
||
key
==
'author_id'
}
params
[
:author_id
]
=
::
User
.
support_bot
end
params
params
end
end
def
self
.
skip_issue_actions
super
+
[
:service_desk
]
end
end
end
end
end
end
end
app/views/projects/service_desk/index
.html.haml
→
ee/app/views/projects/issues/service_desk
.html.haml
View file @
9c2c1f3c
File moved
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