From 65a9249c99bfb07a69fac49767ba410858015215 Mon Sep 17 00:00:00 2001 From: guillermo2519 Date: Thu, 9 Apr 2026 14:55:51 -0600 Subject: [PATCH] Fix #5454: Group edits are immediately reflected in the user interface --- .../group-form/group-form.component.spec.ts | 15 +++++++++++++++ .../group-form/group-form.component.ts | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts index 052ced40e6f..5e3f9a66c56 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts @@ -3,7 +3,9 @@ import { HttpClient } from '@angular/common/http'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, + fakeAsync, TestBed, + tick, waitForAsync, } from '@angular/core/testing'; import { @@ -344,6 +346,19 @@ describe('GroupFormComponent', () => { component.ngOnInit(); }); + it('should update the form fields with the new values after successful edit', fakeAsync(() => { + component.groupName.setValue('newGroupName'); + component.groupDescription.setValue(groupDescription); + + component.onSubmit(); + tick(); + + expect(component.formGroup.value.groupName).toBe(expected2.name); + expect(component.formGroup.value.groupDescription).toBe( + expected2.firstMetadataValue('dc.description'), + ); + })); + it('should edit with name and description operations', () => { component.groupName.setValue('newGroupName'); component.onSubmit(); diff --git a/src/app/access-control/group-registry/group-form/group-form.component.ts b/src/app/access-control/group-registry/group-form/group-form.component.ts index 54ea6d77fcc..f6ce8e9c433 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.ts @@ -416,6 +416,16 @@ export class GroupFormComponent implements OnInit, OnDestroy { getFirstCompletedRemoteData(), ).subscribe((rd: RemoteData) => { if (rd.hasSucceeded) { + + const updatedGroup = rd.payload; + + this.groupRegistryService.editGroup(updatedGroup); + + this.formGroup.patchValue({ + groupName: updatedGroup.name, + groupDescription: updatedGroup.firstMetadataValue('dc.description'), + }); + this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: this.dsoNameService.getName(rd.payload) })); this.submitForm.emit(rd.payload); } else {