|
|
@ -92,11 +92,12 @@ export class DashboardPage extends PureComponent<Props, State> { |
|
|
|
componentWillUnmount() { |
|
|
|
componentWillUnmount() { |
|
|
|
if (this.props.dashboard) { |
|
|
|
if (this.props.dashboard) { |
|
|
|
this.props.cleanUpDashboard(); |
|
|
|
this.props.cleanUpDashboard(); |
|
|
|
|
|
|
|
this.setPanelFullscreenClass(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps: Props) { |
|
|
|
componentDidUpdate(prevProps: Props) { |
|
|
|
const { dashboard, editview, urlEdit, urlFullscreen, urlPanelId } = this.props; |
|
|
|
const { dashboard, editview, urlEdit, urlFullscreen, urlPanelId, urlUid } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
if (!dashboard) { |
|
|
|
if (!dashboard) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -107,6 +108,12 @@ export class DashboardPage extends PureComponent<Props, State> { |
|
|
|
document.title = dashboard.title + ' - Grafana'; |
|
|
|
document.title = dashboard.title + ' - Grafana'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Due to the angular -> react url bridge we can ge an update here with new uid before the container unmounts
|
|
|
|
|
|
|
|
// Can remove this condition after we switch to react router
|
|
|
|
|
|
|
|
if (prevProps.urlUid !== urlUid) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// handle animation states when opening dashboard settings
|
|
|
|
// handle animation states when opening dashboard settings
|
|
|
|
if (!prevProps.editview && editview) { |
|
|
|
if (!prevProps.editview && editview) { |
|
|
|
this.setState({ isSettingsOpening: true }); |
|
|
|
this.setState({ isSettingsOpening: true }); |
|
|
|