From 961c6538f7e829688d12bfeb6fad4b68877259c5 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Sun, 8 Oct 2023 13:15:51 -0400 Subject: [PATCH] fix(Manage Students): Subscribe to retrieve config after remove user #1449 --- .../manage-user/manage-user.component.spec.ts | 3 ++- .../manageStudents/manage-user/manage-user.component.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.spec.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.spec.ts index b7ae5216973..88cf902b3cf 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.spec.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.spec.ts @@ -6,6 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ConfigService } from '../../../../services/configService'; import { ManageUserComponent } from './manage-user.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { of } from 'rxjs'; class ConfigServiceStub { getPermissions() {} @@ -13,7 +14,7 @@ class ConfigServiceStub { return 123; } retrieveConfig() { - return {}; + return of({}); } } diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.ts b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.ts index c8141a4f7d0..1b594d02dc4 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/manageStudents/manage-user/manage-user.component.ts @@ -53,8 +53,13 @@ export class ManageUserComponent { this.http.delete(`/api/teacher/run/${runId}/student/${studentId}/remove`).subscribe({ next: () => { this.removeUserEvent.emit(this.user); - this.snackBar.open($localize`Removed ${this.user.name} (${this.user.username}) from unit.`); - this.configService.retrieveConfig(`/api/config/classroomMonitor/${runId}`); + this.configService.retrieveConfig(`/api/config/classroomMonitor/${runId}`).subscribe({ + next: () => { + this.snackBar.open( + $localize`Removed ${this.user.name} (${this.user.username}) from unit.` + ); + } + }); }, error: () => { this.snackBar.open(