diff --git a/src/common/components/FilterChip.tsx b/src/common/components/FilterChip.tsx index 521017e0..f24d8755 100644 --- a/src/common/components/FilterChip.tsx +++ b/src/common/components/FilterChip.tsx @@ -30,6 +30,8 @@ export const FilterChip = ({ }) .map((val) => val.toLocaleString()); filterString = `${minString} to ${maxString}`; + } else if (filter.type === 'bool') { + filterString = Boolean(filter.value).toString(); } else { const val = filter.value; if (typeof val === 'string') { diff --git a/src/features/collections/CollectionDetail.tsx b/src/features/collections/CollectionDetail.tsx index 2d781a6c..cbb2f349 100644 --- a/src/features/collections/CollectionDetail.tsx +++ b/src/features/collections/CollectionDetail.tsx @@ -49,7 +49,7 @@ import { import { useForm } from 'react-hook-form'; import { CollectionOverview } from './CollectionOverview'; import { FilterChip } from '../../common/components/FilterChip'; -import { FilterContextTabs } from './Filters'; +import { filterContextScope, FilterContextTabs } from './Filters'; export const detailPath = ':id'; export const detailDataProductPath = ':id/:data_product'; @@ -406,6 +406,7 @@ const useFilterEntries = (collectionId: string) => { }; const FilterChips = ({ collectionId }: { collectionId: string }) => { + const { columnMeta } = useFilters(collectionId); const { filterEntries, clearFilterState, context } = useFilterEntries(collectionId); if (filterEntries.length === 0) return <>; @@ -416,7 +417,7 @@ const FilterChips = ({ collectionId }: { collectionId: string }) => { clearFilterState(column)} /> ); @@ -456,11 +457,19 @@ const FilterMenu = ({ setExpandedCategory(expanded ? category : ''); }; + const menuLabel = { + DEFAULT: 'Filters', + genomes: 'Genome Filters', + samples: 'Sample Filters', + biolog: 'Biolog Filters', + microtrait: 'Microtrait Filters', + }[filterContextScope(context) || 'DEFAULT']; + if (open) { return (
-

Genome Filters

+

{menuLabel}