-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't filter single runs in the comparison view (#9789)
(cherry picked from commit cdbbedd)
- Loading branch information
1 parent
0b89fad
commit 1841a8e
Showing
5 changed files
with
71 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
Conjunction, | ||
FormFieldWithoutId, | ||
FormGroupWithoutId, | ||
} from 'components/FilterForm/components/type'; | ||
|
||
/** | ||
* build a new filter group given an existing one and a child. will add the child | ||
* as a child of the current formGroup if the conjunction matches, otherwise | ||
* will create a new wrapper group having both as children | ||
*/ | ||
export const combine = ( | ||
filterGroup: FormGroupWithoutId, | ||
conjunction: Conjunction, | ||
child: FormGroupWithoutId | FormFieldWithoutId, | ||
): FormGroupWithoutId => { | ||
if (filterGroup.conjunction === conjunction) { | ||
return { | ||
...filterGroup, | ||
children: [...filterGroup.children, child], | ||
}; | ||
} | ||
return { | ||
children: [filterGroup, child], | ||
conjunction, | ||
kind: 'group', | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters