user.login!);
+ this.isLoading = true;
+
if (isChannelDTO(this.activeConversation)) {
this.channelService
.registerUsersToChannel(this.course.id!, this.activeConversation.id!, addAllStudents, addAllTutors, addAllInstructors, userLogins)
@@ -77,6 +80,9 @@ export class ConversationAddUsersDialogComponent extends AbstractDialogComponent
error: (errorResponse: HttpErrorResponse) => {
onError(this.alertService, errorResponse);
},
+ complete: () => {
+ this.isLoading = false;
+ },
});
} else if (isGroupChatDTO(this.activeConversation)) {
this.groupChatService
@@ -90,6 +96,9 @@ export class ConversationAddUsersDialogComponent extends AbstractDialogComponent
error: (errorResponse: HttpErrorResponse) => {
onError(this.alertService, errorResponse);
},
+ complete: () => {
+ this.isLoading = false;
+ },
});
} else {
throw new Error('Conversation type not supported');
diff --git a/src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-add-users-dialog/conversation-add-users-dialog.component.spec.ts b/src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-add-users-dialog/conversation-add-users-dialog.component.spec.ts
index d1afbe9f83f1..f2886be487e9 100644
--- a/src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-add-users-dialog/conversation-add-users-dialog.component.spec.ts
+++ b/src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-add-users-dialog/conversation-add-users-dialog.component.spec.ts
@@ -9,7 +9,7 @@ import { GroupChatService } from 'app/shared/metis/conversations/group-chat.serv
import { ConversationDTO } from 'app/entities/metis/conversation/conversation.model';
import { Course } from 'app/entities/course.model';
import { generateExampleChannelDTO, generateExampleGroupChatDTO } from '../../helpers/conversationExampleModels';
-import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Component, EventEmitter, Input, Output, input } from '@angular/core';
import { AddUsersFormData } from 'app/overview/course-conversations/dialogs/conversation-add-users-dialog/add-users-form/conversation-add-users-form.component';
import { initializeDialog } from '../dialog-test-helpers';
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
@@ -29,6 +29,8 @@ class ConversationAddUsersFormStubComponent {
@Input() courseId: number;
@Input() maxSelectable?: number = undefined;
+ protected readonly isLoading = input(false);
+
@Input()
activeConversation: ConversationDTO;
}