Commit ec7f91d7 authored by Jarka Košanová's avatar Jarka Košanová

Support toggling service desk from API

- service_desk_enabled boolean attribute
parent 4ebca08d
---
title: Support toggling service desk from API
merge_request: 21627
author:
type: changed
...@@ -1135,6 +1135,7 @@ PUT /projects/:id ...@@ -1135,6 +1135,7 @@ PUT /projects/:id
| `only_mirror_protected_branches` | boolean | no | **(STARTER)** Only mirror protected branches | | `only_mirror_protected_branches` | boolean | no | **(STARTER)** Only mirror protected branches |
| `mirror_overwrites_diverged_branches` | boolean | no | **(STARTER)** Pull mirror overwrites diverged 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 | | `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, 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` add authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git`
......
...@@ -21,6 +21,7 @@ module EE ...@@ -21,6 +21,7 @@ module EE
optional :mirror, type: Grape::API::Boolean, desc: 'Enables pull mirroring in a project' 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 :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 :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 end
params :optional_filter_params_ee do params :optional_filter_params_ee do
...@@ -53,7 +54,8 @@ module EE ...@@ -53,7 +54,8 @@ module EE
:external_authorization_classification_label, :external_authorization_classification_label,
:import_url, :import_url,
:packages_enabled, :packages_enabled,
:fallback_approvals_required :fallback_approvals_required,
:service_desk_enabled
] ]
end end
end end
......
...@@ -449,6 +449,27 @@ describe API::Projects do ...@@ -449,6 +449,27 @@ describe API::Projects do
end end
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 context 'when updating repository storage' do
let(:unknown_storage) { 'new-storage' } let(:unknown_storage) { 'new-storage' }
let(:new_project) { create(:project, :repository, namespace: user.namespace) } let(:new_project) { create(:project, :repository, namespace: user.namespace) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment