No default selection of destination namespace when importing with GH, BB ad Gitea

What does this MR do and why?

Ensures no namespace is selected by default on the import project page (for github, bitbucket, etc).

Also, If a user tries to import without choosing a namespace, they should see the error underneath the dropdown

Select a destination namespace.

Note

The underlying pajamas component gl-collapsible-listbox is not set up to have no default value selected. In the interest of expediency, I use the available toggle-text prop to set the default value to "Select namespace".

Please also note, passing an empty string to toggle-text collapses the visible option on page load resulting in the below. In order to have an empty value that retains a proper width, we'd need to enhance the Pajamas component OR use CSS to target the inner button.

Screenshot 2025-05-08 at 1.09.25 PM.png

So I implemented this alternative.

Screenshot 2025-05-08 at 11.43.36 PM.png

References

Screenshots or screen recordings

Before After
Screen Recording 2025-05-08 at 12.34.39 PM.mov Screen Recording 2025-05-16 at 8.16.06 PM.mov

How to set up and validate locally

  1. Load the app and attempt to create a new project into a group by import from GitHub
    1. Click the + sign next to your user avatar
    2. Click Import project, then select GitHub as the source
  2. Add a GitHub access token in order to connect (you need access to an active GitHub account with at least one repo)
  3. You will see a list of github projects with 'Select' as the chosen namespace
  4. Click "Import" without changing the namespace for one of the rows
  5. You should see the 'select a destination namespace' error
  6. Select a group namespace for that row and the error is removed.
  7. Click import for that row. You will not see the same error.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #534663

Edited by Oiza Baiye

Merge request reports

Loading