Use props instead of state for Dashboard name list
parent
498297f21b
commit
90b138cb53
|
@ -39,13 +39,12 @@ class DashboardPage extends Component {
|
||||||
selectedCell: null,
|
selectedCell: null,
|
||||||
isTemplating: false,
|
isTemplating: false,
|
||||||
zoomedTimeRange: {zoomedLower: null, zoomedUpper: null},
|
zoomedTimeRange: {zoomedLower: null, zoomedUpper: null},
|
||||||
names: [],
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
const {
|
const {
|
||||||
params: {dashboardID, sourceID},
|
params: {dashboardID},
|
||||||
dashboardActions: {
|
dashboardActions: {
|
||||||
getDashboardsAsync,
|
getDashboardsAsync,
|
||||||
updateTempVarValues,
|
updateTempVarValues,
|
||||||
|
@ -62,13 +61,6 @@ class DashboardPage extends Component {
|
||||||
// Refresh and persists influxql generated template variable values
|
// Refresh and persists influxql generated template variable values
|
||||||
await updateTempVarValues(source, dashboard)
|
await updateTempVarValues(source, dashboard)
|
||||||
await putDashboardByID(dashboardID)
|
await putDashboardByID(dashboardID)
|
||||||
|
|
||||||
const names = dashboards.map(d => ({
|
|
||||||
name: d.name,
|
|
||||||
link: `/sources/${sourceID}/dashboards/${d.id}`,
|
|
||||||
}))
|
|
||||||
|
|
||||||
this.setState({names})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOpenTemplateManager = () => {
|
handleOpenTemplateManager = () => {
|
||||||
|
@ -294,7 +286,11 @@ class DashboardPage extends Component {
|
||||||
templatesIncludingDashTime = []
|
templatesIncludingDashTime = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const {selectedCell, isEditMode, isTemplating, names} = this.state
|
const {selectedCell, isEditMode, isTemplating} = this.state
|
||||||
|
const names = dashboards.map(d => ({
|
||||||
|
name: d.name,
|
||||||
|
link: `/sources/${sourceID}/dashboards/${d.id}`,
|
||||||
|
}))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page">
|
<div className="page">
|
||||||
|
|
Loading…
Reference in New Issue