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,QAAAG,EAAS,SAAAC,CAAS,IACpEF,EACK,gBAAC,OAAI,UAAU,qBAAoB,iBAAeC,EAAQ,YAAU,EAGzE,CAACH,GAAS,CAACD,EACN,gBAAC,WAAI,kCAAgC,EAI5C,gBAAC,OAAI,UAAU,cACb,gBAAC,KAAS,KACP,CAAC,CAAE,MAAAM,EAAO,OAAAC,CAAO,IACZD,IAAU,EACL,KAGP,gBAAC,KACC,SAAUL,EAAM,IAChB,MAAAK,EACA,OAAAC,EACA,UAAAP,EACA,MAAAC,EACA,UAAW,GACX,UAAW,GACX,KAAM,GACN,SAAAI,EACA,SAAU,GACZ,CAGN,CACF,EAIJ,EAAeV,EAAUC,CAAa,C","sources":["webpack://grafana/./public/app/features/dashboard/containers/SoloPanelPage.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nimport { GrafanaContext, GrafanaContextType } from 'app/core/context/GrafanaContext';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\nimport { DashboardModel, PanelModel } from 'app/features/dashboard/state';\nimport { StoreState } from 'app/types';\n\nimport { DashboardPanel } from '../dashgrid/DashboardPanel';\nimport { initDashboard } from '../state/initDashboard';\n\nexport interface DashboardPageRouteParams {\n uid?: string;\n type?: string;\n slug?: string;\n}\n\nconst mapStateToProps = (state: StoreState) => ({\n dashboard: state.dashboard.getModel(),\n});\n\nconst mapDispatchToProps = {\n initDashboard,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport type Props = GrafanaRouteComponentProps &\n ConnectedProps;\n\nexport interface State {\n panel: PanelModel | null;\n notFound: boolean;\n}\n\nexport class SoloPanelPage extends Component {\n declare context: GrafanaContextType;\n static contextType = GrafanaContext;\n\n state: State = {\n panel: null,\n notFound: false,\n };\n\n componentDidMount() {\n const { match, route } = this.props;\n\n this.props.initDashboard({\n urlSlug: match.params.slug,\n urlUid: match.params.uid,\n urlType: match.params.type,\n routeName: route.routeName,\n fixUrl: false,\n keybindingSrv: this.context.keybindings,\n });\n }\n\n getPanelId(): number {\n return parseInt(this.props.queryParams.panelId ?? '0', 10);\n }\n\n componentDidUpdate(prevProps: Props) {\n const { dashboard } = this.props;\n\n if (!dashboard) {\n return;\n }\n\n // we just got a new dashboard\n if (!prevProps.dashboard || prevProps.dashboard.uid !== dashboard.uid) {\n const panel = dashboard.getPanelByUrlId(this.props.queryParams.panelId);\n\n if (!panel) {\n this.setState({ notFound: true });\n return;\n }\n\n if (panel) {\n dashboard.exitViewPanel(panel);\n }\n\n this.setState({ panel });\n dashboard.initViewPanel(panel);\n }\n }\n\n render() {\n return (\n \n );\n }\n}\n\nexport interface SoloPanelProps extends State {\n dashboard: DashboardModel | null;\n panelId: number;\n timezone?: string;\n}\n\nexport const SoloPanel = ({ dashboard, notFound, panel, panelId, timezone }: SoloPanelProps) => {\n if (notFound) {\n return
Panel with id {panelId} not found
;\n }\n\n if (!panel || !dashboard) {\n return
Loading & initializing dashboard
;\n }\n\n return (\n
\n \n {({ width, height }) => {\n if (width === 0) {\n return null;\n }\n return (\n \n );\n }}\n \n
\n );\n};\n\nexport default connector(SoloPanelPage);\n"],"names":["mapStateToProps","state","mapDispatchToProps","connector","SoloPanelPage","match","route","prevProps","dashboard","panel","SoloPanel","notFound","panelId","timezone","width","height"],"sourceRoot":""}