Merge remote-tracking branch 'atmire/w2p-98891_pass-default-query-to-search_contribute-7.2' into atmire-contributions-alex-7.5

# Conflicts:
#	src/app/shared/search/search.component.ts
This commit is contained in:
Alexandre Vryghem
2023-02-08 20:58:40 +01:00
3 changed files with 12 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
[selectionConfig]="{ repeatable: repeatable, listId: listId }"
[showScopeSelector]="false"
[showViewModes]="false"
[query]="query"
(resultFound)="onResultFound($event)"
(deselectObject)="deselectObject.emit($event)"
(selectObject)="selectObject.emit($event)">

View File

@@ -147,6 +147,11 @@ export class SearchComponent implements OnInit {
*/
@Input() trackStatistics = false;
/**
* The search query
*/
@Input() query: string;
/**
* The current configuration used during the search
*/
@@ -303,6 +308,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

View File

@@ -19,7 +19,7 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode
templateUrl: '../theme-support/themed.component.html',
})
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics'];
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query'];
@Input() configurationList: SearchConfigurationOption[] = [];
@@ -59,6 +59,8 @@ export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
@Input() trackStatistics = false;
@Input() query: string;
@Output() resultFound: EventEmitter<SearchObjects<DSpaceObject>> = new EventEmitter<SearchObjects<DSpaceObject>>();
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();