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F,OAASC,GAAa,EACtB,OAAc,IAAVD,EACK,MAGP,SAAC,IAAD,CACEE,SAAU7B,EAAM8B,IAChBH,MAAOA,EACPC,OAAQA,EACRhC,UAAWA,EACXI,MAAOA,EACP+B,WAAW,EACXC,WAAW,EACXC,MAAM,SAnBhB,OAAO,gEA4BX,EAAexC,EAAUK","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';\nimport { DashboardPanel } from '../dashgrid/DashboardPanel';\nimport { initDashboard } from '../state/initDashboard';\nimport { StoreState } from 'app/types';\nimport { DashboardModel, PanelModel } from 'app/features/dashboard/state';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\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 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 });\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 this.setState({ 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}\n\nexport const SoloPanel = ({ dashboard, notFound, panel, panelId }: 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":["mapDispatchToProps","initDashboard","connector","connect","state","dashboard","getModel","SoloPanelPage","Component","panel","notFound","componentDidMount","match","route","this","props","urlSlug","params","slug","urlUid","uid","urlType","type","routeName","fixUrl","getPanelId","parseInt","queryParams","panelId","componentDidUpdate","prevProps","getPanelByUrlId","setState","render","SoloPanel","className","width","height","stateKey","key","isEditing","isViewing","lazy"],"sourceRoot":""}