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.
So I implemented this alternative.
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
- Load the app and attempt to create a new project into a group by import from GitHub
- Click the + sign next to your user avatar
- Click Import project, then select GitHub as the source
- Add a GitHub access token in order to connect (you need access to an active GitHub account with at least one repo)
- You will see a list of github projects with 'Select' as the chosen namespace
- Click "Import" without changing the namespace for one of the rows
- You should see the 'select a destination namespace' error
- Select a group namespace for that row and the error is removed.
- 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

