Correctly handle scenario when no top-level groups are available
What does this MR do?
Related issue: #300241 (closed)
This MR fixes import_groups app blowing up, when there are no top-level group available on our side. Additionally it cleans some obsolete checks - when user has no "can create group" permission - he/she simply can't access entire flow, so no need for extra checks in Vue space
Testing guidelines (simpliest way)
- Enable feature
bulk_import
viaFeature.enable(:bulk_import)
- As admin user go to list of your users and impersonate as user with no groups (if your GDK install is default one, first one will work)
- Open "New group" (
/groups/new
) - Use
https://gitlab.com
as source instance andGeK1Nis4j-SY1X4sqE5c
as personal access token (this token is from separate user on GitLab instance with 0 real data available, so we do not expose any security risks here) - Check that all groups have
No parent
preselected as target namespace and no other items in dropdown - Click
Import
- Ensure new group is imported and available (it should be empty intentionally)
Video
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
No changelog as functionality is behind feature flag
Edited by Illya Klymov