diff --git a/app/institutions/dashboard/-components/object-list/template.hbs b/app/institutions/dashboard/-components/object-list/template.hbs index 144ddaa768..f7f9668324 100644 --- a/app/institutions/dashboard/-components/object-list/template.hbs +++ b/app/institutions/dashboard/-components/object-list/template.hbs @@ -240,6 +240,14 @@ as |list|> @toggleFilter={{queue this.toggleFilter (perform list.searchObjectsTask)}} /> {{/each}} + {{#if list.booleanFilters.length}} + + {{/if}} {{/if}} diff --git a/lib/osf-components/addon/components/index-card-searcher/component.ts b/lib/osf-components/addon/components/index-card-searcher/component.ts index ae2f24192b..c0b36fc667 100644 --- a/lib/osf-components/addon/components/index-card-searcher/component.ts +++ b/lib/osf-components/addon/components/index-card-searcher/component.ts @@ -8,7 +8,7 @@ import Toast from 'ember-toastr/services/toast'; import SearchResultModel from 'ember-osf-web/models/search-result'; import { taskFor } from 'ember-concurrency-ts'; -import RelatedPropertyPathModel from 'ember-osf-web/models/related-property-path'; +import RelatedPropertyPathModel, { SuggestedFilterOperators } from 'ember-osf-web/models/related-property-path'; interface IndexCardSearcherArgs { queryOptions: Record; @@ -25,6 +25,7 @@ export default class IndexCardSearcher extends Component @tracked totalResultCount = 0; @tracked relatedProperties?: RelatedPropertyPathModel[] = []; + @tracked booleanFilters?: RelatedPropertyPathModel[] = []; @tracked firstPageCursor?: string; @tracked nextPageCursor?: string; @@ -57,7 +58,12 @@ export default class IndexCardSearcher extends Component try { const searchResult = await this.store.queryRecord('index-card-search', this.args.queryOptions); - this.relatedProperties = await searchResult.relatedProperties; + this.booleanFilters = searchResult.relatedProperties + .filterBy('suggestedFilterOperator', SuggestedFilterOperators.IsPresent); + this.relatedProperties = searchResult.relatedProperties.filter( + (property: RelatedPropertyPathModel) => + property.suggestedFilterOperator !== SuggestedFilterOperators.IsPresent, // AnyOf or AtDate + ); this.firstPageCursor = searchResult.firstPageCursor; this.nextPageCursor = searchResult.nextPageCursor; this.prevPageCursor = searchResult.prevPageCursor; diff --git a/lib/osf-components/addon/components/index-card-searcher/template.hbs b/lib/osf-components/addon/components/index-card-searcher/template.hbs index 7b9c1448ca..76d1db68bd 100644 --- a/lib/osf-components/addon/components/index-card-searcher/template.hbs +++ b/lib/osf-components/addon/components/index-card-searcher/template.hbs @@ -1,6 +1,7 @@ {{yield (hash searchResults=this.searchResults relatedProperties=this.relatedProperties + booleanFilters=this.booleanFilters totalResultCount=this.totalResultCount debouceSearchObjectsTask=this.debouceSearchObjectsTask