diff --git a/src/app/+search-page/search-filters/search-filter/search-filter.service.ts b/src/app/+search-page/search-filters/search-filter/search-filter.service.ts index 9c5e406a78..1ba8182d33 100644 --- a/src/app/+search-page/search-filters/search-filter/search-filter.service.ts +++ b/src/app/+search-page/search-filters/search-filter/search-filter.service.ts @@ -79,13 +79,13 @@ export class SearchFilterService { this.getCurrentQuery(), this.getCurrentFilters(), (pagination, sort, view, scope, query, filters) => { - return Object.assign(new SearchOptions(), + return Object.assign(new PaginatedSearchOptions(), defaults, { pagination: pagination, sort: sort, view: view, - scope: scope, + scope: scope || defaults.scope, query: query, filters: filters }) diff --git a/src/app/+search-page/search-page.component.ts b/src/app/+search-page/search-page.component.ts index 2a903f884a..c9efc65676 100644 --- a/src/app/+search-page/search-page.component.ts +++ b/src/app/+search-page/search-page.component.ts @@ -43,7 +43,8 @@ export class SearchPageComponent implements OnInit { id: 'search-results-pagination', pageSize: 10 }, - query: '' + query: '', + scope: '' }; constructor(private service: SearchService, diff --git a/src/app/+search-page/search-service/search.service.ts b/src/app/+search-page/search-service/search.service.ts index 134ae657a1..42f527a411 100644 --- a/src/app/+search-page/search-service/search.service.ts +++ b/src/app/+search-page/search-service/search.service.ts @@ -99,7 +99,7 @@ export class SearchService implements OnDestroy { const requestObs = this.halService.getEndpoint(this.searchLinkPath).pipe( map((url: string) => { if (hasValue(searchOptions)) { - url = searchOptions.toRestUrl(url); + url = (searchOptions as PaginatedSearchOptions).toRestUrl(url); } const request = new GetRequest(this.requestService.generateRequestId(), url); return Object.assign(request, { diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts index 2fa70ddd18..6ab0e2a567 100644 --- a/src/app/shared/pagination/pagination.component.ts +++ b/src/app/shared/pagination/pagination.component.ts @@ -336,7 +336,8 @@ export class PaginationComponent implements OnDestroy, OnInit { */ private updateRoute(params: {}) { this.router.navigate([], { - queryParams: Object.assign({}, this.currentQueryParams, params) + queryParams: Object.assign({}, this.currentQueryParams, params), + queryParamsHandling: 'merge' }); } diff --git a/src/app/shared/search-form/search-form.component.html b/src/app/shared/search-form/search-form.component.html index a4e8cddc1e..8bca5aabeb 100644 --- a/src/app/shared/search-form/search-form.component.html +++ b/src/app/shared/search-form/search-form.component.html @@ -1,6 +1,6 @@