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
ec7f91d7
Commit
ec7f91d7
authored
Dec 12, 2019
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support toggling service desk from API
- service_desk_enabled boolean attribute
parent
4ebca08d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
changelogs/unreleased/34261-toggle-service-desk.yml
changelogs/unreleased/34261-toggle-service-desk.yml
+5
-0
doc/api/projects.md
doc/api/projects.md
+1
-0
ee/lib/ee/api/helpers/projects_helpers.rb
ee/lib/ee/api/helpers/projects_helpers.rb
+3
-1
ee/spec/requests/api/projects_spec.rb
ee/spec/requests/api/projects_spec.rb
+21
-0
No files found.
changelogs/unreleased/34261-toggle-service-desk.yml
0 → 100644
View file @
ec7f91d7
---
title
:
Support toggling service desk from API
merge_request
:
21627
author
:
type
:
changed
doc/api/projects.md
View file @
ec7f91d7
...
...
@@ -1135,6 +1135,7 @@ PUT /projects/:id
|
`only_mirror_protected_branches`
| boolean | no |
**(STARTER)**
Only mirror protected branches |
|
`mirror_overwrites_diverged_branches`
| boolean | no |
**(STARTER)**
Pull mirror overwrites diverged branches |
|
`packages_enabled`
| boolean | no |
**(PREMIUM ONLY)**
Enable or disable packages repository feature |
|
`service_desk_enabled`
| boolean | no |
**(PREMIUM ONLY)**
Enable or disable service desk feature |
NOTE:
**Note:**
If your HTTP repository is not publicly accessible,
add authentication information to the URL:
`https://username:password@gitlab.company.com/group/project.git`
...
...
ee/lib/ee/api/helpers/projects_helpers.rb
View file @
ec7f91d7
...
...
@@ -21,6 +21,7 @@ module EE
optional
:mirror
,
type:
Grape
::
API
::
Boolean
,
desc:
'Enables pull mirroring in a project'
optional
:mirror_trigger_builds
,
type:
Grape
::
API
::
Boolean
,
desc:
'Pull mirroring triggers builds'
optional
:external_authorization_classification_label
,
type:
String
,
desc:
'The classification label for the project'
optional
:service_desk_enabled
,
type:
Grape
::
API
::
Boolean
,
desc:
'Disable or enable the service desk'
end
params
:optional_filter_params_ee
do
...
...
@@ -53,7 +54,8 @@ module EE
:external_authorization_classification_label
,
:import_url
,
:packages_enabled
,
:fallback_approvals_required
:fallback_approvals_required
,
:service_desk_enabled
]
end
end
...
...
ee/spec/requests/api/projects_spec.rb
View file @
ec7f91d7
...
...
@@ -449,6 +449,27 @@ describe API::Projects do
end
end
context
'when updating service desk'
do
subject
{
put
(
api
(
"/projects/
#{
project
.
id
}
"
,
user
),
params:
{
service_desk_enabled:
true
})
}
before
do
stub_licensed_features
(
service_desk:
true
)
project
.
update!
(
service_desk_enabled:
false
)
allow
(
::
Gitlab
::
IncomingEmail
).
to
receive
(
:enabled?
).
and_return
(
true
)
end
it
'returns 200'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
it
'enables the service_desk'
do
expect
{
subject
}.
to
change
{
project
.
reload
.
service_desk_enabled
}.
to
(
true
)
end
end
context
'when updating repository storage'
do
let
(
:unknown_storage
)
{
'new-storage'
}
let
(
:new_project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
...
...
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