Skip to content

Commit fb8733c

Browse files
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
1 parent 404ccd9 commit fb8733c

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ describe('EditRelationshipListComponent', () => {
160160
getFieldUpdates: observableOf({
161161
[relationships[0].uuid]: fieldUpdate1,
162162
[relationships[1].uuid]: fieldUpdate2
163-
})
163+
}),
164+
// eslint-disable-next-line @typescript-eslint/no-empty-function
165+
initialize: () => {
166+
},
164167
}
165168
);
166169

src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,15 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
512512
false,
513513
true,
514514
...linksToFollow
515-
)),
516-
).subscribe((rd: RemoteData<PaginatedList<Relationship>>) => {
517-
this.relationshipsRd$.next(rd);
518-
})
515+
),
516+
),
517+
tap((rd: RemoteData<PaginatedList<Relationship>>) => {
518+
this.relationshipsRd$.next(rd);
519+
}),
520+
getFirstSucceededRemoteDataPayload(),
521+
).subscribe((relationshipPaginatedList: PaginatedList<Relationship>) => {
522+
this.objectUpdatesService.initialize(this.url, relationshipPaginatedList.page, new Date());
523+
}),
519524
);
520525

521526
// keep isLastPage$ up to date based on relationshipsRd$

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h4 class="modal-title" id="modal-title">{{ ('submission.sections.describe.relat
8484
<button class="btn btn-primary submit"
8585
[disabled]="(toAdd.length == 0 && toRemove.length == 0) || isPending"
8686
(click)="submitEv()">
87-
<span *ngIf="isPending" class="spinner-border spinner-border-sm" role="status"
87+
<span *ngIf="isPending" class="spinner-border spinner-border-sm mr-1" role="status"
8888
aria-hidden="true"></span>
8989
<i class="fas fa-save"></i>
9090
<span class="d-none d-sm-inline">&nbsp;{{"item.edit.metadata.save-button" | translate}}</span>

0 commit comments

Comments
 (0)