diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx index ddece468a35..f2af5932fbf 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx @@ -42,7 +42,6 @@ export function HelpWizard({ panel, plugin, onClose }: Props) { currentTab, loading, error, - iframeLoading, options, showMessage, snapshotSize, @@ -50,18 +49,13 @@ export function HelpWizard({ panel, plugin, onClose }: Props) { snapshotText, randomize, panelTitle, - snapshotUpdate, + scene, } = service.useState(); useEffect(() => { service.buildDebugDashboard(); }, [service, plugin, randomize]); - useEffect(() => { - // Listen for messages from loaded iframe - return service.subscribeToIframeLoadingMessage(); - }, [service]); - if (!plugin) { return null; } @@ -211,20 +205,7 @@ export function HelpWizard({ panel, plugin, onClose }: Props) { {({ height }) => ( - <> - - {!iframeLoading && } - > + {scene && } )} > diff --git a/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts b/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts index 65f4edaa761..befcd123874 100644 --- a/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts +++ b/public/app/features/dashboard/components/HelpWizard/SupportSnapshotService.ts @@ -2,10 +2,12 @@ import saveAs from 'file-saver'; import { dateTimeFormat, formattedValueToString, getValueFormat, SelectableValue } from '@grafana/data'; import { config } from '@grafana/runtime'; +import { SceneObject } from '@grafana/scenes'; import { StateManagerBase } from 'app/core/services/StateManagerBase'; +import { createDashboardSceneFromDashboardModel } from 'app/features/scenes/dashboard/DashboardsLoader'; import { getTimeSrv } from '../../services/TimeSrv'; -import { PanelModel } from '../../state'; +import { DashboardModel, PanelModel } from '../../state'; import { setDashboardToFetchFromLocalStorage } from '../../state/initDashboard'; import { Randomize } from './randomizer'; @@ -19,7 +21,6 @@ interface SupportSnapshotState { markdownText: string; snapshotSize?: string; randomize: Randomize; - iframeLoading?: boolean; loading?: boolean; error?: { title: string; @@ -31,6 +32,7 @@ interface SupportSnapshotState { // eslint-disable-next-line snapshot?: any; snapshotUpdate: number; + scene?: SceneObject; } export enum SnapshotTab { @@ -70,17 +72,25 @@ export class SupportSnapshotService extends StateManagerBase { @@ -134,18 +144,4 @@ export class SupportSnapshotService extends StateManagerBase) => { - if (evt.data === 'GrafanaAppInit') { - setDashboardToFetchFromLocalStorage({ meta: {}, dashboard: this.state.snapshot }); - this.setState({ iframeLoading: true }); - } - }; - window.addEventListener('message', handleEvent, false); - - return function cleanup() { - window.removeEventListener('message', handleEvent); - }; - } } diff --git a/public/app/features/dashboard/components/HelpWizard/utils.ts b/public/app/features/dashboard/components/HelpWizard/utils.ts index f51bc33899a..75fc65c3202 100644 --- a/public/app/features/dashboard/components/HelpWizard/utils.ts +++ b/public/app/features/dashboard/components/HelpWizard/utils.ts @@ -182,7 +182,7 @@ function getTransformsRow(saveModel: any): string { return ''; } return ` - Transforms (${saveModel.transformations.length}) + Transform ${saveModel.transformations.map((t: DataTransformerConfig) => t.id).join(', ')} `; }