Org admin area routing changes

What does this MR do and why?

Restructures admin routing to separate the instance admin and organization admin areas:

  • /admin/* is instance administration and is excluded from the organization scope, so it always resolves to instance administration.
  • /o/:org_path/admin serves the organization admin dashboard, including for the default organization.

Admin routes are split into dedicated route files (config/routes/instance_admin.rb and config/routes/organization_admin.rb), and config/routes/admin.rb draws the correct set based on whether the request is organization-scoped. This keeps /admin/* out of the /o/:org_path scope entirely.

Admin URL helpers switch to the organization-scoped path whenever there is a current organization (including the default organization), so shared admin controllers and views generate the correct path in both admin areas. Instance admin routes have no organization-scoped variant, so their helpers always generate unscoped /admin/* paths.

Route summary

Route Controller Purpose
/admin admin/dashboard#index Instance admin dashboard
/admin/* various admin/* Instance administration (excluded from org scope)
/o/:org_path/admin admin/organizations/dashboard#index Org admin dashboard (incl. default org)

This work is decomposed from !226689 (closed) and sits on top of the admin organization context stack.

Stacked:

  1. !247881 (merged) – Centralize admin area organization resolution (targets master)
  2. !247426 (merged) – Separate instance and organization admin contexts (targets dblessing_admin_current_organization_refactor, the branch of 1)
  3. !244408 (merged) – Org admin area routing changes ⬅️ you are here (targets org-scoped-admin-permissions, the branch of 2)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist.

Testing

  1. Visit the instance admin area and note that it works as expected with the feature flag disabled.
    1. https://gdk.test:3443/admin
  2. Try to visit the default org admin and note the 404
    1. https://gdk.test:3443/o/default/admin
  3. Enable the org_stage_experimental feature flag.
  4. Visit various admin area URLs directly to see that they work as expected.
    1. https://gdk.test:3443/admin - This should be the instance admin area as it's always been.
    2. https://gdk.test:3443/o/default/admin - This should be the shell for the default organization admin area.
    3. Create a new organization, or use an existing organization. Visit that org's admin area - it will also be just a placeholder shell. https://gdk.test:3443/o/acme/admin

References

This is part of a decomposed MR from !226689 (closed).

#587370 (closed)

Edited by Drew Blessing

Merge request reports

Loading
Loading