mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
small fixes for search
This commit is contained in:
@@ -90,14 +90,14 @@ export class CollectionPageComponent implements OnInit {
|
||||
dsoType: DSpaceObjectType.ITEM
|
||||
})).pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>
|
||||
}),
|
||||
startWith(undefined) // Make sure switching page shows loading component
|
||||
startWith(undefined) // Make sure switching pages shows loading component
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
this.route.queryParams.pipe(take(1)).subscribe((params) => {
|
||||
this.metadata.processRemoteData(this.collectionRD$);
|
||||
this.onPaginationChange(params)
|
||||
this.onPaginationChange(params);
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -354,10 +354,7 @@ export class SearchService implements OnDestroy {
|
||||
* @returns {string} The base path to the search page
|
||||
*/
|
||||
getSearchLink(): string {
|
||||
const urlTree = this.router.parseUrl(this.router.url);
|
||||
const g: UrlSegmentGroup = urlTree.root.children[PRIMARY_OUTLET];
|
||||
const searchLink: any = '/' + g.toString();
|
||||
return (searchLink !== '/search' && searchLink !== '/mydspace') ? '/search' : searchLink;
|
||||
return '/search';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -79,7 +79,6 @@ export class SearchSettingsComponent implements OnInit {
|
||||
this.router.navigate(this.getSearchLinkParts(), navigationExtras);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @returns {string} The base path to the search page, or the current page when inPlaceSearch is true
|
||||
*/
|
||||
@@ -99,5 +98,4 @@ export class SearchSettingsComponent implements OnInit {
|
||||
}
|
||||
return this.getSearchLink().split('/');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -218,8 +218,7 @@ export class RemoteDataBuildService {
|
||||
.map((d: RemoteData<T>) => d.isResponsePending)
|
||||
.find((b: boolean) => b === true);
|
||||
|
||||
|
||||
let isSuccessful: boolean = undefined;
|
||||
let isSuccessful: boolean;
|
||||
// isSuccessful should be undefined until all responses have come in.
|
||||
// We can't know its state beforehand. We also can't say it's false
|
||||
// because that would imply a request failed.
|
||||
|
@@ -69,7 +69,6 @@ export class SearchFormComponent {
|
||||
* @param data Updated parameters
|
||||
*/
|
||||
updateSearch(data: any) {
|
||||
|
||||
this.router.navigate(this.getSearchLinkParts(), {
|
||||
queryParams: Object.assign({}, { page: 1 }, data),
|
||||
queryParamsHandling: 'merge'
|
||||
@@ -83,7 +82,6 @@ export class SearchFormComponent {
|
||||
return isNotEmpty(object);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @returns {string} The base path to the search page, or the current page when inPlaceSearch is true
|
||||
*/
|
||||
|
Reference in New Issue
Block a user