Fixed issue with resource policies list that was not updated after a delete

This commit is contained in:
Giuseppe Digilio
2020-05-21 12:19:24 +02:00
parent 51620df76c
commit 8ef77df651

View File

@@ -112,6 +112,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
this.isActive = true; this.isActive = true;
this.requestService.removeByHrefSubstring(this.resourceUUID);
this.initResourcePolicyLIst(); this.initResourcePolicyLIst();
} }
@@ -134,6 +135,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
*/ */
deleteSelectedResourcePolicies(): void { deleteSelectedResourcePolicies(): void {
this.processingDelete$.next(true); this.processingDelete$.next(true);
this.requestService.removeByHrefSubstring(this.resourceUUID);
const policiesToDelete: ResourcePolicyCheckboxEntry[] = this.resourcePoliciesEntries$.value const policiesToDelete: ResourcePolicyCheckboxEntry[] = this.resourcePoliciesEntries$.value
.filter((entry: ResourcePolicyCheckboxEntry) => entry.checked); .filter((entry: ResourcePolicyCheckboxEntry) => entry.checked);
this.subs.push( this.subs.push(
@@ -244,8 +246,6 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
* Initialize the resource's policies list * Initialize the resource's policies list
*/ */
initResourcePolicyLIst() { initResourcePolicyLIst() {
// TODO to be reviewed when https://github.com/DSpace/dspace-angular/issues/644 will be resolved
this.requestService.removeByHrefSubstring(this.resourceUUID);
this.resourcePolicyService.searchByResource(this.resourceUUID, null, this.resourcePolicyService.searchByResource(this.resourceUUID, null,
followLink('eperson'), followLink('group')).pipe( followLink('eperson'), followLink('group')).pipe(
filter(() => this.isActive), filter(() => this.isActive),