mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
63184: Relationship list refreshing fix - Re-initializing itemUpdateSubscription
This commit is contained in:
@@ -66,8 +66,13 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent impl
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.relationLabels$ = this.relationshipService.getItemRelationshipLabels(this.item);
|
this.relationLabels$ = this.relationshipService.getItemRelationshipLabels(this.item);
|
||||||
|
this.initializeItemUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
// Update the item (and view) when it's removed in the request cache
|
/**
|
||||||
|
* Update the item (and view) when it's removed in the request cache
|
||||||
|
*/
|
||||||
|
public initializeItemUpdate(): void {
|
||||||
this.itemUpdateSubscription = this.requestService.hasByHrefObservable(this.item.self).pipe(
|
this.itemUpdateSubscription = this.requestService.hasByHrefObservable(this.item.self).pipe(
|
||||||
filter((exists: boolean) => !exists),
|
filter((exists: boolean) => !exists),
|
||||||
switchMap(() => this.itemService.findById(this.item.uuid)),
|
switchMap(() => this.itemService.findById(this.item.uuid)),
|
||||||
@@ -144,11 +149,12 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the state of editing relationships
|
* Re-initialize fields and subscriptions
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset() {
|
||||||
this.initializeOriginalFields();
|
this.initializeOriginalFields();
|
||||||
this.initializeUpdates();
|
this.initializeUpdates();
|
||||||
|
this.initializeItemUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user