{"version":3,"sources":["webpack:///./public/app/features/dashboard/containers/SoloPanelPage.tsx"],"names":["SoloPanelPage","state","panel","notFound","this","props","$injector","$scope","urlUid","urlType","urlSlug","routeInfo","initDashboard","fixUrl","prevProps","urlPanelId","dashboard","uid","panelId","parseInt","expandParentRowFor","getPanelById","setState","className","isEditing","isViewing","isInView","Component","mapDispatchToProps","hot","module","connect","location","routeParams","slug","type","query","getModel"],"mappings":"2mCAgCO,IAAMA,EAAb,6KACEC,MAAe,CACbC,MAAO,KACPC,UAAU,GAHd,E,UAAA,O,kOAAA,M,EAAA,G,EAAA,2CAMsB,MACiDC,KAAKC,MAAhEC,EADU,EACVA,UAAWC,EADD,EACCA,OAAQC,EADT,EACSA,OAAQC,EADjB,EACiBA,QAASC,EAD1B,EAC0BA,QAASC,EADnC,EACmCA,UAErDP,KAAKC,MAAMO,cAAc,CACvBN,UAAWA,EACXC,OAAQA,EACRG,QAASA,EACTF,OAAQA,EACRC,QAASA,EACTE,UAAWA,EACXE,QAAQ,MAhBd,yCAoBqBC,GAAkB,MACDV,KAAKC,MAA/BU,EAD2B,EAC3BA,WAAYC,EADe,EACfA,UAEpB,GAAKA,KAKAF,EAAUE,WAAaF,EAAUE,UAAUC,MAAQD,EAAUC,KAAK,CACrE,IAAMC,EAAUC,SAASJ,EAAY,IAGrCC,EAAUI,mBAAmBF,GAE7B,IAAMhB,EAAQc,EAAUK,aAAaH,GAErC,IAAKhB,EAEH,YADAE,KAAKkB,SAAS,CAAEnB,UAAU,IAI5BC,KAAKkB,SAAS,CAAEpB,aAzCtB,+BA6CW,MAC2BE,KAAKC,MAA/BU,EADD,EACCA,WAAYC,EADb,EACaA,UADb,EAEqBZ,KAAKH,MAAzBE,EAFD,EAECA,SAAUD,EAFX,EAEWA,MAElB,OAAIC,EACK,yBAAKoB,UAAU,qBAAf,iBAAkDR,EAAlD,cAGJb,GAAUc,EAKb,yBAAKO,UAAU,cACb,kBAAC,IAAD,CAAgBP,UAAWA,EAAWd,MAAOA,EAAOsB,WAAW,EAAOC,WAAW,EAAOC,UAAU,KAL7F,sE,2BAtDb,GAAmCC,aAyE7BC,EAAqB,CACzBhB,mBAGaiB,wBAAIC,EAAJD,CAAYE,mBAZH,SAAC9B,GAAD,MAAwB,CAC9CO,OAAQP,EAAM+B,SAASC,YAAYhB,IACnCP,QAAST,EAAM+B,SAASC,YAAYC,KACpCzB,QAASR,EAAM+B,SAASC,YAAYE,KACpCpB,WAAYd,EAAM+B,SAASI,MAAMlB,QACjCF,UAAWf,EAAMe,UAAUqB,cAOuBT,EAAzBG,CAA6C/B,K","file":"SoloPanelPage.90343abf47ce928781e5.js","sourcesContent":["// Libraries\nimport React, { Component } from 'react';\nimport { hot } from 'react-hot-loader';\nimport { connect } from 'react-redux';\n\n// Components\nimport { DashboardPanel } from '../dashgrid/DashboardPanel';\n\n// Redux\nimport { initDashboard } from '../state/initDashboard';\n\n// Types\nimport { StoreState, DashboardRouteInfo } from 'app/types';\nimport { PanelModel, DashboardModel } from 'app/features/dashboard/state';\n\nexport interface Props {\n urlPanelId: string;\n urlUid?: string;\n urlSlug?: string;\n urlType?: string;\n $scope: any;\n $injector: any;\n routeInfo: DashboardRouteInfo;\n initDashboard: typeof initDashboard;\n dashboard: DashboardModel | null;\n}\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 { $injector, $scope, urlUid, urlType, urlSlug, routeInfo } = this.props;\n\n this.props.initDashboard({\n $injector: $injector,\n $scope: $scope,\n urlSlug: urlSlug,\n urlUid: urlUid,\n urlType: urlType,\n routeInfo: routeInfo,\n fixUrl: false,\n });\n }\n\n componentDidUpdate(prevProps: Props) {\n const { urlPanelId, 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 panelId = parseInt(urlPanelId, 10);\n\n // need to expand parent row if this panel is inside a row\n dashboard.expandParentRowFor(panelId);\n\n const panel = dashboard.getPanelById(panelId);\n\n if (!panel) {\n this.setState({ notFound: true });\n return;\n }\n\n this.setState({ panel });\n }\n }\n\n render() {\n const { urlPanelId, dashboard } = this.props;\n const { notFound, panel } = this.state;\n\n if (notFound) {\n return
Panel with id {urlPanelId} not found
;\n }\n\n if (!panel || !dashboard) {\n return
Loading & initializing dashboard
;\n }\n\n return (\n
\n \n
\n );\n }\n}\n\nconst mapStateToProps = (state: StoreState) => ({\n urlUid: state.location.routeParams.uid,\n urlSlug: state.location.routeParams.slug,\n urlType: state.location.routeParams.type,\n urlPanelId: state.location.query.panelId,\n dashboard: state.dashboard.getModel() as DashboardModel,\n});\n\nconst mapDispatchToProps = {\n initDashboard,\n};\n\nexport default hot(module)(connect(mapStateToProps, mapDispatchToProps)(SoloPanelPage));\n"],"sourceRoot":""}