diff --git a/src/files/domain/models/FileCriteria.ts b/src/files/domain/models/FileCriteria.ts index 8de6c9dab..30720deba 100644 --- a/src/files/domain/models/FileCriteria.ts +++ b/src/files/domain/models/FileCriteria.ts @@ -62,6 +62,15 @@ export class FileCriteria { searchText ) } + + get someFilterApplied(): boolean { + return ( + this.filterByType !== undefined || + this.filterByAccess !== undefined || + this.filterByTag !== undefined || + this.searchText !== undefined + ) + } } export enum FileSortByOption { diff --git a/src/sections/dataset/dataset-files/file-criteria-form/FileCriteriaForm.tsx b/src/sections/dataset/dataset-files/file-criteria-form/FileCriteriaForm.tsx index 26194bc35..d2cec669e 100644 --- a/src/sections/dataset/dataset-files/file-criteria-form/FileCriteriaForm.tsx +++ b/src/sections/dataset/dataset-files/file-criteria-form/FileCriteriaForm.tsx @@ -19,7 +19,8 @@ export function FileCriteriaForm({ filesCountInfo }: FileCriteriaInputsProps) { const showFileCriteriaInputs = - filesCountInfo && filesCountInfo.total >= MINIMUM_FILES_TO_SHOW_CRITERIA_INPUTS + filesCountInfo && + (filesCountInfo.total >= MINIMUM_FILES_TO_SHOW_CRITERIA_INPUTS || criteria.someFilterApplied) return (