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
- 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.
- Description will be added in #422078 (closed)
- Avatar will be added in #422418 (closed)
- Ability to transfer groups will be added in #419577
- 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.
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.
This follows the same pattern we use on other forms, for example the form for creating new groups
How to set up and validate locally
- Open Rails console
bin/rails console
- Enable the feature flag
Feature.enable(:ui_for_organizations)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.