Skip to content
Snippets Groups Projects
Commit 1d0f374d authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel
Browse files

Merge branch 'send-notification' into 'staging'

Show correct message for all roles when sending comment which is not automatically published

See merge request arsnova/topic-cloud!93
parents 1a9e9447 017462de
No related merge requests found
......@@ -30,36 +30,27 @@ export class CreateCommentWrapper {
dialogRef.afterClosed()
.subscribe(result => {
if (result) {
this.send(result, user.role);
this.send(result);
} else {
return;
}
});
}
send(comment: Comment, userRole: UserRole): void {
send(comment: Comment): void {
let message;
if (this.room.directSend) {
this.translateService.get('comment-list.comment-sent').subscribe(msg => {
this.notificationService.show(msg);
message = msg;
});
comment.ack = true;
} else {
switch (userRole) {
case UserRole.EDITING_MODERATOR:
case UserRole.EXECUTIVE_MODERATOR:
case UserRole.CREATOR:
this.translateService.get('comment-list.comment-sent').subscribe(msg => {
this.notificationService.show(msg);
});
comment.ack = true;
break;
case UserRole.PARTICIPANT:
this.translateService.get('comment-list.comment-sent-to-moderator').subscribe(msg => {
this.notificationService.show(msg);
});
break;
}
this.translateService.get('comment-list.comment-sent-to-moderator').subscribe(msg => {
message = msg;
});
}
this.commentService.addComment(comment).subscribe();
this.commentService.addComment(comment).subscribe(() => {
this.notificationService.show(message);
});
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment