From 19494c9027c923269b4636a4703b55032a26bc4d Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:01:48 -0400 Subject: [PATCH] Use less restrictive filter to fetch non-boolean filters (#1999) --- app/models/related-property-path.ts | 3 ++- lib/osf-components/addon/components/search-page/component.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/related-property-path.ts b/app/models/related-property-path.ts index d3ae261edeb..1c73cb83686 100644 --- a/app/models/related-property-path.ts +++ b/app/models/related-property-path.ts @@ -15,7 +15,8 @@ interface PropertyPath { export enum SuggestedFilterOperators { AnyOf = 'any-of', - IsPresent = 'is-present' + IsPresent = 'is-present', + AtDate = 'at-date' } export default class RelatedPropertyPathModel extends OsfModel { diff --git a/lib/osf-components/addon/components/search-page/component.ts b/lib/osf-components/addon/components/search-page/component.ts index 34a3e7b3794..9b7c040c3cd 100644 --- a/lib/osf-components/addon/components/search-page/component.ts +++ b/lib/osf-components/addon/components/search-page/component.ts @@ -230,8 +230,9 @@ export default class SearchPage extends Component { await searchResult.relatedProperties; this.booleanFilters = searchResult.relatedProperties .filterBy('suggestedFilterOperator', SuggestedFilterOperators.IsPresent); - this.relatedProperties = searchResult.relatedProperties - .filterBy('suggestedFilterOperator', SuggestedFilterOperators.AnyOf); + this.relatedProperties = searchResult.relatedProperties.filter( + property => property.suggestedFilterOperator !== SuggestedFilterOperators.IsPresent, // AnyOf or AtDate + ); this.firstPageCursor = searchResult.firstPageCursor; this.nextPageCursor = searchResult.nextPageCursor; this.prevPageCursor = searchResult.prevPageCursor;