From fb8733ca0bbf7d937a66c780803e5b61f7efdbc1 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 2 Apr 2024 16:27:54 +0200 Subject: [PATCH 1/2] 113901: Store the retrieved Relationships in the store This needs to be done here too, since tilted relationships won't be returned by the api/core/items/{uuid}/relationships endpoint --- .../edit-relationship-list.component.spec.ts | 5 ++++- .../edit-relationship-list.component.ts | 13 +++++++++---- .../dynamic-lookup-relation-modal.component.html | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) 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 4cd663f0fbc..a6045808b55 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 @@ -160,7 +160,10 @@ describe('EditRelationshipListComponent', () => { getFieldUpdates: observableOf({ [relationships[0].uuid]: fieldUpdate1, [relationships[1].uuid]: fieldUpdate2 - }) + }), + // eslint-disable-next-line @typescript-eslint/no-empty-function + initialize: () => { + }, } ); 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 b8542f5806f..f97d285e077 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 @@ -512,10 +512,15 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { false, true, ...linksToFollow - )), - ).subscribe((rd: RemoteData>) => { - this.relationshipsRd$.next(rd); - }) + ), + ), + tap((rd: RemoteData>) => { + this.relationshipsRd$.next(rd); + }), + getFirstSucceededRemoteDataPayload(), + ).subscribe((relationshipPaginatedList: PaginatedList) => { + this.objectUpdatesService.initialize(this.url, relationshipPaginatedList.page, new Date()); + }), ); // keep isLastPage$ up to date based on relationshipsRd$ 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 b72a8722aec..d9eaae0ec71 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 @@ -84,7 +84,7 @@