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
This commit is contained in:
Alexandre Vryghem
2024-04-02 16:27:54 +02:00
parent 404ccd9b0e
commit fb8733ca0b
3 changed files with 14 additions and 6 deletions

View File

@@ -160,7 +160,10 @@ describe('EditRelationshipListComponent', () => {
getFieldUpdates: observableOf({ getFieldUpdates: observableOf({
[relationships[0].uuid]: fieldUpdate1, [relationships[0].uuid]: fieldUpdate1,
[relationships[1].uuid]: fieldUpdate2 [relationships[1].uuid]: fieldUpdate2
}) }),
// eslint-disable-next-line @typescript-eslint/no-empty-function
initialize: () => {
},
} }
); );

View File

@@ -512,10 +512,15 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
false, false,
true, true,
...linksToFollow ...linksToFollow
)), ),
).subscribe((rd: RemoteData<PaginatedList<Relationship>>) => { ),
this.relationshipsRd$.next(rd); tap((rd: RemoteData<PaginatedList<Relationship>>) => {
}) this.relationshipsRd$.next(rd);
}),
getFirstSucceededRemoteDataPayload(),
).subscribe((relationshipPaginatedList: PaginatedList<Relationship>) => {
this.objectUpdatesService.initialize(this.url, relationshipPaginatedList.page, new Date());
}),
); );
// keep isLastPage$ up to date based on relationshipsRd$ // keep isLastPage$ up to date based on relationshipsRd$

View File

@@ -84,7 +84,7 @@
<button class="btn btn-primary submit" <button class="btn btn-primary submit"
[disabled]="(toAdd.length == 0 && toRemove.length == 0) || isPending" [disabled]="(toAdd.length == 0 && toRemove.length == 0) || isPending"
(click)="submitEv()"> (click)="submitEv()">
<span *ngIf="isPending" class="spinner-border spinner-border-sm" role="status" <span *ngIf="isPending" class="spinner-border spinner-border-sm mr-1" role="status"
aria-hidden="true"></span> aria-hidden="true"></span>
<i class="fas fa-save"></i> <i class="fas fa-save"></i>
<span class="d-none d-sm-inline">&nbsp;{{"item.edit.metadata.save-button" | translate}}</span> <span class="d-none d-sm-inline">&nbsp;{{"item.edit.metadata.save-button" | translate}}</span>