Skip to content
Snippets Groups Projects
Commit 84e2062b authored by Philipp Sautner's avatar Philipp Sautner
Browse files

Merge branch 'questions-to-be-selected' into 'staging'

Questions to be selected

See merge request arsnova/topic-cloud!47
parents b0f6e402 10d5ab94
Branches
Tags
No related merge requests found
......@@ -18,6 +18,7 @@ import { UserRole } from '../../../models/user-roles.enum';
import { Rescale } from '../../../models/rescale';
import { RowComponent } from '../../../../../projects/ars/src/lib/components/layout/frame/row/row.component';
import { User } from '../../../models/user';
import { Observable } from 'rxjs';
@Component({
selector: 'app-comment',
......@@ -40,7 +41,9 @@ export class CommentComponent implements OnInit, AfterViewInit {
@Input() moderator: boolean;
@Input() userRole: UserRole;
@Input() user: User;
@Input() disabled = false;
@Output() clickedOnTag = new EventEmitter<string>();
@Output() clickedOnKeyword = new EventEmitter<string>();
@Output() clickedUserNumber = new EventEmitter<number>();
isStudent = false;
isCreator = false;
......@@ -57,6 +60,7 @@ export class CommentComponent implements OnInit, AfterViewInit {
@ViewChild('commentExpander', { static: true })commentExpander: RowComponent;
isExpanded = false;
isExpandable = false;
selectedKeyword: string = '';
constructor(protected authenticationService: AuthenticationService,
private route: ActivatedRoute,
......@@ -127,7 +131,10 @@ export class CommentComponent implements OnInit, AfterViewInit {
}
setRead(comment: Comment): void {
this.commentService.toggleRead(comment).subscribe();
// @ts-ignore
this.commentService.toggleRead(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)});
// @ts-ignore
}
markCorrect(comment: Comment, type: CorrectWrong): void {
......@@ -136,11 +143,16 @@ export class CommentComponent implements OnInit, AfterViewInit {
} else {
comment.correct = type;
}
this.commentService.markCorrect(comment).subscribe();
// @ts-ignore
this.commentService.markCorrect(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)});
// @ts-ignore
}
setFavorite(comment: Comment): void {
this.commentService.toggleFavorite(comment).subscribe();
// @ts-ignore
this.commentService.toggleFavorite(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)});
// @ts-ignore
}
voteUp(comment: Comment): void {
......@@ -207,11 +219,15 @@ export class CommentComponent implements OnInit, AfterViewInit {
}
setAck(comment: Comment): void {
this.commentService.toggleAck(comment).subscribe();
//@ts-ignore
this.commentService.toggleAck(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)});
//@ts-ignore
}
setBookmark(comment: Comment): void {
this.commentService.toggleBookmark(comment).subscribe();
//@ts-ignore
this.commentService.toggleBookmark(comment).subscribe(c => {this.comment = c; this.comment.keywordsFromQuestioner = JSON.parse(c.keywordsFromQuestioner)});
//@ts-ignore
}
goToFullScreen(element: Element): void {
......
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