mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
88300: Issue 1379 - Angular: Browse-by Subject does not allow to proceed to next pages once filtered
This commit is contained in:
@@ -4,10 +4,13 @@ import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
import { fadeIn, fadeInOut } from '../animations/fade';
|
||||
import { Observable } from 'rxjs';
|
||||
import { combineLatest as observableCombineLatest, Observable } from 'rxjs';
|
||||
import { ListableObject } from '../object-collection/shared/listable-object.model';
|
||||
import { getStartsWithComponent, StartsWithType } from '../starts-with/starts-with-decorator';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { RouteService } from '../../core/services/route.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { hasValue } from '../empty.util';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-browse-by',
|
||||
@@ -97,8 +100,14 @@ export class BrowseByComponent implements OnInit {
|
||||
*/
|
||||
public sortDirections = SortDirection;
|
||||
|
||||
/**
|
||||
* Observable that tracks if the back button should be displayed based on the path parameters
|
||||
*/
|
||||
shouldDisplayResetButton$: Observable<boolean>;
|
||||
|
||||
public constructor(private injector: Injector,
|
||||
protected paginationService: PaginationService,
|
||||
private routeService: RouteService
|
||||
) {
|
||||
|
||||
}
|
||||
@@ -148,6 +157,14 @@ export class BrowseByComponent implements OnInit {
|
||||
],
|
||||
parent: this.injector
|
||||
});
|
||||
|
||||
const startsWith$ = this.routeService.getQueryParameterValue('startsWith');
|
||||
const value$ = this.routeService.getQueryParameterValue('value');
|
||||
|
||||
this.shouldDisplayResetButton$ = observableCombineLatest([startsWith$, value$]).pipe(
|
||||
map(([startsWith, value]) => hasValue(startsWith) || hasValue(value))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user