Add local source logic to local queryStateReducer
parent
44e720eebf
commit
23c4e3f429
|
@ -66,8 +66,12 @@ class CellEditorOverlay extends Component {
|
||||||
const nextQuery = queryModifier(query, payload)
|
const nextQuery = queryModifier(query, payload)
|
||||||
|
|
||||||
const nextQueries = queriesWorkingDraft.map(
|
const nextQueries = queriesWorkingDraft.map(
|
||||||
q => (q.id === query.id ? nextQuery : q)
|
q =>
|
||||||
|
q.id === query.id
|
||||||
|
? {...nextQuery, source: this.nextSource(q, nextQuery)}
|
||||||
|
: q
|
||||||
)
|
)
|
||||||
|
|
||||||
this.setState({queriesWorkingDraft: nextQueries})
|
this.setState({queriesWorkingDraft: nextQueries})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,6 +273,14 @@ class CellEditorOverlay extends Component {
|
||||||
return querySource || source
|
return querySource || source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nextSource = (prevQuery, nextQuery) => {
|
||||||
|
if (nextQuery.source) {
|
||||||
|
return nextQuery.source
|
||||||
|
}
|
||||||
|
|
||||||
|
return prevQuery.source
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
onCancel,
|
onCancel,
|
||||||
|
|
Loading…
Reference in New Issue