Create project: Add personal options validation

What does this MR do and why?

Add personal options validation to the new project creation form:

  • Hide Import and CI/CD options when these features are disabled
  • Hide options and show an error message when user can't create personal projects or reached the limit
  • If user can't create a personal project, hide this option from a destination select

⚠️ ⚠️ ⚠️ These changes are behind the new_project_creation_form feature flag. They won't be available to users until all the work is done. See the plan here #514700 (closed) ⚠️ ⚠️ ⚠️

Screenshots or screen recordings

User has no restrictions User has restrictions
CleanShot_2025-01-30_at_17.30.01_2x CleanShot_2025-01-30_at_17.22.43_2x
CleanShot_2025-01-30_at_17.22.08_2x
CleanShot_2025-01-30_at_17.42.05_2x
CleanShot_2025-01-30_at_17.30.13_2x CleanShot_2025-01-30_at_17.22.21_2x

How to set up and validate locally

  1. In rails console enable the experiment fully

    Feature.enable(:new_project_creation_form)
  2. Go to http://gdk.test:3000/projects/new

  3. You can also try to go to any group you own

  4. Click the [+] button on top of the sidebar

  5. Click In this group > New project/repository

How to disable Import and CI/CD:

  1. Go to http://gdk.test:3000/admin/application_settings/general#js-import-export-settings
  2. Find Import sources
  3. Uncheck all the sources listed there

How to set a limit of projects

  1. Go to http://gdk.test:3000/admin/users/root/edit
  2. Find Projects limit
  3. Set 0 to disable project creation
  4. Set 1 to reach a limit of projects

Links

Project creation plans: #514700 (closed)

Milestone planning issue: #499697 (closed)

Merge request reports

Loading