Hide group settings for dependency proxy if config is disabled
Context
Trying to enable the Enable Dependency Proxy
toggle on the group settings for Dependency proxy
returns An error occurred while saving the settings.
and flips the toggle back to off. Inspecting the network tab show thats the user does not have sufficient permissions or the resource doesn't exist.
Investigation
We seem to be showing the Dependency Proxy
settings section even when dependency_proxy
config is disabled at instance level.
Dependency proxy settings query type, update mutation type needs admin_dependency_proxy
policy to be enabled.
We can see that one of the conditions when group policy for :admin_dependency_proxy can be enabled is when dependency_proxy_available
is enabled.
Solution
Hide the dependency proxy settings section if admin_dependency_proxy
is false. This is similar to how the container registry settings section at the project settings level is hidden if the configuration is disabled. Similarly, in the Slack (internal) thread, they have something similar.
that toggle shouldn't've even appeared if it wasn't enabled on the instance level