mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 03:53:02 +00:00
search page fix
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
@@ -43,7 +43,8 @@ export class SearchPageComponent implements OnInit {
|
||||
id: 'search-results-pagination',
|
||||
pageSize: 10
|
||||
},
|
||||
query: ''
|
||||
query: '',
|
||||
scope: ''
|
||||
};
|
||||
|
||||
constructor(private service: SearchService,
|
||||
|
@@ -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, {
|
||||
|
@@ -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'
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<form #form="ngForm" (ngSubmit)="onSubmit(form.value)" class="row" action="/search">
|
||||
<div *ngIf="isNotEmpty(scopes)" class="col-12 col-sm-3">
|
||||
<select [(ngModel)]="selectedId" name="scope" class="form-control" aria-label="Search scope" [compareWith]="byId">
|
||||
<select [(ngModel)]="selectedId" name="scope" class="form-control" aria-label="Search scope">
|
||||
<option value>{{'search.form.search_dspace' | translate}}</option>
|
||||
<option *ngFor="let scopeOption of scopes" [value]="scopeOption.id">{{scopeOption?.name ? scopeOption.name : 'search.form.search_dspace' | translate}}</option>
|
||||
</select>
|
||||
|
@@ -50,11 +50,4 @@ export class SearchFormComponent {
|
||||
return isNotEmpty(object);
|
||||
}
|
||||
|
||||
byId(id1: string, id2: string) {
|
||||
if (isEmpty(id1) && isEmpty(id2)) {
|
||||
return true;
|
||||
}
|
||||
return id1 === id2;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user