From 551ed18fe580cfbf855d9ea760369fccca3b26f0 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe <kristof.delanghe@atmire.com> Date: Tue, 29 Jan 2019 16:18:46 +0100 Subject: [PATCH] 59415: Allow scope in browse-by-value --- src/app/core/browse/browse.service.ts | 4 ++++ .../browse-entry-list-element.component.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index 9293343c24..8e2c288ae8 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -149,6 +149,7 @@ export class BrowseService { getBrowseItemsFor(definitionID: string, filterValue: string, options: { pagination?: PaginationComponentOptions; sort?: SortOptions; + scope?: string; } = {}): Observable<RemoteData<PaginatedList<Item>>> { const request$ = this.getBrowseDefinitions().pipe( getBrowseDefinitionLinks(definitionID), @@ -157,6 +158,9 @@ export class BrowseService { hasValueOperator(), map((href: string) => { const args = []; + if (isNotEmpty(options.sort)) { + args.push(`scope=${options.scope}`); + } if (isNotEmpty(options.sort)) { args.push(`sort=${options.sort.field},${options.sort.direction}`); } 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 198e79b453..6139e4a9df 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,5 +1,5 @@ <div class="d-flex flex-row"> - <a [routerLink]="" [queryParams]="{value: object.value}" class="lead"> + <a [routerLink]="" [queryParams]="{value: object.value}" [queryParamsHandling]="'merge'" class="lead"> {{object.value}} </a> <span class="pr-2"> </span> -- GitLab