@@ -3,6 +3,7 @@ import Component from '@glimmer/component';
33import { tracked } from '@glimmer/tracking' ;
44
55import InstitutionModel from 'ember-osf-web/models/institution' ;
6+ import { SuggestedFilterOperators } from 'ember-osf-web/models/related-property-path' ;
67import SearchResultModel from 'ember-osf-web/models/search-result' ;
78import { Filter } from 'osf-components/components/search-page/component' ;
89
@@ -29,7 +30,7 @@ export type ObjectListColumn = ValueColumn | LinkColumn | ComponentColumn;
2930
3031interface InstitutionalObjectListArgs {
3132 institution : InstitutionModel ;
32- defaultQueryOptions : Record < 'cardSearchFilter' , Record < string , string [ ] > > ;
33+ defaultQueryOptions : Record < 'cardSearchFilter' , Record < string , string [ ] | any > > ;
3334 columns : ObjectListColumn [ ] ;
3435 objectType : string ;
3536}
@@ -53,6 +54,11 @@ export default class InstitutionalObjectList extends Component<InstitutionalObje
5354 sort : this . sortParam ? { [ this . sortParam ] : this . sort } : this . sort ,
5455 } ;
5556 const fullQueryOptions = this . activeFilters . reduce ( ( acc , filter : Filter ) => {
57+ if ( filter . suggestedFilterOperator === SuggestedFilterOperators . IsPresent ) {
58+ acc . cardSearchFilter [ filter . propertyPathKey ] = { } ;
59+ acc . cardSearchFilter [ filter . propertyPathKey ] [ filter . value ] = true ;
60+ return acc ;
61+ }
5662 const currentValue = acc . cardSearchFilter [ filter . propertyPathKey ] ;
5763 acc . cardSearchFilter [ filter . propertyPathKey ] =
5864 currentValue ? currentValue . concat ( filter . value ) : [ filter . value ] ;
0 commit comments