Fix advanced filter creation of group rule (#10690)

This PR improves advanced filter code and fixes the bug that prevented
the creation of a filter group.

On the debugging side : 
- Adding an advanced filter rule to create a group now works

On the refactoring side : 
- We now use AdvancedFilterRecordFilterGroupChildOptionsDropdown to
clarify the code that show the option dropdown of a group.
- Refacatored useCurrentViewViewFilterGroup to
useChildRecordFiltersAndRecordFilterGroups. It is now using only
RecordFilter and RecordFilterGroup type instead of view types. It also
exports recordFilters and recordFilterGroups alone, when they are
children of a group, so we don't have to extract them from the merged
array that is typed RecordFilter | RecordFilterGroup, which is necessary
for displaying a group.
- Two typeguards have been introduced to help discern RecordFilter from
RecordFilterGroup : isRecordFilterGroupChildARecordFilterGroup and
isRecordFilterGroupChildARecordFilter, this allows to remove any typing
on child processing.
- Renaming from view to record (but there are still some left)
This commit is contained in:
Lucas Bordeau
2025-03-06 17:57:23 +01:00
committed by GitHub
parent cb5f4820d7
commit 777c12dd06
13 changed files with 293 additions and 223 deletions

View File

@ -72,7 +72,7 @@ export const AdvancedFilterDropdownButton = () => {
}
dropdownComponents={
<AdvancedFilterRootLevelViewFilterGroup
rootLevelViewFilterGroupId={outermostRecordFilterGroupId}
rootLevelRecordFilterGroupId={outermostRecordFilterGroupId}
/>
}
dropdownHotkeyScope={{ scope: ADVANCED_FILTER_DROPDOWN_ID }}