Explore: Adds logs highlighting in Explore on keypress (#16596)

Fixes: #16277
This commit is contained in:
Hugo Häggmark 2019-04-16 16:27:57 +02:00 committed by Torkel Ödegaard
parent 75f9adf44f
commit 7b63913dc1

View File

@ -151,6 +151,9 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
if (textChanged && invokeParentOnValueChanged) {
this.executeOnQueryChangeAndExecuteQueries();
}
if (textChanged && !invokeParentOnValueChanged) {
this.updateLogsHighlights();
}
}
});
@ -163,6 +166,13 @@ export class QueryField extends React.PureComponent<QueryFieldProps, QueryFieldS
}
};
updateLogsHighlights = () => {
const { onQueryChange } = this.props;
if (onQueryChange) {
onQueryChange(Plain.serialize(this.state.value));
}
};
executeOnQueryChangeAndExecuteQueries = () => {
// Send text change to parent
const { onQueryChange, onExecuteQuery } = this.props;