Update policy scope project exception dropdown toggle text to account for searching

Summary

  • when a user has selected projects and is searching for more projects in the policy editor policy scope project selection dropdown, the toggle text does not always display the selected projects

Steps to reproduce

  1. Upload a GitLab Ultimate license
  2. Navigate to a group => Secure => Policies => New policy => Any policy type
  3. Add a policy scope with project exceptions

Example Project

https://staging.gitlab.com/groups/govern-team-test/-/security/policies/new?type=approval_policy

What is the current bug behavior?

When projects are selected and a user searches for a new one, the toggle text does not show the already selected projects

What is the expected correct behavior?

When projects are selected and a user searches for a new one, the toggle text shows the already selected projects

Relevant logs and/or screenshots

policy_scope_bug_small

Possible fixes