Unable to select multiple groups with same name in MR approval rules drawer
Summary
When there are subgroups in the Project groups list when adding a group to an MR approval rule, only the first group is selectable.
Steps to reproduce
- Create a group with nameA
- Create a project within this group (nameA), call it projectA
- Create another group with nameB
- Create a subgroup called nameA within the group with nameB
- Invite the subgroup nameB/nameA to the projectA, with at least Reporter role
- Navigate to projectA -> Settings -> Merge requests
- Click on
Add approval rule
- Under the
Groups
section, click on the search field - Notice that
nameA
andnameB/nameA
groups both show up in the list - Attempt to select both
nameA
andnameB/nameA
groups
What is the current bug behavior?
Only one of the groups is selectable, in this case only nameB/nameA
group is added to the list. Clicking on nameA
always adds nameB/nameA
as in the below screenshot.
What is the expected correct behavior?
Both groups should be selectable.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
This UI was added in Replace approval selectors with User/Group sele... (!148667 - merged)
Implementation guide
- Change filter key from
name
toid
for the groups type in ListSelector component: app/assets/javascripts/vue_shared/components/list_selector/constants.js#L22 - Adjust any failing unit tests: spec/frontend/vue_shared/components/list_selector/index_spec.js
- This component is used in Project settings / Merge requests / Merge requests approvals. Example url on GDK: http://gdk.test:8080/flightjs/Flight/-/settings/merge_requests Choose Add approval rule or Edit to open a drawer and use a group selector.
Edited by Paulina Sedlak-Jakubowska