Skip to content

Use real GraphQL mutation when creating a new organization

What does this MR do and why?

Related to #429410 (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 Add new organization form (!132421 - merged) we added a form to create an organization but used a mock GraphQL mutation because the real one wasn't available yet. Now that GraphQL mutation for creating a new organization (#417891 - closed) has been closed we have access to the real mutation. This MR swaps the mock mutation for the real one.

UX notes

  1. The rest of the organization pages are still using mock data while we wait for API availability. They may not function properly as the data is not real yet.
  2. Description will be added in #422078 (closed)
  3. Avatar will be added in #422418 (closed)
  4. Ability to transfer groups will be added in #419577
  5. Backend does not yet support an error message if the path is already taken. That will be added in Add a uniqueness validation for Organization path (#429784 - closed)

Screenshots or screen recordings

Frontend error messages

This is what the error messages look like when validated on the frontend before the form is submitted. We can do this for simple things like input length and required.

Screenshot_2023-11-06_at_9.03.46_PM

Backend error messages

This is what the error messages look like when validated on the backend after the form is submitted. The API only returns a raw error message without any information about what field has the error so we have no way of associating the field with the error message. This particular message won't be seen by users because we will catch it on the frontend but wanted to show what this alert looks like. In the future it will be used for things like validating that the path is available since we can not validate that on the frontend.

Screenshot_2023-11-07_at_10.59.57_AM

This follows the same pattern we use on other forms, for example the form for creating new groups

Screenshot_2023-11-07_at_11.13.24_AM

How to set up and validate locally

  1. Open Rails console
    • bin/rails console
  2. Enable the feature flag
    • Feature.enable(:ui_for_organizations)
  3. Navigate to /-/organizations/new

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 Peter Hegman

Merge request reports