From 09539e22e345e02ea1b77e118dda08dfa0f73cd0 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 22 Aug 2023 16:44:10 -0400 Subject: [PATCH 1/2] Add project/preprint supplements field as boolean fields --- .../addon/components/search-page/filter-facet/component.ts | 2 ++ 1 file changed, 2 insertions(+) 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 c56c41e3d0..0827ec4518 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 @@ -39,6 +39,8 @@ export const booleanFilterProperties = [ 'hasDataResource', // registrations and preprints 'hasPreregisteredAnalysisPlan', // preprints 'hasPreregisteredStudyDesign', // preprints + 'isSupplementedBy', // preprints + 'supplements', // projects ]; export default class FilterFacet extends Component { From 14407b043ae91b8335520eecd8cbba18244c7349 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 22 Aug 2023 16:44:42 -0400 Subject: [PATCH 2/2] Remove is-absent option from boolean filter fields --- .../components/search-page/filter-facet/component.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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 0827ec4518..ebecb1bfb0 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 @@ -121,6 +121,7 @@ export default class FilterFacet extends Component { // If the property is a boolean filter (e.g. hasDataResource), we don't want to fetch IRI values // SHARE API filters on these properties using: // `share.osf.io/api/v3/index-card-search?cardSearchFilter[hasDataResource][is-present]` + // or cardSearchFilter[hasDataResource][is-absent] (although this one is not used in the app) if (booleanFilterProperties.includes(property.shortFormLabel)) { this.filterableValues = [ { @@ -130,13 +131,6 @@ export default class FilterFacet extends Component { resourceId: 'is-present', }, }, - { - resourceId: 'is-absent', - indexCard: { - label: this.intl.t('search.filter-facet.no-resource', { resource: property.displayLabel }), - resourceId: 'is-absent', - }, - }, ]; return; }