From fbeaec1a54e31facaffee9cc912fb052efb62099 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 31 Jan 2023 14:21:36 +0100 Subject: [PATCH 1/2] 98891: Make it possible to provide query to SearchComponent --- src/app/shared/search/search.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index c017a5065b..5868cdcf0b 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -134,6 +134,11 @@ export class SearchComponent implements OnInit { */ @Input() viewModeList: ViewMode[]; + /** + * The search query + */ + @Input() query: string; + /** * The current configuration used during the search */ @@ -275,6 +280,9 @@ export class SearchComponent implements OnInit { configuration: searchOptions.configuration || configuration, sort: sortOption || searchOptions.sort }); + if (combinedOptions.query === '') { + combinedOptions.query = this.query; + } const newSearchOptions = new PaginatedSearchOptions(combinedOptions); // check if search options are changed // if so retrieve new related results otherwise skip it From c6ecc0cbd4c3d10523d2c44da6ffd3d1ff207eaa Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 31 Jan 2023 14:40:36 +0100 Subject: [PATCH 2/2] 98891: DsDynamicLookupRelationSearchTabComponent should have the form value already filled in the search input --- .../search-tab/dynamic-lookup-relation-search-tab.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.html index 54ac149d48..4e88b17b64 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.html @@ -8,6 +8,7 @@ [selectable]="true" [selectionConfig]="{ repeatable: repeatable, listId: listId }" [showViewModes]="false" + [query]="query" (resultFound)="onResultFound($event)" (deselectObject)="deselectObject.emit($event)" (selectObject)="selectObject.emit($event)">