Skip to content

Add organization fields to new user form in admin area

What does this MR do and why?

Related to #448811 (closed)

The grouptenant scale team is working on building the Organization MVC. For more information about what an "Organization" will be see https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/organization/#organization-mvc

This MR adds an organization section to the new user form in the admin area. When there is only the default organization in the instance (all instances have default organization) it shows that organization avatar and lets you pick a role for the user. When there are multiple organizations in an instance it shows an organization selector and allows you to select the organization you want to add the user to as well as the role for the user.

Important note: these new fields will not persist when saved yet because the controller has not yet been updated. This will be updated in #481899 (closed)

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

Instance only has default organization

Mobile Desktop
Screenshot_2024-10-02_at_10.05.15_PM Screenshot_2024-10-02_at_9.58.17_PM

Instance has multiple organizations

Mobile Desktop
Screenshot_2024-10-02_at_10.04.17_PM Screenshot_2024-10-02_at_9.59.38_PM

How to set up and validate locally

  1. Go to http://gdk.test:3000/rails/features
  2. Enable the ui_for_organizations and allow_organization_creation feature flags
  3. Go to http://gdk.test:3000/admin/application_settings/general. In the Account and limit section check the Allow users to create organizations box.
  4. Go to http://gdk.test:3000/admin/users/new
  5. Go to http://gdk.test:3000/-/organizations/new and create an organization
  6. Go back to http://gdk.test:3000/admin/users/new, you should see an organization selector
Edited by Peter Hegman

Merge request reports

Loading