Add methods for dashboard changes

pull/10616/head
Delmer Reed 2018-07-12 11:38:37 -04:00
parent 5514abc38f
commit 923a4ccc71
1 changed files with 9 additions and 7 deletions

View File

@ -357,13 +357,16 @@ class DashboardPage extends Component<Props, State> {
const {dashboardID, source, getDashboardWithTemplatesAsync} = this.props
await getDashboardWithTemplatesAsync(dashboardID, source)
this.updateActiveDashboard()
}
const dashboardLinks = updateActiveDashboardLink(
this.state.dashboardLinks,
this.props.dashboard
)
this.setState({dashboardLinks})
private updateActiveDashboard(): void {
this.setState((prevState, props) => ({
dashboardLinks: updateActiveDashboardLink(
prevState.dashboardLinks,
props.dashboard
),
}))
}
private inView = (cell: DashboardsModels.Cell): boolean => {
@ -450,7 +453,6 @@ class DashboardPage extends Component<Props, State> {
private updateLinkName(): void {
this.setState((prevState, props) => ({
...prevState,
dashboardLinks: updateDashboardLinkName(
prevState.dashboardLinks,
props.dashboard