Skip to content

Commit

Permalink
fix(ui): edit correlation group when only 1 group exists
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed May 7, 2024
1 parent 5309866 commit c8d254e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions keep-ui/app/rules/CorrelationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ export const CorrelationTable = ({ rules }: CorrelationTableProps) => {
const correlationFormFromRule: CorrelationForm = useMemo(() => {
if (selectedRule) {
const query = parseCEL(selectedRule.definition_cel);
const anyCombinator = query.rules.some((rule) => "combinator" in rule);

const queryInGroup: DefaultRuleGroupType = {
...query,
rules:
query.rules.length > 1
? query.rules
: [
{
combinator: "and",
rules: query.rules,
},
],
rules: anyCombinator
? query.rules
: [
{
combinator: "and",
rules: query.rules,
},
],
};

return {
Expand Down

0 comments on commit c8d254e

Please sign in to comment.