Skip to content

Make cascading attribute helpers more generic to support project setting

Martin Čavoj requested to merge 469439-generic-cascading-attr-helpers into master

What does this MR do and why?

This change makes the helpers for cascading attributes more generic so that they can be also used for project cascading attributes.

Project cascading attributes are implemented in a module CascadingProjectSettingAttribute which is very similar to CascadingNamespaceSettingAttribute.

Changes in this MR:

  • Move the helpers from NamespacesHelper to a new CascadingSettingsHelper
  • Move HAML partials and JS one layer up so that it's not scoped under namespaces
  • Documentation changes

There will be a new cascading project setting introduced as part of #469439 (comment 2093505539) and making these helpers more generic allows us to add this cascading UI toggle in a cleaner way.

EDIT: It turns out that this planned MR is not necessary for the planned project setting because it was decided to move it to a different section, and that particular section was using Vue form. But maybe it could still be useful in the future for forms that use Rails helpers 🤔

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

No visual changes. The only setting currently using these helpers is for duo_features_enabled.

Duo features Locked with tooltip
CleanShot_2024-09-06_at_17.32.37_2x CleanShot_2024-09-06_at_17.32.44_2x

How to set up and validate locally

  1. Visit any group General Settings -> Permissions and group features
  2. Verify that toggle for GitLab Duo features still works

Related to #469439 (closed)

Edited by Martin Čavoj

Merge request reports

Loading