Loading
Resolve "EI Dashboard: Add tab query param for deep linking to a dashboard view"
What does this MR do and why?
Adds deep linking to a specific view (tab) of a multi-view analytics dashboard on the Explore analytics dashboards page, as proposed in the follow-up to the MR that introduced dashboard views (see References).
- Switching views now updates the URL with a
?view=<index>query param without a page reload, by enablingGlTabs' built-insyncActiveTabWithQueryParamswithquery-param-name="view"(which also syncs the active view on browser back/forward). The view index is used rather than the title, since titles are not guaranteed to be URL-safe or unique. - Loading a dashboard with
?view=<index>opens the corresponding view. The view is restored from the query param before the first panel render (via the dashboard loader'sloadedevent), so the wrong view's panels never mount or fire queries. - An invalid or out-of-range param falls back to the first view. The stray param is intentionally left in the URL until the next view switch, matching the behavior of every other
syncActiveTabWithQueryParamsconsumer. - Navigating to a different dashboard resets to the first view, since router navigation drops the query string.
No changelog entry: the page is behind the default-off explore_analytics_dashboards feature flag.
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag in the rails console:
Feature.enable(:explore_analytics_dashboards) - From Explore > Analytics dashboards, open the Engineering Intelligence dashboard (it defines multiple views).
- Switch views — the URL updates with
?view=<index>without a reload; browser back/forward walks through the views. - Reload the page with
?view=1in the URL — the second view is active. - Try
?view=99or?view=abc— the dashboard falls back to the first view. - Navigate to a different dashboard — the selection resets to the first view.
References
- Resolves #606411 (closed)
- Follow-up to !246227 (merged)
Edited by Brandon Labuschagne