From 0f09920cb19e701906dfc0bdba23d5f468dfd1b9 Mon Sep 17 00:00:00 2001 From: DSpace Bot <68393067+dspace-bot@users.noreply.github.com> Date: Thu, 22 Feb 2024 02:50:03 -0600 Subject: [PATCH] [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. --- src/app/search-navbar/search-navbar.component.spec.ts | 4 ++-- src/app/search-navbar/search-navbar.component.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/search-navbar/search-navbar.component.spec.ts b/src/app/search-navbar/search-navbar.component.spec.ts index 7edae293e12..ece2391dcb0 100644 --- a/src/app/search-navbar/search-navbar.component.spec.ts +++ b/src/app/search-navbar/search-navbar.component.spec.ts @@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => { fixture.detectChanges(); })); 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(router.navigate).toHaveBeenCalledWith(['search'], extras); }); @@ -113,7 +113,7 @@ describe('SearchNavbarComponent', () => { fixture.detectChanges(); })); 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(router.navigate).toHaveBeenCalledWith(['search'], extras); diff --git a/src/app/search-navbar/search-navbar.component.ts b/src/app/search-navbar/search-navbar.component.ts index 98e64f6e10f..7f8f951073f 100644 --- a/src/app/search-navbar/search-navbar.component.ts +++ b/src/app/search-navbar/search-navbar.component.ts @@ -66,8 +66,7 @@ export class SearchNavbarComponent { this.searchForm.reset(); this.router.navigate(linkToNavigateTo, { - queryParams: queryParams, - queryParamsHandling: 'merge' + queryParams: queryParams }); } }