diff --git a/src/app/+search-page/search-page.component.ts b/src/app/+search-page/search-page.component.ts index 333faacc47..a51e16151f 100644 --- a/src/app/+search-page/search-page.component.ts +++ b/src/app/+search-page/search-page.component.ts @@ -15,6 +15,8 @@ import { SearchConfigurationService } from './search-service/search-configuratio import { getSucceededRemoteData } from '../core/shared/operators'; import { SEARCH_CONFIG_SERVICE } from '../+my-dspace-page/my-dspace-page.component'; +export const SEARCH_ROUTE = '/search'; + /** * This component renders a simple item page. * The route parameter 'id' is used to request the item it represents. diff --git a/src/app/+search-page/search-service/search.service.ts b/src/app/+search-page/search-service/search.service.ts index 751b46a92d..28b460e770 100644 --- a/src/app/+search-page/search-service/search.service.ts +++ b/src/app/+search-page/search-service/search.service.ts @@ -43,6 +43,8 @@ import { ViewMode } from '../../core/shared/view-mode.model'; import { ResourceType } from '../../core/shared/resource-type'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { RouteService } from '../../shared/services/route.service'; +import { MYDSPACE_ROUTE } from '../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_ROUTE } from '../search-page.component'; /** * Service that performs all general actions that have to do with the search page @@ -356,7 +358,8 @@ export class SearchService implements OnDestroy { getSearchLink(): string { const urlTree = this.router.parseUrl(this.router.url); const g: UrlSegmentGroup = urlTree.root.children[PRIMARY_OUTLET]; - return '/' + g.toString(); + const searchLink: any = '/' + g.toString(); + return (searchLink !== SEARCH_ROUTE || searchLink !== MYDSPACE_ROUTE) ? SEARCH_ROUTE : searchLink; } /**