Organization admin area sidebar menus and root controller
What does this MR do and why?
Follow-up to !225916 (merged), add sidebar menu items for organization admin area as well as a root controller to redirect a user to the correct dashboard. An organization owner is redirected to the organization dashboard and an instance admin/custom admin role users are redirected to the instance dashboard.
This feature is behind a feature flag added in the previous MR. This MR serves as a minimal framework to build new organization features or to migrate existing features from instance or group to organizations.
This MR looks large but there are lots of small changes to update spec path helpers. Separating into multiple MR would have left something untestable (sidebar present that leads to nowhere).
In a follow-up MR we will add content to the organization dashboard.
References
Organization Owner Access to Admin Area (#587370)
Screenshots or screen recordings
| Before | After |
|---|---|
|
Instance admin view |
Instance admin view Organization owner view Very minimal for now. Will subsequently add user management views + organization settings |
How to set up and validate locally
-
Enable Feature Flags. In Rails console (
bundle exec rails c):Feature.enable(:org_admin_area) Feature.enable(:ui_for_organizations) Feature.enable(:organization_switcher) Feature.enable(:organization_scoped_paths) -
Create a New Organization
org = Organizations::Organization.create!(name: 'Test Organization', path: 'test-org') -
Create or Find a User to Make Org Owner. Use existing or create new.
Users::CreateService.new(User.first, { name: 'Org Owner', username: 'org_owner', email: 'org_owner@example.com', password: 'mysupersecretpassword!', organization_id: org.id, organization_access_level: :owner }).execute -
Sign in as the org owner user (not an instance admin)
-
You should see the
Adminbutton in the top right. Click the button and it should take you to the blankOrganization Adminpage. -
Sign in as instance admin
-
Click the
Adminbutton in the top right and observe admin area is accessible as per normal. But you will also notice that a new menu itemOrganization overviewis present.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.



