Selecting an insights dashboard does not retain your selection

Summary

When you select an option from the Insights dropdown, your charts display and the dropdown does not retain which view you're on.

insights

Steps to reproduce

Any project will reproduce this under the Insights view -> https://gitlab.com/gl-retrospectives/manage-stage/optimize/insights/#/mergeRequests

What is the expected correct behavior?

Selecting a page should stay reflected in the dropdown

Affected files

Implementation Guide

  • Add a data property named selectedPage
  • Update onChangePage to set selectedPage when a new page is selected
  • Add a computed prop to https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/assets/javascripts/insights/components/insights.vue named selectedPageName, this prop should either return selectedPage.name or the default text __('Select Page')
  • Replace the dropdown text with the new computed prop
  • Update tests
Edited by Ezekiel Kigbo