Disable DAP flow toggles in project settings when platform is off
What does this MR do and why?
When duo_agent_platform_enabled is disabled at the instance level, the "Allow flow execution" and "Allow foundational flows" toggles in Project > Settings > GitLab Duo remained visible and interactive. They should be disabled (but still visible) when DAP is off at the instance level.
This fix adds a duoAgentPlatformEnabled prop to GitlabDuoSettings, populated from Ai::DuoWorkflow.duo_agent_platform_available?, and includes it in the :disabled condition of both flow toggles in the non-readiness-card path. The readiness-card path already handled this correctly via platformEnabled.
Sub-setting values are preserved in the database — only the interactability of the UI controls is affected, as intended.
References
Screenshots or screen recordings
| Before | After |
|---|---|
| Flow toggles remain interactive when DAP is disabled at instance level | Flow toggles are disabled when DAP is disabled at instance level |
How to set up and validate locally
-
In the Rails console, disable DAP for your environment.
For a SaaS GDK:
root_group = Group.find_by_full_path('your-group').root_ancestor root_group.ai_settings.update!(duo_agent_platform_enabled: false)For a self-managed or Dedicated GDK:
organization = Organizations::Organization.default_organization Ai::Setting.for_organization(organization).update!(duo_agent_platform_enabled: false) -
Visit any project under the selected group or organization, then open Settings > General > GitLab Duo.
-
Verify that the "Allow flow execution" and "Allow foundational flows" toggles are visible but disabled.
-
Re-enable DAP using the applicable command above with
trueand verify the toggles become interactive again.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.