Elasticsearch: Fix script fields in query editor (#31681)

* Elasticsearch: Fix script fields in query editor

* properly name bucke_script deries
This commit is contained in:
Giordano Ricci
2021-03-05 12:48:45 +00:00
committed by GitHub
parent 54f281d6ed
commit 64a8514e47
7 changed files with 74 additions and 27 deletions

View File

@@ -23,12 +23,16 @@ interface Props {
value?: string;
}
export const MetricPicker: FunctionComponent<Props> = ({ options, onChange, className, value }) => (
<Segment
className={cx(className, noWrap)}
options={toOptions(options)}
onChange={onChange}
placeholder="Select Metric"
value={!!value ? toOption(options.find((option) => option.id === value)!) : null}
/>
);
export const MetricPicker: FunctionComponent<Props> = ({ options, onChange, className, value }) => {
const selectedOption = options.find((option) => option.id === value);
return (
<Segment
className={cx(className, noWrap)}
options={toOptions(options)}
onChange={onChange}
placeholder="Select Metric"
value={!!selectedOption ? toOption(selectedOption) : null}
/>
);
};