Skip to content

Commit

Permalink
Fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Jun 25, 2020
1 parent 75cee14 commit 903bf3b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { debounce, pick, omit } from 'lodash';
import { debounce, pick } from 'lodash';
import { Unit } from '@elastic/datemath';
import React, { ChangeEvent, useCallback, useMemo, useEffect, useState } from 'react';
import {
Expand Down Expand Up @@ -223,6 +223,13 @@ export const Expressions: React.FC<Props> = (props) => {
}
}, [alertsContext.metadata, derivedIndexPattern, setAlertParams]);

const preFillAlertGroupBy = useCallback(() => {
const md = alertsContext.metadata;
if (md && md.currentOptions?.groupBy && !md.series) {
setAlertParams('groupBy', md.currentOptions.groupBy);
}
}, [alertsContext.metadata, setAlertParams]);

useEffect(() => {
if (alertParams.criteria && alertParams.criteria.length) {
setTimeSize(alertParams.criteria[0].timeSize);
Expand Down

0 comments on commit 903bf3b

Please sign in to comment.