Support disabled Duo Chat button
What does this MR do and why?
Add support for a disabled Duo Chat button. The change is hidden behind duo_chat_disabled_button
feature flag. The behavior with enabled flag is following:
- user does not have access to Duo Chat -> button is not visible
- user has access to Duo Chat
- Duo Chat enabled for the project/group -> button is visible without
chat_disabled_reason
attribute - Duo Chat is disabled for the project/group -> button is visible with
chat_disabled_reason
attribute set togroup
orproject
- Duo Chat enabled for the project/group -> button is visible without
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- From the rails console enable feature flag:
Feature.enable(:duo_chat_disabled_button)
- Log in as admin to your local GDK instance.
- Disable Duo Chat for a project from the console:
project = Project.find_by(name: "Gitlab Smoke Tests")
project.update!(duo_features_enabled: false)
- Visit the project - the button should be visible.
- Inspect the button and you should see a
chat_disabled_reason
attribute with aproject
value. - Visit a project with enabled Duo Chat and inspect the button. It should not have the
chat_disabled_reason
attribute. - With the flag disabled, for project with disabled Duo Chat, the button should not be visible.
Related to #463940 (closed)
Edited by Eva Kadlecová