Add local source logic to local queryStateReducer
parent
ebd935ef35
commit
97ee2e3047
|
@ -66,8 +66,12 @@ class CellEditorOverlay extends Component {
|
|||
const nextQuery = queryModifier(query, payload)
|
||||
|
||||
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})
|
||||
}
|
||||
|
||||
|
@ -269,6 +273,14 @@ class CellEditorOverlay extends Component {
|
|||
return querySource || source
|
||||
}
|
||||
|
||||
nextSource = (prevQuery, nextQuery) => {
|
||||
if (nextQuery.source) {
|
||||
return nextQuery.source
|
||||
}
|
||||
|
||||
return prevQuery.source
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
onCancel,
|
||||
|
|
Loading…
Reference in New Issue