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,
|
queryStatus,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
const {isStaticLegend} = this.state
|
const {isStaticLegend, currentService} = this.state
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -147,6 +147,7 @@ class CellEditorOverlay extends Component<Props, State> {
|
||||||
onResetFocus={this.handleResetFocus}
|
onResetFocus={this.handleResetFocus}
|
||||||
isInCEO={true}
|
isInCEO={true}
|
||||||
sources={sources}
|
sources={sources}
|
||||||
|
service={currentService}
|
||||||
services={services}
|
services={services}
|
||||||
updateQueryDrafts={updateQueryDrafts}
|
updateQueryDrafts={updateQueryDrafts}
|
||||||
onToggleStaticLegend={this.handleToggleStaticLegend}
|
onToggleStaticLegend={this.handleToggleStaticLegend}
|
||||||
|
|
|
@ -1022,7 +1022,20 @@ class TimeMachine extends PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private toggleFlux = (): void => {
|
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