diff --git a/libs/ui/src/components/Explorer/_queries/useExplorerData.ts b/libs/ui/src/components/Explorer/_queries/useExplorerData.ts index 12738166e..62fd36564 100644 --- a/libs/ui/src/components/Explorer/_queries/useExplorerData.ts +++ b/libs/ui/src/components/Explorer/_queries/useExplorerData.ts @@ -131,27 +131,26 @@ export const useExplorerData = ({ }) => { const {lang: availableLangs} = useLang(); - const preparedFilters: RecordFilterInput[][] = filters - .filter( - ({value, condition}) => - value !== null || - [RecordFilterCondition.IS_EMPTY, RecordFilterCondition.IS_NOT_EMPTY].includes(condition) - ) - .map(({attribute, field, condition, value}) => - attribute.format === AttributeFormat.date - ? _getDateRequestFilters({field, condition, value}) - : [ - { - field, - condition, - value - } - ] - ); - const queryFilters: RecordFilterInput[] = interleaveElement( + const queryFilters = interleaveElement( {operator: RecordFilterOperator.AND}, - preparedFilters - ) as RecordFilterInput[]; + filters + .filter( + ({value, condition}) => + value !== null || + [RecordFilterCondition.IS_EMPTY, RecordFilterCondition.IS_NOT_EMPTY].includes(condition) + ) + .map(({attribute, field, condition, value}) => + attribute.format === AttributeFormat.date + ? _getDateRequestFilters({field, condition, value}) + : [ + { + field, + condition, + value + } + ] + ) + ); const {data, loading, refetch} = useExplorerQuery({ skip, diff --git a/libs/ui/src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx b/libs/ui/src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx index dffd3b1d6..8c756c9ee 100644 --- a/libs/ui/src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx +++ b/libs/ui/src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx @@ -87,10 +87,11 @@ export const FilterItems: FunctionComponent<{libraryId: string}> = ({libraryId}) dispatch({type: ViewSettingsActionTypes.MOVE_FILTER, payload: {indexFrom, indexTo}}); }; + const ignoredTypes = [AttributeType.tree]; const activeFilters = filters.filter(({field}) => searchFilteredColumnsIds.includes(field)); const inactiveFilters = searchFilteredColumnsIds.filter( attributeId => - attributeDetailsById?.[attributeId]?.type === AttributeType.simple && + !ignoredTypes.includes(attributeDetailsById?.[attributeId]?.type) && filters.every(filterItem => filterItem.field !== attributeId) );