Skip to content

Support disabled Duo Chat button

Eva Kadlecová requested to merge 463940-duo-chat-button-update-disabled into master

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 to group or project

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
image.png image.png

How to set up and validate locally

  1. From the rails console enable feature flag:
Feature.enable(:duo_chat_disabled_button)
  1. Log in as admin to your local GDK instance.
  2. Disable Duo Chat for a project from the console:
project = Project.find_by(name: "Gitlab Smoke Tests")
project.update!(duo_features_enabled: false)
  1. Visit the project - the button should be visible.
  2. Inspect the button and you should see a chat_disabled_reason attribute with a project value.
  3. Visit a project with enabled Duo Chat and inspect the button. It should not have the chat_disabled_reason attribute.
  4. With the flag disabled, for project with disabled Duo Chat, the button should not be visible.

Related to #463940 (closed)

Edited by Eva Kadlecová

Merge request reports