FE: Display selected users/groups

Why are we doing this work

  • Users want to be able to select an individual user or group from a dropdown and view which ones are selected. Currently the display continues appending names forever, which doesn't look good.

The design suggests truncating the text.

It was proposed to show something like X users selected when more than one user is selected? It would be similar to this GitLab UI story: https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-new-dropdowns-listbox--custom-list-item.

image

Relevant links

Implementation plan

Verification steps

  1. Upload a GitLab Ultimate license
  2. Enable the :scan_result_role_action feature flag with the below command
echo "Feature.enable(:scan_result_role_action)" | rails c
  1. Navigate to a project/group => Security & Compliance => Policies => New policy => Scan Result Policy
  2. Verify a user can select either Individual Users or Groups in the Actions area and the dropdown for selecting the users or groups displays the correct information
Edited by Alexander Turinske