[Port dspace-7_x] site search should not adopt existing URL query string parameters (#2824)

Do not merge existing query params when using site search from MyDSpace workflow.
This commit is contained in:
DSpace Bot
2024-02-22 02:50:03 -06:00
committed by GitHub
parent 41faa5ee52
commit 0f09920cb1
2 changed files with 3 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
})); }));
it('to search page with empty query', () => { it('to search page with empty query', () => {
const extras: NavigationExtras = { queryParams: { query: '' }, queryParamsHandling: 'merge' }; const extras: NavigationExtras = { queryParams: { query: '' } };
expect(component.onSubmit).toHaveBeenCalledWith({ query: '' }); expect(component.onSubmit).toHaveBeenCalledWith({ query: '' });
expect(router.navigate).toHaveBeenCalledWith(['search'], extras); expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
}); });
@@ -113,7 +113,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
})); }));
it('to search page with query', async () => { it('to search page with query', async () => {
const extras: NavigationExtras = { queryParams: { query: 'test' }, queryParamsHandling: 'merge' }; const extras: NavigationExtras = { queryParams: { query: 'test' } };
expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' }); expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' });
expect(router.navigate).toHaveBeenCalledWith(['search'], extras); expect(router.navigate).toHaveBeenCalledWith(['search'], extras);

View File

@@ -66,8 +66,7 @@ export class SearchNavbarComponent {
this.searchForm.reset(); this.searchForm.reset();
this.router.navigate(linkToNavigateTo, { this.router.navigate(linkToNavigateTo, {
queryParams: queryParams, queryParams: queryParams
queryParamsHandling: 'merge'
}); });
} }
} }