Use GitLab UI radio button component for shared "Visibility Settings" radio button partials
For #361142 (closed)
Why
Part of the department-wide Pajamas conversion OKR.
What
I converted HAML to a special function that renders HTML.
Verify
There are many places that use these partials, three such places are below:
Default visibilities for the instance
- As an instance administrator, go to the Admin area
- Go to General Settings (left nav)
- Open the "Visibility and access controls" section
- A bit down, there are three sections that use this partial:
Default project visibility
,Default snippet visibility
, andDefault group visibility
Visibility for new project or new group
- Sign in as a user who can create projects or groups
- Begin the process to create a new project or a new group
- Use the "blank" or "create" options (instead of importing, from template, etc.)
- The "Visibility level" sections use this partial
Caveats
The previous HTML has some pretty specific structure (because there's JS that modifies the DOM after it's rendered), so that's - mostly - replicated in the new setup.
The previous subtext in the label was pushed in to the left of the visibility level icon. The new help_text
argument to the helper does not do that by default. I'm opting to stay closer to the default behavior in this case.
Screenshots
Before | After | |
---|---|---|
Admin application settings | ||
New project | ||
New Group (with some visibility settings disabled by the admin) |
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thomas Randolph