From 05261a91eae39f25663757ddafd800f3d6963beb Mon Sep 17 00:00:00 2001 From: Rezart Vata Date: Thu, 14 Oct 2021 13:06:55 +0200 Subject: [PATCH] [CST-4504] Fixed multiple delete & multiple add in modal and changed unit testing --- .../object-updates/object-updates.service.ts | 1 - src/app/core/data/relationship.service.ts | 8 + .../edit-relationship-list.component.html | 2 +- .../edit-relationship-list.component.spec.ts | 19 ++ .../edit-relationship-list.component.ts | 175 ++++++++---------- .../edit-relationship.component.ts | 2 +- .../item-relationships.component.html | 3 - .../item-relationships.component.ts | 15 +- ...namic-lookup-relation-modal.component.html | 32 ++-- ...namic-lookup-relation-modal.component.scss | 4 + ...ic-lookup-relation-modal.component.spec.ts | 38 ++-- ...dynamic-lookup-relation-modal.component.ts | 42 +---- ...ic-lookup-relation-search-tab.component.ts | 15 +- 13 files changed, 160 insertions(+), 196 deletions(-) diff --git a/src/app/core/data/object-updates/object-updates.service.ts b/src/app/core/data/object-updates/object-updates.service.ts index 8574e38771..16ff5debf6 100644 --- a/src/app/core/data/object-updates/object-updates.service.ts +++ b/src/app/core/data/object-updates/object-updates.service.ts @@ -141,7 +141,6 @@ export class ObjectUpdatesService { map((objectEntry) => { const fieldUpdates: FieldUpdates = {}; for (const object of initialFields) { - console.log(object.uuid,objectEntry.fieldUpdates); let fieldUpdate = objectEntry.fieldUpdates[object.uuid]; if (isEmpty(fieldUpdate)) { fieldUpdate = { field: object, changeType: undefined }; diff --git a/src/app/core/data/relationship.service.ts b/src/app/core/data/relationship.service.ts index 885c97ee00..f9951845ee 100644 --- a/src/app/core/data/relationship.service.ts +++ b/src/app/core/data/relationship.service.ts @@ -497,6 +497,14 @@ export class RelationshipService extends DataService { fieldName: 'size', fieldValue: arrayOfItemIds.length }, + { + fieldName: 'embed', + fieldValue: 'leftItem' + }, + { + fieldName: 'embed', + fieldValue: 'rightItem' + }, ]; arrayOfItemIds.forEach( (itemId) => { diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.html b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.html index 2185108c8f..86ab93662e 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.html +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.html @@ -1,6 +1,6 @@
{{getRelationshipMessageKey() | async | translate}} - diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts index f8dfd39900..5b269cbce5 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts @@ -59,6 +59,7 @@ describe('EditRelationshipListComponent', () => { comp.itemType = entityType; comp.url = url; comp.relationshipType = relationshipType; + comp.hasChanges = observableOf(false); fixture.detectChanges(); }; @@ -278,6 +279,24 @@ describe('EditRelationshipListComponent', () => { expect(label).toEqual('isAuthorOfPublication'); }); }); + + + + describe('changes managment for add buttons', () => { + + it('should show enabled add buttons', () => { + const element = de.query(By.css('.btn-success')); + expect(element.nativeElement?.disabled).toBeFalse(); + }); + + it('after hash changes changed', () => { + comp.hasChanges = observableOf(true); + fixture.detectChanges(); + const element = de.query(By.css('.btn-success')); + expect(element.nativeElement?.disabled).toBeTrue(); + }); + }); + }); }); diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index 2870c56024..0af512ae33 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -81,32 +81,16 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { */ @Input() relationshipType: RelationshipType; - /** * If updated information has changed */ @Input() hasChanges!: Observable; - /** - * If changes have been discarded and need reinstated - */ - @Input() isReinstatable!: Observable; - /** * The event emmiter to submit the new information */ @Output() submit: EventEmitter = new EventEmitter(); - /** - * The event emmiter to reinstate the discarded information - */ - @Output() reinstate: EventEmitter = new EventEmitter(); - - /** - * The event emmiter to discard the new information - */ - @Output() discard: EventEmitter = new EventEmitter(); - /** * Observable that emits the left and right item type of {@link relationshipType} simultaneously. @@ -168,7 +152,6 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { modalRef: NgbModalRef; - constructor( protected objectUpdatesService: ObjectUpdatesService, protected linkService: LinkService, @@ -244,92 +227,63 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { modalComp.item = this.item; modalComp.relationshipType = this.relationshipType; modalComp.currentItemIsLeftItem$ = this.currentItemIsLeftItem$; - modalComp.hasChanges = this.hasChanges; - modalComp.isReinstatable = this.isReinstatable; - modalComp.submit = this.submit; - modalComp.reinstate = this.reinstate; - modalComp.discard = this.discard; modalComp.toAdd = []; modalComp.toRemove = []; + modalComp.isPending = false; this.item.owningCollection.pipe( getFirstSucceededRemoteDataPayload() ).subscribe((collection: Collection) => { modalComp.collection = collection; }); + modalComp.select = (...selectableObjects: SearchResult[]) => { selectableObjects.forEach((searchResult) => { const relatedItem: Item = searchResult.indexableObject; - - let foundIndex = modalComp.toRemove.findIndex( el => el.uuid == relatedItem.uuid); - console.log("select",foundIndex); - if(foundIndex !== -1) { + const foundIndex = modalComp.toRemove.findIndex( el => el.uuid === relatedItem.uuid); + + if (foundIndex !== -1) { modalComp.toRemove.splice(foundIndex,1); } else { - this.getIsRelatedItem(relatedItem) - .subscribe((isRelated: boolean) => { + this.getIsRelatedItem(relatedItem) + .subscribe((isRelated: boolean) => { + if (!isRelated) { + modalComp.toAdd.push(relatedItem); + } - if (!isRelated) { - - - modalComp.toAdd.push(relatedItem); - - // this.relationshipService.getNameVariant(this.listId, relatedItem.uuid) - // .subscribe((nameVariant) => { - // const update = { - // uuid: this.relationshipType.id + '-' + relatedItem.uuid, - // nameVariant, - // type: this.relationshipType, - // relatedItem, - // } as RelationshipIdentifiable; - // this.objectUpdatesService.saveAddFieldUpdate(this.url, update); - // }); - } - - this.loading$.next(true); - // emit the last page again to trigger a fieldupdates refresh - this.relationshipsRd$.next(this.relationshipsRd$.getValue()); - }); - - } + this.loading$.next(true); + // emit the last page again to trigger a fieldupdates refresh + this.relationshipsRd$.next(this.relationshipsRd$.getValue()); + }); + } }); }; modalComp.deselect = (...selectableObjects: SearchResult[]) => { selectableObjects.forEach((searchResult) => { const relatedItem: Item = searchResult.indexableObject; - let foundIndex = modalComp.toAdd.findIndex( el => el.uuid == relatedItem.uuid); - console.log("deselect",foundIndex); + const foundIndex = modalComp.toAdd.findIndex( el => el.uuid === relatedItem.uuid); - if(foundIndex !== -1) { + if (foundIndex !== -1) { modalComp.toAdd.splice(foundIndex,1); } else { modalComp.toRemove.push(relatedItem); } - - - // this.objectUpdatesService.removeSingleFieldUpdate(this.url, this.relationshipType.id + '-' + relatedItem.uuid); - // this.getFieldUpdatesForRelatedItem(relatedItem) - // .subscribe((identifiables) => - // identifiables.forEach((identifiable) => - // this.objectUpdatesService.saveRemoveFieldUpdate(this.url, identifiable) - // ) - // ); }); - - // this.loading$.next(true); - // emit the last page again to trigger a fieldupdates refresh - // this.relationshipsRd$.next(this.relationshipsRd$.getValue()); }; - // TODO: JOIN SUBSCRIPTION BEFORE SUBMIT + + modalComp.submitEv = () => { - modalComp.toAdd.forEach((relatedItem)=>{ - this.relationshipService.getNameVariant(this.listId, relatedItem.uuid) - .subscribe((nameVariant) => { + + const subscriptions = []; + + modalComp.toAdd.forEach((relatedItem) => { + subscriptions.push(this.relationshipService.getNameVariant(this.listId, relatedItem.uuid).pipe( + map((nameVariant) => { const update = { uuid: this.relationshipType.id + '-' + relatedItem.uuid, nameVariant, @@ -337,37 +291,46 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { relatedItem, } as RelationshipIdentifiable; this.objectUpdatesService.saveAddFieldUpdate(this.url, update); - }); + return update; + }) + )); }); - modalComp.toRemove.forEach((relatedItem)=>{ - this.relationshipService.getNameVariant(this.listId, relatedItem.uuid) - .subscribe((nameVariant) => { - const update = { - uuid: this.relationshipType.id + '-' + relatedItem.uuid, - nameVariant, - type: this.relationshipType, - relatedItem, - } as RelationshipIdentifiable; - this.objectUpdatesService.saveRemoveFieldUpdate(this.url,update); + modalComp.toRemove.forEach( (relatedItem) => { + subscriptions.push(this.relationshipService.getNameVariant(this.listId, relatedItem.uuid).pipe( + switchMap((nameVariant) => { + return this.getRelationFromId(relatedItem).pipe( + map( (relationship: Relationship) => { + const update = { + uuid: relationship.id, + nameVariant, + type: this.relationshipType, + relationship, + } as RelationshipIdentifiable; + this.objectUpdatesService.saveRemoveFieldUpdate(this.url,update); + return update; + }) + ); + }) + )); - }); - - // this.objectUpdatesService.removeSingleFieldUpdate(this.url, this.relationshipType.id + '-' + relatedItem.uuid); - // this.getFieldUpdatesForRelatedItem(relatedItem) - // .subscribe((identifiables) => - // identifiables.forEach((identifiable) => - // this.objectUpdatesService.saveRemoveFieldUpdate(this.url, identifiable) - // ) - // ); }); - setTimeout(()=>{ - this.submit.emit(); - this.modalRef.close(); - },3000); + observableCombineLatest(subscriptions).subscribe( (res) => { + // Wait until the states changes since there are multiple items + setTimeout( () => { + this.submit.emit(); + },1000); - } + modalComp.isPending = true; + }); + }; + + + modalComp.discardEv = () => { + modalComp.toAdd = []; + modalComp.toRemove = []; + }; this.relatedEntityType$ .pipe(take(1)) @@ -385,6 +348,26 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { this.selectableListService.deselectAll(this.listId); } + getRelationFromId(relatedItem) { + return this.currentItemIsLeftItem$.pipe( + take(1), + switchMap( isLeft => { + let apiCall; + if (isLeft) { + apiCall = this.relationshipService.searchByItemsAndType( this.relationshipType.id, this.item.uuid, this.relationshipType.leftwardType ,[relatedItem.id] ); + } else { + apiCall = this.relationshipService.searchByItemsAndType( this.relationshipType.id, this.item.uuid, this.relationshipType.rightwardType ,[relatedItem.id] ); + } + + return apiCall.pipe( + map( (res: PaginatedList) => res.page[0]) + ); + } + )); + } + + + /** * Get the existing field updates regarding a relationship with a given item * @param relatedItem The item for which to get the existing field updates diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts index 3a3a8f9675..f13b0a15e5 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts @@ -79,7 +79,7 @@ export class EditRelationshipComponent implements OnChanges { * Sets the current relationship based on the fieldUpdate input field */ ngOnChanges(): void { - if (this.relationship) { + if (this.relationship && (!!this.relationship.leftItem || !!this.relationship.rightItem)) { this.leftItem$ = this.relationship.leftItem.pipe( getFirstSucceededRemoteData(), getRemoteDataPayload(), diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.html b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.html index 517e0b6c77..4a53445a6d 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.html +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.html @@ -28,9 +28,6 @@ [itemType]="entityType$ | async" [relationshipType]="relationshipType" [hasChanges] = hasChanges() - [isReinstatable] = isReinstatable() - (discard) = discard() - (reinstate) = reinstate() (submit) = submit() > diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts index 629e250acc..9542bf346f 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts @@ -34,6 +34,7 @@ import { NoContent } from '../../../core/shared/NoContent.model'; import { hasValue } from '../../../shared/empty.util'; import { RelationshipTypeService } from '../../../core/data/relationship-type.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'ds-item-relationships', @@ -69,6 +70,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { public entityTypeService: EntityTypeService, protected relationshipTypeService: RelationshipTypeService, public cdr: ChangeDetectorRef, + protected modalService: NgbModal, ) { super(itemService, objectUpdatesService, router, notificationsService, translateService, route); } @@ -108,10 +110,6 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { */ public submit(): void { - this.relationshipService.getItemRelationshipsArray(this.item).pipe( - take(1) - ).subscribe(res=>console.log(res)); - // Get all the relationships that should be removed const removedRelationshipIDs$: Observable = this.relationshipService.getItemRelationshipsArray(this.item).pipe( startWith([]), @@ -119,13 +117,12 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { Object.assign(new Relationship(), relationship, { uuid: relationship.id }) )), switchMap((relationships: Relationship[]) => { - return this.objectUpdatesService.getFieldUpdatesAll(this.url, relationships) as Observable; + return this.objectUpdatesService.getFieldUpdates(this.url, relationships) as Observable; }), - map((fieldUpdates: FieldUpdates) =>{ - console.log(fieldUpdates); + map((fieldUpdates: FieldUpdates) => { return Object.values(fieldUpdates) .filter((fieldUpdate: FieldUpdate) => fieldUpdate.changeType === FieldChangeType.REMOVE) - .map((fieldUpdate: FieldUpdate) => fieldUpdate.field as DeleteRelationship) + .map((fieldUpdate: FieldUpdate) => fieldUpdate.field as DeleteRelationship); } ), ); @@ -155,6 +152,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { this.initializeOriginalFields(); this.cdr.detectChanges(); this.displayNotifications(response); + this.modalService.dismissAll(); } }) ); @@ -162,7 +160,6 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { } deleteRelationships(deleteRelationshipIDs: DeleteRelationship[]): Observable[]> { - console.log(deleteRelationshipIDs); return observableZip(...deleteRelationshipIDs.map((deleteRelationship) => { let copyVirtualMetadata: string; if (deleteRelationship.keepLeftVirtualMetadata && deleteRelationship.keepRightVirtualMetadata) { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html index 0023ce86ef..42dd3eca49 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html @@ -1,7 +1,7 @@ @@ -64,25 +64,27 @@ {{ ('submission.sections.describe.relationship-lookup.selected' | translate: {size: (selection$ | async)?.length || 0}) }}
- +
- - -
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.scss b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.scss index 98edb47729..f611746832 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.scss +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.scss @@ -8,6 +8,10 @@ width: 90%; margin: 5%; } + + .spinner-border{ + vertical-align: middle; + } } .buttons-container{ diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts index aa37f63c3d..b70bd9b1f3 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts @@ -147,11 +147,8 @@ describe('DsDynamicLookupRelationModalComponent', () => { component.submissionId = submissionId; component.isEditRelationship = true; component.currentItemIsLeftItem$ = observableOf(true); - component.hasChanges = observableOf(false); - component.isReinstatable = observableOf(false); - component.submit = new EventEmitter(); - component.reinstate = new EventEmitter(); - component.discard = new EventEmitter(); + component.toAdd = []; + component.toRemove = []; fixture.detectChanges(); }); @@ -213,14 +210,12 @@ describe('DsDynamicLookupRelationModalComponent', () => { it('discard button should be disabled', () => { expect(debugElement.query(By.css('.discard')).nativeElement?.disabled).toBeTrue(); }); - it('should not show reinstate button', () => { - expect(debugElement.query(By.css('.reinstate'))).toBeNull(); - }); }); describe('when changes happen', () => { beforeEach(() => { - component.hasChanges = observableOf(true); + component.toAdd.push(searchResult1); + component.toRemove.push(searchResult2); fixture.detectChanges(); }); it('submit button should be enabled', () => { @@ -241,25 +236,18 @@ describe('DsDynamicLookupRelationModalComponent', () => { }); }); - describe('when changes happen & isReinstatable', () => { + + describe('when request starts and isPending changes', () => { + beforeEach(() => { - component.hasChanges = observableOf(true); - component.isReinstatable = observableOf(true); + component.isPending = true; fixture.detectChanges(); }); - it('should show reinstate button', () => { - expect(debugElement.query(By.css('.reinstate'))).toBeTruthy(); - }); - it('should not show discard button', () => { - expect(debugElement.query(By.css('.discard'))).toBeNull(); - }); - it('reinstate button should be enabled', () => { - expect(debugElement.query(By.css('.reinstate')).nativeElement.disabled).toBeFalse(); - }); - it('should call reinstateEv when reinstate clicked', () => { - const reinstateFunct = spyOn((component as any), 'reinstateEv'); - debugElement.query(By.css('.reinstate')).nativeElement.click(); - expect(reinstateFunct).toHaveBeenCalled(); + + it('there should show 3 spinner for the 3 buttons', () => { + expect(debugElement.queryAll(By.css('.spinner-border')).length).toEqual(3); }); + }); + }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index decfdc1314..febce3c799 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -136,35 +136,11 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy */ isEditRelationship = false; - - /** - * Observable to check if any change has been made - */ - hasChanges: Observable; - - /** - * Observable to check if any discard has been made - */ - isReinstatable: Observable; - - /** - * Submit event emiter to emit to parent - */ - submit: EventEmitter; - - /** - * Reinstate event emiter to emit to parent - */ - reinstate: EventEmitter; - - /** - * Discard event emiter to emit to parent - */ - discard: EventEmitter; - toAdd = []; toRemove = []; + isPending = false; + constructor( public modal: NgbActiveModal, private selectableListService: SelectableListService, @@ -213,6 +189,8 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy } close() { + this.toAdd = []; + this.toRemove = []; this.modal.close(); } @@ -305,26 +283,18 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy Object.values(this.subMap).forEach((subscription) => subscription.unsubscribe()); } + /* tslint:disable:no-empty */ /** * Called when discard button is clicked, emit discard event to parent to conclude functionality */ discardEv(): void { - this.discard.emit(); } /** * Called when submit button is clicked, emit submit event to parent to conclude functionality */ submitEv(): void { - console.log(this.toAdd, this.toRemove); - // this.submit.emit(); - } - - /** - * Called when reinstate button is clicked, emit reinstate event to parent to conclude functionality - */ - reinstateEv(): void { - this.reinstate.emit(); } + /* tslint:enable:no-empty */ } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index 406a5ac7b1..7d00d6ac49 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -26,6 +26,12 @@ import { RelationshipType } from '../../../../../../core/shared/item-relationshi import { Relationship } from '../../../../../../core/shared/item-relationships/relationship.model'; import { result } from 'lodash'; +import { + FieldUpdate, + FieldUpdates, + RelationshipIdentifiable +} from '../../../../../../core/data/object-updates/object-updates.reducer'; + @Component({ selector: 'ds-dynamic-lookup-relation-search-tab', @@ -263,15 +269,6 @@ export class DsDynamicLookupRelationSearchTabComponent implements OnInit, OnDest const uuid = arrUrl[ arrUrl.length - 1 ]; return this.getRelatedItem(uuid,resultListOfItems); - - // return { - // uuid: relationship.id, - // type: this.relationshipType, - // relationship, - // nameVariant, - // } as RelationshipIdentifiable; - - }); if ( selectableObject.length > 0 ) {