Merge pull request #12806 from influxdata/fix/open-veo-graph

fix(ui): fetch queries when opening veo
pull/12820/head
Iris Scholten 2019-03-21 10:15:34 -07:00 committed by GitHub
commit cc1c56e6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -32,6 +32,7 @@ import {VEO_TIME_MACHINE_ID} from 'src/timeMachine/constants'
// Nofication Messages
import {cellAddFailed} from 'src/shared/copy/notifications'
import {executeQueries} from 'src/timeMachine/actions/queries'
interface StateProps {
draftView: QueryView
@ -46,6 +47,7 @@ interface DispatchProps {
onUpdateView: typeof viewActions.updateView
notify: typeof notify
setActiveTimeMachine: typeof setActiveTimeMachine
executeQueries: typeof executeQueries
}
interface OwnProps extends WithRouterProps {
@ -58,6 +60,15 @@ interface OwnProps extends WithRouterProps {
type Props = OwnProps & StateProps & DispatchProps
class VEO extends PureComponent<Props, {}> {
public componentDidMount() {
const {existingView} = this.props
const view = existingView || createView<XYView>(ViewType.XY)
this.props.setActiveTimeMachine(VEO_TIME_MACHINE_ID, {view})
this.props.executeQueries()
}
public render() {
const {draftView, onSetName} = this.props
@ -79,13 +90,6 @@ class VEO extends PureComponent<Props, {}> {
)
}
public async componentDidMount() {
const {existingView} = this.props
const view = existingView || createView<XYView>(ViewType.XY)
this.props.setActiveTimeMachine(VEO_TIME_MACHINE_ID, {view})
}
private handleSave = async (): Promise<void> => {
const {
draftView,
@ -144,6 +148,7 @@ const mdtp: DispatchProps = {
onUpdateView: viewActions.updateView,
setActiveTimeMachine,
notify,
executeQueries,
}
export default connect<StateProps, DispatchProps, OwnProps>(