Add function to set service when flux toggled on dynamic source
parent
e9e417e427
commit
deda6c936b
|
@ -125,7 +125,7 @@ class CellEditorOverlay extends Component<Props, State> {
|
|||
queryStatus,
|
||||
} = this.props
|
||||
|
||||
const {isStaticLegend} = this.state
|
||||
const {isStaticLegend, currentService} = this.state
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -147,6 +147,7 @@ class CellEditorOverlay extends Component<Props, State> {
|
|||
onResetFocus={this.handleResetFocus}
|
||||
isInCEO={true}
|
||||
sources={sources}
|
||||
service={currentService}
|
||||
services={services}
|
||||
updateQueryDrafts={updateQueryDrafts}
|
||||
onToggleStaticLegend={this.handleToggleStaticLegend}
|
||||
|
|
|
@ -1022,7 +1022,20 @@ class TimeMachine extends PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
private toggleFlux = (): void => {
|
||||
console.log('toggling!')
|
||||
const {services, updateService} = this.props
|
||||
|
||||
if (this.isFluxSource) {
|
||||
this.setState({selectedService: null})
|
||||
updateService(null)
|
||||
} else {
|
||||
const foundFluxForSource = services.find(service => {
|
||||
return service.sourceID === this.source.id
|
||||
})
|
||||
|
||||
if (foundFluxForSource) {
|
||||
updateService(foundFluxForSource)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue