mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ResponseOps][Alerting] ES query rule DSL editor doesn't update when you copy/paste a query (#162330)
Resolves https://github.com/elastic/kibana/issues/161595 ## Summary Captures changes in the editor when copying/pasting in values. ### To verify - Create a new Es Query rule using DSL - Paste runtime mappings in your query and don't type anything else in the editor - Verify that the runtime fields are listed in the group by or aggregate over options below the query
This commit is contained in:
parent
7429c824bf
commit
89ad530e8c
1 changed files with 3 additions and 3 deletions
|
@ -114,10 +114,10 @@ export const EsQueryExpression: React.FC<
|
|||
setCombinedFields(sortBy(currentEsFields.concat(runtimeFields), 'name'));
|
||||
};
|
||||
|
||||
const getRuntimeFields = () => {
|
||||
const getRuntimeFields = (xjson: string) => {
|
||||
let runtimeMappings;
|
||||
try {
|
||||
runtimeMappings = get(JSON.parse(xJson), 'runtime_mappings');
|
||||
runtimeMappings = get(JSON.parse(xjson), 'runtime_mappings');
|
||||
} catch (e) {
|
||||
// ignore error
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ export const EsQueryExpression: React.FC<
|
|||
onChange={(xjson: string) => {
|
||||
setXJson(xjson);
|
||||
setParam('esQuery', convertToJson(xjson));
|
||||
getRuntimeFields();
|
||||
getRuntimeFields(xjson);
|
||||
}}
|
||||
options={{
|
||||
ariaLabel: i18n.translate('xpack.stackAlerts.esQuery.ui.queryEditor', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue