Skip to content
Snippets Groups Projects
Commit 77dafcab authored by Lars Wächter's avatar Lars Wächter
Browse files

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

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