mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
DashboardScene: Fix url state sync issue when coming form Home dashboard to a cached dashboard scene (#93442)
* DashboardScene: Fixes preserve dashboard state for hidden options * DashboardScene: Alt fix for pervering only specific url keys * DashboardScene: Fixes url sync issue when coming from Home route * Update * Fix test
This commit is contained in:
parent
37e4353a18
commit
d177e57f7e
@ -220,7 +220,7 @@ describe('DashboardScenePage', () => {
|
||||
|
||||
describe('empty state', () => {
|
||||
it('Shows empty state when dashboard is empty', async () => {
|
||||
loadDashboardMock.mockResolvedValue({ dashboard: { panels: [] }, meta: {} });
|
||||
loadDashboardMock.mockResolvedValue({ dashboard: { uid: 'my-dash-uid', panels: [] }, meta: {} });
|
||||
setup();
|
||||
|
||||
expect(await screen.findByText('Start your new dashboard by adding a visualization')).toBeInTheDocument();
|
||||
@ -299,7 +299,7 @@ describe('DashboardScenePage', () => {
|
||||
it('should show controls', async () => {
|
||||
getDashboardScenePageStateManager().clearDashboardCache();
|
||||
loadDashboardMock.mockClear();
|
||||
loadDashboardMock.mockResolvedValue({ dashboard: { panels: [] }, meta: {} });
|
||||
loadDashboardMock.mockResolvedValue({ dashboard: { uid: 'my-dash-uid', panels: [] }, meta: {} });
|
||||
|
||||
setup();
|
||||
|
||||
|
@ -78,7 +78,7 @@ export function DashboardScenePage({ match, route, queryParams, history }: Props
|
||||
// Do not render anything when transitioning from one dashboard to another
|
||||
if (
|
||||
match.params.type !== 'snapshot' &&
|
||||
dashboard.state.uid &&
|
||||
match.params.uid &&
|
||||
dashboard.state.uid !== match.params.uid &&
|
||||
route.routeName !== DashboardRoutes.Home
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user