diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 6b66be8eaf..4cd615dcc4 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -248,6 +248,8 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { if (typeof params.startsWith === 'string') { this.startsWith = params.startsWith.trim(); + } else { + this.startsWith = ''; } if (isNotEmpty(this.value)) { diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts index 9a00ea3e40..727b8489af 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts @@ -44,6 +44,12 @@ describe('TabbedRelatedEntitiesSearchComponent', () => { provide: ActivatedRoute, useValue: { queryParams: of({ tab: mockRelationType }), + snapshot: { + queryParams: { + scope: 'collection-uuid', + query: 'test', + }, + }, }, }, { provide: Router, useValue: router }, @@ -89,8 +95,10 @@ describe('TabbedRelatedEntitiesSearchComponent', () => { relativeTo: (comp as any).route, queryParams: { tab: event.nextId, + query: 'test', + scope: 'collection-uuid', + 'spc.page': 1, }, - queryParamsHandling: 'merge', }); }); }); diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts index f0a8228537..8c43f43915 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts @@ -89,8 +89,10 @@ export class TabbedRelatedEntitiesSearchComponent implements OnInit { relativeTo: this.route, queryParams: { tab: event.nextId, + query: this.route.snapshot.queryParams.query, + scope: this.route.snapshot.queryParams.scope, + 'spc.page': 1, }, - queryParamsHandling: 'merge', }); } diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html index 524243f23d..20be3e5562 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html @@ -1,6 +1,6 @@
@if (linkType !== linkTypes.None) { - + {{object.value}} } diff --git a/src/app/shared/starts-with/date/starts-with-date.component.spec.ts b/src/app/shared/starts-with/date/starts-with-date.component.spec.ts index 6a48f0db22..b1db5586e9 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.spec.ts +++ b/src/app/shared/starts-with/date/starts-with-date.component.spec.ts @@ -100,7 +100,7 @@ describe('StartsWithDateComponent', () => { }); it('should add a startsWith query parameter', () => { - expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }); + expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }, undefined, { queryParamsHandling: '' }); }); it('should automatically fill in the input field', () => { @@ -122,7 +122,7 @@ describe('StartsWithDateComponent', () => { }); it('should add a startsWith query parameter', () => { - expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }); + expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }, undefined, { queryParamsHandling: '' }); }); it('should automatically fill in the input field', () => { @@ -146,7 +146,7 @@ describe('StartsWithDateComponent', () => { }); it('should add a startsWith query parameter', () => { - expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }); + expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }, undefined, { queryParamsHandling: '' }); }); it('should automatically fill in the input field', () => { @@ -171,7 +171,7 @@ describe('StartsWithDateComponent', () => { }); it('should add a startsWith query parameter', () => { - expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }); + expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }, undefined, { queryParamsHandling: '' }); }); }); diff --git a/src/app/shared/starts-with/starts-with-abstract.component.ts b/src/app/shared/starts-with/starts-with-abstract.component.ts index e2d5ca3e0f..98147175c0 100644 --- a/src/app/shared/starts-with/starts-with-abstract.component.ts +++ b/src/app/shared/starts-with/starts-with-abstract.component.ts @@ -92,11 +92,10 @@ export abstract class StartsWithAbstractComponent implements OnInit, OnDestroy { this.startsWith = undefined; } if (resetPage) { - this.paginationService.updateRoute(this.paginationId, { page: 1 }, { startsWith: this.startsWith }); + this.paginationService.updateRoute(this.paginationId, { page: 1 }, { startsWith: this.startsWith }, undefined, { queryParamsHandling: '' }); } else { void this.router.navigate([], { queryParams: Object.assign({ startsWith: this.startsWith }), - queryParamsHandling: 'merge', }); } } diff --git a/src/app/shared/starts-with/text/starts-with-text.component.spec.ts b/src/app/shared/starts-with/text/starts-with-text.component.spec.ts index c0c6996d96..a48a121786 100644 --- a/src/app/shared/starts-with/text/starts-with-text.component.spec.ts +++ b/src/app/shared/starts-with/text/starts-with-text.component.spec.ts @@ -74,8 +74,8 @@ describe('StartsWithTextComponent', () => { expect(comp.startsWith).toEqual(expectedValue); }); - it('should add a startsWith query parameter', () => { - expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }); + it('should add a startsWith query parameter and clear all others', () => { + expect(paginationService.updateRoute).toHaveBeenCalledWith('page-id', { page: 1 }, { startsWith: expectedValue }, undefined, { queryParamsHandling: '' }); }); });