diff --git a/src/app/+search-page/search-settings/search-settings.component.html b/src/app/+search-page/search-settings/search-settings.component.html index d693196dae..7bdbaa73a8 100644 --- a/src/app/+search-page/search-settings/search-settings.component.html +++ b/src/app/+search-page/search-settings/search-settings.component.html @@ -1,3 +1,4 @@ +

{{ 'search.sidebar.settings.title' | translate}}

diff --git a/src/app/+search-page/search-sidebar/search-sidebar.component.html b/src/app/+search-page/search-sidebar/search-sidebar.component.html index 50877052ec..7a5857fcff 100644 --- a/src/app/+search-page/search-sidebar/search-sidebar.component.html +++ b/src/app/+search-page/search-sidebar/search-sidebar.component.html @@ -10,7 +10,7 @@
diff --git a/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.spec.ts b/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.spec.ts index b3efc240e1..602dee33e6 100644 --- a/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.spec.ts +++ b/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.spec.ts @@ -94,7 +94,7 @@ describe('SearchSwitchConfigurationComponent', () => { }); it('should navigate to the route when selecting an option', () => { - (comp as any).searchService.getSearchLink.and.returnValue(MYDSPACE_ROUTE); + spyOn((comp as any), 'getSearchLinkParts').and.returnValue([MYDSPACE_ROUTE]); comp.selectedOption = MyDSpaceConfigurationValueType.Workflow; const navigationExtras: NavigationExtras = { queryParams: {configuration: MyDSpaceConfigurationValueType.Workflow}, diff --git a/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.ts b/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.ts index c34fe20303..1ce1bf84ec 100644 --- a/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.ts +++ b/src/app/+search-page/search-switch-configuration/search-switch-configuration.component.ts @@ -20,6 +20,10 @@ import { SearchService } from '../search-service/search.service'; */ export class SearchSwitchConfigurationComponent implements OnDestroy, OnInit { + /** + * True when the search component should show results on the current page + */ + @Input() inPlaceSearch; /** * The list of available configuration options */ @@ -56,7 +60,7 @@ export class SearchSwitchConfigurationComponent implements OnDestroy, OnInit { queryParams: {configuration: this.selectedOption}, }; - this.router.navigate([this.searchService.getSearchLink()], navigationExtras); + this.router.navigate(this.getSearchLinkParts(), navigationExtras); } /** @@ -77,4 +81,24 @@ export class SearchSwitchConfigurationComponent implements OnDestroy, OnInit { this.sub.unsubscribe(); } } + + /** + * @returns {string} The base path to the search page, or the current page when inPlaceSearch is true + */ + public getSearchLink(): string { + if (this.inPlaceSearch) { + return './'; + } + return this.searchService.getSearchLink(); + } + + /** + * @returns {string[]} The base path to the search page, or the current page when inPlaceSearch is true, split in separate pieces + */ + public getSearchLinkParts(): string[] { + if (this.searchService) { + return []; + } + return this.getSearchLink().split('/'); + } } diff --git a/src/app/submission/form/collection/submission-form-collection.component.html b/src/app/submission/form/collection/submission-form-collection.component.html index 6547a3cc3c..37ada35155 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.html +++ b/src/app/submission/form/collection/submission-form-collection.component.html @@ -38,7 +38,7 @@ title="{{ listItem.collection.name }}" (click)="onSelect(listItem)">
    -
  • +
  • {{ item.name}}
  • {{ listItem.collection.name}}
  • diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index 2fe424bd3f..b576834091 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -237,7 +237,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { if (isEmpty(searchTerm)) { return listCollection; } else { - return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5) + return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5); } })); }