Skip to content

VSA: Ensure selected projects are always visible

Ezekiel Kigbo requested to merge 336385-fix-selected-items-filtering into master

What does this MR do and why?

Updates the projects dropdown filter to ensure we always display selected projects

When a search term has been added, the dropdown will only contain the first 50 items that match the term, if the selected project does not match the term it was previously not displayed, despite still being selected. This would lead to confusion since a project is selected, but it is not visible in the dropdown.

Screenshots or screen recordings

Before After
Screen_Recording_2021-10-12_at_10.12.49_pm Screen_Recording_2021-10-12_at_10.00.59_pm

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Ensure you have an EE license, or stub the cycle_analytics_for_groups license feature to true
  2. Create a group with multiple projects (for example 3)
  3. Set https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/analytics/shared/constants.js#L5 = to 1
  4. Navigate to value stream analytics for the group, ie for a project named clean-vsa-project in group new-vsa-group it would be http://<gdk>/group/:group_id/-/analytics/value_stream_analytics (or find it in the left menu)
  5. Open the project dropdown, note the project that is visible
  6. Search for another project, select one of the projects that's returned from the async query
  7. Clear the search
  8. The selected project should still be visible

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #336385 (closed)

Edited by Ezekiel Kigbo

Merge request reports

Loading