The service desk info messages need to be updated.
Based on the existing logic in _service_desk_info_content.html.haml, I believe we intended to display different empty state messages depending on these states:
Gitlab::ServiceDesk.supported
@project.service_desk_enabled?
- and
can_edit_project_settings
.
Problem to solve 1:
One empty state message seems inconsistent with one of the internal states. We’re are displaying “Service Desk is enabled but not yet active” when Gitlab::ServiceDesk.supported
is false
. But Gitlab::ServiceDesk.supported
returns true
if Gitlab::IncomingEmail.enabled?
is true
according to lib/gitlab/service_desk.rb
. In fact, it is impossible to have Service Desk enabled if Gitlab::IncomingEmail
is disabled. The message needs to be updated to say something like “Service Desk is not supported because incoming email is not enabled”.
Problem to solve 2:
Moreover, we need to display different messages depending on whether the user viewing the Service Desk page can edit the project settings or not (can_edit_project_settings
).
Here’s a summary table - we need to figure out what to display for each row (edit: thanks @felipe_artur / @nickbrandt
ServiceDesk.supported |
can_edit_project_settings |
message displayed |
---|---|---|
false | false | "Service desk is not enabled for your instance. Contact an administrator." |
false | true | “Service Desk is not supported because incoming email is not setup(LINK TO SERVICE DESK DOCS). |