Skip to content

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

  1. As an instance administrator, go to the Admin area
  2. Go to General Settings (left nav)
  3. Open the "Visibility and access controls" section
  4. A bit down, there are three sections that use this partial: Default project visibility, Default snippet visibility, and Default group visibility

Visibility for new project or new group

  1. Sign in as a user who can create projects or groups
  2. Begin the process to create a new project or a new group
  3. Use the "blank" or "create" options (instead of importing, from template, etc.)
  4. 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 appSettings-before appSettings-after
New project newProject-before newProject-after
New Group (with some visibility settings disabled by the admin) newGroup-disabled-before newGroup-disabled-after

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports