Skip to content

Commit

Permalink
113901: Store the retrieved Relationships in the store
Browse files Browse the repository at this point in the history
This needs to be done here too, since tilted relationships won't be returned by the api/core/items/{uuid}/relationships endpoint
  • Loading branch information
alexandrevryghem committed Apr 2, 2024
1 parent 404ccd9 commit fb8733c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
},
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,15 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
false,
true,
...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$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h4 class="modal-title" id="modal-title">{{ ('submission.sections.describe.relat
<button class="btn btn-primary submit"
[disabled]="(toAdd.length == 0 && toRemove.length == 0) || isPending"
(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>
<i class="fas fa-save"></i>
<span class="d-none d-sm-inline">&nbsp;{{"item.edit.metadata.save-button" | translate}}</span>
Expand Down

0 comments on commit fb8733c

Please sign in to comment.