Skip to content

Check `allow_organization_creation` feature flag on a few more views

What does this MR do and why?

Related to #452518 (closed)

The grouptenant scale team is starting to build out an Organization MVC. For more information about what an "Organization" will be see https://docs.gitlab.com/ee/architecture/blueprints/organization/

In !147930 (merged) we introduced a new allow_organization_creation to control who can create an organization for the MVC. There were a few places that needed to be updated for full parity. This MR updates following logic when feature flag is disabled:

  1. Hide New organization button in empty state
  2. 404 /-/organizations/new
  3. Hide New organization button in admin area (/admin/organizations)

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

With allow_organization_creation feature flag disabled

Your work -> Organizations

Before After
Screenshot_2024-04-01_at_3.54.50_PM Screenshot_2024-04-01_at_3.53.17_PM

Admin area -> Organizations

Before After
Screenshot_2024-04-01_at_3.54.37_PM Screenshot_2024-04-01_at_3.53.29_PM

How to set up and validate locally

  1. Enable ui_for_organizations feature flag
    • echo "Feature.enable(:ui_for_organizations)" | gdk rails c
  2. Change app/assets/javascripts/organizations/shared/components/organizations_view.vue#L35 to return []; to force empty state
  3. Navigate to /admin/organizations
    • New organization buttons should not be shown
  4. Navigate to /-/organizations
    • New organization buttons should not be shown
  5. Navigate to /-/organizations/new
    • You should get a 404
  6. Enable allow_organization_creation feature flag and go through steps 3 - 5 again. It should now be possible to create an organization.
    • echo "Feature.enable(:allow_organization_creation)" | gdk rails c
Edited by Peter Hegman

Merge request reports