mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Removed back() function
This commit is contained in:
@@ -242,16 +242,5 @@ describe('BrowseByComponent', () => {
|
|||||||
expect(button).toBeDefined();
|
expect(button).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('back', () => {
|
|
||||||
it('should navigate back to the main browse page', () => {
|
|
||||||
const id = 'test-pagination';
|
|
||||||
comp.back();
|
|
||||||
expect(paginationService.updateRoute).toHaveBeenCalledWith(id, {page: 1}, {
|
|
||||||
value: null,
|
|
||||||
startsWith: null,
|
|
||||||
[id + '.return']: null
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -184,14 +184,6 @@ export class BrowseByComponent implements OnInit, OnDestroy {
|
|||||||
this.sub = this.routeService.getQueryParameterValue(this.paginationConfig.id + '.return').subscribe(this.previousPage$);
|
this.sub = this.routeService.getQueryParameterValue(this.paginationConfig.id + '.return').subscribe(this.previousPage$);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Navigate back to the previous browse by page
|
|
||||||
*/
|
|
||||||
back() {
|
|
||||||
const page = +this.previousPage$.value > 1 ? +this.previousPage$.value : 1;
|
|
||||||
this.paginationService.updateRoute(this.paginationConfig.id, {page: page}, {[this.paginationConfig.id + '.return']: null, value: null, startsWith: null});
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
if (this.sub) {
|
if (this.sub) {
|
||||||
this.sub.unsubscribe();
|
this.sub.unsubscribe();
|
||||||
|
Reference in New Issue
Block a user