diff --git a/dmp-frontend/src/app/core/query/description.lookup.ts b/dmp-frontend/src/app/core/query/description.lookup.ts index 305c5fc94..cfdd72cd9 100644 --- a/dmp-frontend/src/app/core/query/description.lookup.ts +++ b/dmp-frontend/src/app/core/query/description.lookup.ts @@ -5,10 +5,7 @@ import { DescriptionStatus } from '../common/enum/description-status'; import { DmpLookup } from './dmp.lookup'; import { DmpUserRole } from '../common/enum/dmp-user-role'; import { DescriptionTag } from '../model/description/description'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { ReferenceType } from '../model/reference-type/reference-type'; -import { Reference } from '../model/reference/reference'; -import { ReferenceTypeLookup } from './reference-type.lookup'; import { DescriptionReferenceLookup, ReferenceLookup } from './reference.lookup'; export class DescriptionLookup extends Lookup implements DescriptionFilter { @@ -56,7 +53,7 @@ export interface DescriptionFilter { export class ReferencesWithType { referenceType: ReferenceType; - references: Reference[]; + references: Guid[]; constructor() { } diff --git a/dmp-frontend/src/app/core/services/reference/reference.service.ts b/dmp-frontend/src/app/core/services/reference/reference.service.ts index 6b5fb3c91..6178eef72 100644 --- a/dmp-frontend/src/app/core/services/reference/reference.service.ts +++ b/dmp-frontend/src/app/core/services/reference/reference.service.ts @@ -150,18 +150,6 @@ export class ReferenceService { }; } - public getInternalMultipleAutoCompleteConfiguration(typeId: Guid, dependencyReferences: Reference[]): MultipleAutoCompleteConfiguration { - return { - initialItems: (excludedItems: any[], data?: any) => this.searchWithDefinition(this.buildAutocompleteSearchLookup(typeId, dependencyReferences, null)).pipe(map(x => x.filter(r => r.sourceType == ReferenceSourceType.Internal))).pipe(map(x => x)), - filterFn: (searchQuery: string, excludedItems: any[]) => this.searchWithDefinition(this.buildAutocompleteSearchLookup(typeId, dependencyReferences, searchQuery)).pipe(map(x => x.filter(r => r.sourceType == ReferenceSourceType.Internal))).pipe(map(x => x)), - displayFn: (item: Reference) => item.label, - titleFn: (item: Reference) => item.label, - subtitleFn: (item: Reference) => item?.sourceType === ReferenceSourceType.External ? this.language.instant('REFERENCE-FIELD-COMPONENT.EXTERNAL-SOURCE') + ': ' + item.source : this.language.instant('REFERENCE-FIELD-COMPONENT.INTERNAL-SOURCE'), - valueAssign: (item: Reference) => item, - uniqueAssign: (item: Reference) => item.source + '_' + item.reference, - }; - } - private buildAutocompleteSearchLookup(typeId: Guid, dependencyReferences: Reference[], like?: string): ReferenceSearchLookup { const lookup: ReferenceSearchLookup = new ReferenceSearchLookup(); lookup.page = { size: 100, offset: 0 }; diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.html b/dmp-frontend/src/app/ui/description/listing/description-listing.component.html index 7aeae1213..d8427e6fc 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.html +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.html @@ -29,7 +29,8 @@ -