mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
Merge pull request #2376 from alexandrevryghem/w2p-104312_pass-query-to-external-search-tabs_contribute-main
Search query is not set by default when opening an external sources tab
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
[collection]="collection"
|
[collection]="collection"
|
||||||
[relationship]="relationshipOptions"
|
[relationship]="relationshipOptions"
|
||||||
[context]="context"
|
[context]="context"
|
||||||
|
[query]="query"
|
||||||
[externalSource]="source"
|
[externalSource]="source"
|
||||||
(importedObject)="imported($event)"
|
(importedObject)="imported($event)"
|
||||||
class="d-block pt-3">
|
class="d-block pt-3">
|
||||||
|
@@ -75,6 +75,12 @@ export class DsDynamicLookupRelationExternalSourceTabComponent implements OnInit
|
|||||||
* The context to displaying lists for
|
* The context to displaying lists for
|
||||||
*/
|
*/
|
||||||
@Input() context: Context;
|
@Input() context: Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The search query
|
||||||
|
*/
|
||||||
|
@Input() query: string;
|
||||||
|
|
||||||
@Input() repeatable: boolean;
|
@Input() repeatable: boolean;
|
||||||
/**
|
/**
|
||||||
* Emit an event when an object has been imported (or selected from similar local entries)
|
* Emit an event when an object has been imported (or selected from similar local entries)
|
||||||
@@ -149,8 +155,12 @@ export class DsDynamicLookupRelationExternalSourceTabComponent implements OnInit
|
|||||||
|
|
||||||
this.resetRoute();
|
this.resetRoute();
|
||||||
this.entriesRD$ = this.searchConfigService.paginatedSearchOptions.pipe(
|
this.entriesRD$ = this.searchConfigService.paginatedSearchOptions.pipe(
|
||||||
switchMap((searchOptions: PaginatedSearchOptions) =>
|
switchMap((searchOptions: PaginatedSearchOptions) => {
|
||||||
this.externalSourceService.getExternalSourceEntries(this.externalSource.id, searchOptions).pipe(startWith(undefined)))
|
if (searchOptions.query === '') {
|
||||||
|
searchOptions.query = this.query;
|
||||||
|
}
|
||||||
|
return this.externalSourceService.getExternalSourceEntries(this.externalSource.id, searchOptions).pipe(startWith(undefined));
|
||||||
|
})
|
||||||
);
|
);
|
||||||
this.currentPagination$ = this.paginationService.getCurrentPagination(this.searchConfigService.paginationID, this.initialPagination);
|
this.currentPagination$ = this.paginationService.getCurrentPagination(this.searchConfigService.paginationID, this.initialPagination);
|
||||||
this.importConfig = {
|
this.importConfig = {
|
||||||
|
@@ -15,7 +15,7 @@ import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-loo
|
|||||||
})
|
})
|
||||||
export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent<DsDynamicLookupRelationExternalSourceTabComponent> {
|
export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent<DsDynamicLookupRelationExternalSourceTabComponent> {
|
||||||
protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId',
|
protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId',
|
||||||
'item', 'collection', 'relationship', 'context', 'repeatable', 'importedObject', 'externalSource'];
|
'item', 'collection', 'relationship', 'context', 'query', 'repeatable', 'importedObject', 'externalSource'];
|
||||||
|
|
||||||
@Input() label: string;
|
@Input() label: string;
|
||||||
|
|
||||||
@@ -29,6 +29,8 @@ export class ThemedDynamicLookupRelationExternalSourceTabComponent extends Theme
|
|||||||
|
|
||||||
@Input() context: Context;
|
@Input() context: Context;
|
||||||
|
|
||||||
|
@Input() query: string;
|
||||||
|
|
||||||
@Input() repeatable: boolean;
|
@Input() repeatable: boolean;
|
||||||
|
|
||||||
@Output() importedObject: EventEmitter<ListableObject> = new EventEmitter();
|
@Output() importedObject: EventEmitter<ListableObject> = new EventEmitter();
|
||||||
|
Reference in New Issue
Block a user