+
Did you make a mistake?
- >
+
)}
>
);
diff --git a/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts b/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts
index f7052f2203a..2d1ec2cccbe 100644
--- a/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts
+++ b/public/app/features/dashboard-scene/utils/dashboardSessionState.test.ts
@@ -1,5 +1,5 @@
import { config, locationService } from '@grafana/runtime';
-import { CustomVariable } from '@grafana/scenes';
+import { CustomVariable, getUrlSyncManager } from '@grafana/scenes';
import { DashboardDataDTO } from 'app/types';
import { transformSaveModelToScene } from '../serialization/transformSaveModelToScene';
@@ -50,7 +50,8 @@ describe('dashboardSessionState', () => {
restoreDashboardStateFromLocalStorage(scene);
const variable = scene.state.$variables!.getByName('customVar') as CustomVariable;
const timeRange = scene.state.$timeRange;
- scene.startUrlSync();
+
+ getUrlSyncManager().initSync(scene);
expect(variable!.state!.value).toEqual(['b']);
expect(variable!.state!.text).toEqual(['b']);
@@ -63,11 +64,12 @@ describe('dashboardSessionState', () => {
PRESERVED_SCENE_STATE_KEY,
'?var-customVar=b&var-nonApplicableVar=b&from=now-5m&to=now&timezone=browser'
);
+
const scene = buildTestScene();
restoreDashboardStateFromLocalStorage(scene);
- expect(locationService.getSearch().toString()).toBe('var-customVar=b&from=now-5m&to=now&timezone=browser');
+ expect(locationService.getLocation().search).toBe('?var-customVar=b&from=now-5m&to=now&timezone=browser');
});
// handles case when user navigates back to a dashboard with the same state, i.e. using back button
@@ -79,7 +81,7 @@ describe('dashboardSessionState', () => {
restoreDashboardStateFromLocalStorage(scene);
- expect(locationService.getSearch().toString()).toBe('var-customVar=b&from=now-6h&to=now&timezone=browser');
+ expect(locationService.getLocation().search).toBe('?var-customVar=b&from=now-6h&to=now&timezone=browser');
});
});
});
@@ -116,6 +118,7 @@ function buildTestScene() {
version: 24,
weekStart: '',
};
+
const scene = transformSaveModelToScene({ dashboard: testDashboard, meta: {} });
// Removing data layers to avoid mocking built-in Grafana data source
diff --git a/public/app/features/dashboard-scene/utils/dashboardSessionState.ts b/public/app/features/dashboard-scene/utils/dashboardSessionState.ts
index c93e530a530..6ad764e2222 100644
--- a/public/app/features/dashboard-scene/utils/dashboardSessionState.ts
+++ b/public/app/features/dashboard-scene/utils/dashboardSessionState.ts
@@ -17,10 +17,6 @@ export function restoreDashboardStateFromLocalStorage(dashboard: DashboardScene)
preservedQueryParams.forEach((value, key) => {
if (!currentQueryParams.has(key)) {
currentQueryParams.append(key, value);
- } else {
- if (!currentQueryParams.getAll(key).includes(value)) {
- currentQueryParams.append(key, value);
- }
}
});
@@ -38,9 +34,7 @@ export function restoreDashboardStateFromLocalStorage(dashboard: DashboardScene)
const finalParams = currentQueryParams.toString();
if (finalParams) {
- locationService.replace({
- search: finalParams,
- });
+ locationService.replace({ search: finalParams });
}
}
}
diff --git a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx
index e3309e2547e..9ef4546c674 100644
--- a/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx
+++ b/public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { isEmptyObject, SelectableValue, VariableRefresh } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime';
-import { Button, ClipboardButton, Field, Input, LinkButton, Modal, Select, Spinner } from '@grafana/ui';
+import { Button, ClipboardButton, Field, Input, LinkButton, Modal, Select, Spinner, Stack } from '@grafana/ui';
import { t, Trans } from 'app/core/internationalization';
import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
@@ -290,7 +290,7 @@ export class ShareSnapshot extends PureComponent
{
const { snapshotUrl } = this.state;
return (
- <>
+
{
/>
-
+
Did you make a mistake?
Delete snapshot.
- >
+
);
}
diff --git a/public/app/features/storage/RootView.tsx b/public/app/features/storage/RootView.tsx
index c6f855a7024..332f2e503da 100644
--- a/public/app/features/storage/RootView.tsx
+++ b/public/app/features/storage/RootView.tsx
@@ -83,9 +83,8 @@ export function RootView({ root, onPathChange }: Props) {
-
+
+
{renderRoots('', roots.base)}
@@ -100,12 +99,12 @@ export function RootView({ root, onPathChange }: Props) {
function getStyles(theme: GrafanaTheme2) {
return {
- secondaryTextColor: css`
- color: ${theme.colors.text.secondary};
- `,
- clickable: css`
- pointer-events: none;
- `,
+ secondaryTextColor: css({
+ color: theme.colors.text.secondary,
+ }),
+ clickable: css({
+ pointerEvents: 'none',
+ }),
};
}
diff --git a/public/app/features/teams/TeamGroupSync.tsx b/public/app/features/teams/TeamGroupSync.tsx
index 5dd0e5f8e8d..3d8b2bbca30 100644
--- a/public/app/features/teams/TeamGroupSync.tsx
+++ b/public/app/features/teams/TeamGroupSync.tsx
@@ -121,7 +121,7 @@ export class TeamGroupSync extends PureComponent {
)}
{groups.length > 0 && (
-