diff --git a/lib/osf-components/addon/components/search-page/filter-facet/component.ts b/lib/osf-components/addon/components/search-page/filter-facet/component.ts index 3367e679bc3..18a0070c4fe 100644 --- a/lib/osf-components/addon/components/search-page/filter-facet/component.ts +++ b/lib/osf-components/addon/components/search-page/filter-facet/component.ts @@ -48,12 +48,21 @@ export default class FilterFacet extends Component { @tracked hasMoreValueOptions = false; @tracked nextPageCursor = ''; + get shouldShowTopValues() { + const { args: { property: { propertyPathKey } } } = this; + return propertyPathKey !== 'creator'; + } + @action toggleFacet() { - if (this.filterableValues.length === 0 && !taskFor(this.fetchFacetValues).lastComplete) { - taskFor(this.fetchFacetValues).perform(); + if (this.shouldShowTopValues) { + if (this.filterableValues.length === 0 && !taskFor(this.fetchFacetValues).lastComplete) { + taskFor(this.fetchFacetValues).perform(); + } + this.collapsed = !this.collapsed; + } else { + this.openSeeMoreModal(); } - this.collapsed = !this.collapsed; } @action @@ -105,8 +114,14 @@ export default class FilterFacet extends Component { @waitFor async fetchFacetValues() { const { cardSearchText, cardSearchFilter, property } = this.args; - const { page, sort, filterString } = this; - + const { page, sort, filterString, shouldShowTopValues } = this; + if (!shouldShowTopValues && !filterString.trim()) { + this.filterableValues = []; + this.modalValueOptions = []; + this.hasMoreValueOptions = false; + this.nextPageCursor = ''; + return; // skip fetching + } const valueSearch = await this.store.queryRecord('index-value-search', { cardSearchText, cardSearchFilter,