Skip to content

Commit

Permalink
Put the chart within flex item
Browse files Browse the repository at this point in the history
  • Loading branch information
fkanout committed Mar 28, 2023
1 parent 138972a commit a065a5f
Showing 1 changed file with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { ALERT_DURATION, ALERT_END } from '@kbn/rule-data-utils';
import moment from 'moment';
import React from 'react';
Expand Down Expand Up @@ -33,19 +34,23 @@ const AlertDetailsAppSection = ({ rule, alert }: AlertDetailsAppSectionProps) =>

return (
// Create a chart per-criteria
rule.params.criteria.map((criteria) => {
const chartCriterion = criteria as PartialCriterion;
return (
<CriterionPreview
key={chartCriterion.field}
ruleParams={rule.params}
sourceId={rule.params.logView.logViewId}
chartCriterion={chartCriterion}
showThreshold={true}
executionTimeRange={{ gte: rangeFrom, lte: rangeTo }}
/>
);
})
<EuiFlexGroup>
{rule.params.criteria.map((criteria) => {
const chartCriterion = criteria as PartialCriterion;
return (
<EuiFlexItem>
<CriterionPreview
key={chartCriterion.field}
ruleParams={rule.params}
sourceId={rule.params.logView.logViewId}
chartCriterion={chartCriterion}
showThreshold={true}
executionTimeRange={{ gte: rangeFrom, lte: rangeTo }}
/>
</EuiFlexItem>
);
})}
</EuiFlexGroup>
);
};
// eslint-disable-next-line import/no-default-export
Expand Down

0 comments on commit a065a5f

Please sign in to comment.