mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix - hide search text field in the filter section if the number of facet values does not exceed the maximum number of facet values shown
This commit is contained in:

committed by
Tim Donohue

parent
ebf9469846
commit
906b2f5917
@@ -104,6 +104,10 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
isLastPage$: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
isLastPage$: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emits true if show the search text
|
||||||
|
*/
|
||||||
|
isAvailableForShowSearchText: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
||||||
/**
|
/**
|
||||||
* The value of the input field that is used to query for possible values for this filter
|
* The value of the input field that is used to query for possible values for this filter
|
||||||
*/
|
*/
|
||||||
@@ -289,6 +293,8 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
|||||||
getFirstSucceededRemoteDataPayload(),
|
getFirstSucceededRemoteDataPayload(),
|
||||||
tap((facetValues: FacetValues) => {
|
tap((facetValues: FacetValues) => {
|
||||||
this.isLastPage$.next(hasNoValue(facetValues?.next));
|
this.isLastPage$.next(hasNoValue(facetValues?.next));
|
||||||
|
const hasLimitFacets = facetValues?.page.length < facetValues?.facetLimit;
|
||||||
|
this.isAvailableForShowSearchText.next(hasLimitFacets && hasNoValue(facetValues?.next));
|
||||||
}),
|
}),
|
||||||
)),
|
)),
|
||||||
map((newFacetValues: FacetValues) => {
|
map((newFacetValues: FacetValues) => {
|
||||||
|
@@ -26,5 +26,6 @@
|
|||||||
(submitSuggestion)="onSubmit($event)"
|
(submitSuggestion)="onSubmit($event)"
|
||||||
(clickSuggestion)="onClick($event)"
|
(clickSuggestion)="onClick($event)"
|
||||||
(findSuggestions)="findSuggestions($event)"
|
(findSuggestions)="findSuggestions($event)"
|
||||||
|
*ngIf="!(isAvailableForShowSearchText | async)"
|
||||||
ngDefaultControl></ds-filter-input-suggestions>
|
ngDefaultControl></ds-filter-input-suggestions>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user