small fixes for search

This commit is contained in:
lotte
2019-05-16 13:43:07 +02:00
parent 5254308b8b
commit 487ee9f756
5 changed files with 4 additions and 12 deletions

View File

@@ -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);
})
}

View File

@@ -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';
}
/**

View File

@@ -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('/');
}
}

View File

@@ -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.

View File

@@ -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
*/