diff --git a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.html b/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.html deleted file mode 100644 index e2e914be0d60af458453739fc25b2ee48ddb955c..0000000000000000000000000000000000000000 --- a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.html +++ /dev/null @@ -1,15 +0,0 @@ -<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="20px"> - <mat-form-field> - <textarea (focus)="eventService.makeFocusOnInputTrue()" (blur)="eventService.makeFocusOnInputFalse()" matInput #commentBody matTextareaAutosize matAutosizeMinRows=5 matAutosizeMaxRows=10 maxlength="250" - [formControl]="bodyForm"></textarea> - <mat-placeholder class="placeholder">{{ 'comment-answer-form.answer' | translate }}</mat-placeholder> - <mat-hint align="end"><span aria-hidden="true">{{commentBody.value.length}} / 250</span></mat-hint> - - </mat-form-field> -</div> -<app-dialog-action-buttons -buttonsLabelSection="comment-page" -confirmButtonLabel="send" -[cancelButtonClickAction]="buildCloseDialogActionCallback()" -[confirmButtonClickAction]="buildCreateCommentActionCallback(commentBody)" -></app-dialog-action-buttons> diff --git a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.scss b/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.scss deleted file mode 100644 index e45116d9b38586d8ac02b21b1bba5633790c2b5a..0000000000000000000000000000000000000000 --- a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.scss +++ /dev/null @@ -1,64 +0,0 @@ -button { - min-width: 80px; -} - -form { - display: block; - width: 100%; - max-width: 800px; - margin-bottom: 50px; -} - -app-comment-list { - width: 100%; - max-width: 800px; -} - -textarea { - line-height: 120%; - color: var(--on-surface); - caret-color: var(--on-surface); -} - -.send { - color: var(--on-primary); - background-color: var(--primary); -} - -mat-hint { - color: var(--on-surface) !important; -} - -.mat-select-value-text { - color: var(--on-surface); - caret-color: var(--on-surface); -} - -.placeholder { - color: var(--on-surface); -} - -::ng-deep .mat-form-field-label { - color: var(--on-surface)!important; -} - -::ng-deep .mat-form-field-underline { - background-color: var(--on-surface)!important; -} - -::ng-deep .mat-form-field-ripple { - background-color: var(--on-surface)!important; -} - -::ng-deep .mat-select-arrow-wrapper .mat-select-arrow { - color: var(--on-surface); -} - -::ng-deep .mat-select-value-text { - color: var(--on-surface); -} - -::ng-deep .mat-primary .mat-option.mat-selected:not(.mat-option-disabled) { - color: var(--primary); -} - \ No newline at end of file diff --git a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.ts b/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.ts deleted file mode 100644 index 6b05a3d1d1143b8e642e31e2511924b4d149dee6..0000000000000000000000000000000000000000 --- a/src/app/components/creator/_dialogs/comment-answer-form/comment-answer-form.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { Comment } from '../../../../models/comment'; -import { NotificationService } from '../../../../services/util/notification.service'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material'; -import { TranslateService } from '@ngx-translate/core'; -import { FormControl, Validators } from '@angular/forms'; -import { CommentListComponent } from '../../../shared/comment-list/comment-list.component'; -import { EventService } from '../../../../services/util/event.service'; - -@Component({ - selector: 'app-comment-answer-form', - templateUrl: './comment-answer-form.component.html', - styleUrls: ['./comment-answer-form.component.scss'] -}) -export class CommentAnswerFormComponent implements OnInit { - - comment: Comment; - - bodyForm = new FormControl('', [Validators.required]); - - constructor( - private notification: NotificationService, - public dialogRef: MatDialogRef<CommentListComponent>, - private translateService: TranslateService, - public dialog: MatDialog, - private translationService: TranslateService, - public eventService: EventService, - @Inject(MAT_DIALOG_DATA) public data: any) { - } - - ngOnInit() { - this.translateService.use(localStorage.getItem('currentLang')); - } - - onNoClick(): void { - this.dialogRef.close(); - } - - checkInputData(body: string): boolean { - body = body.trim(); - if (!body) { - this.translationService.get('comment-page.error-comment').subscribe(message => { - this.notification.show(message); - }); - return false; - } - return true; - } - - closeDialog(body: string) { - if (this.checkInputData(body) === true) { - this.dialogRef.close(body); - } - } - - - /** - * Returns a lambda which closes the dialog on call. - */ - buildCloseDialogActionCallback(): () => void { - return () => this.onNoClick(); - } - - - /** - * Returns a lambda which executes the dialog dedicated action on call. - */ - buildCreateCommentActionCallback(text: HTMLInputElement): () => void { - return () => this.closeDialog(text.value); - } -} diff --git a/src/app/components/creator/creator-routing.module.ts b/src/app/components/creator/creator-routing.module.ts index 4b2e84a263661465189d327edcb2b7ab8f1b9667..5e3e20891cc62102fa93bb49889a6c8ec0152a23 100644 --- a/src/app/components/creator/creator-routing.module.ts +++ b/src/app/components/creator/creator-routing.module.ts @@ -4,6 +4,7 @@ import { AuthenticationGuard } from '../../guards/authentication.guard'; import { UserRole } from '../../models/user-roles.enum'; import { RoomCreatorPageComponent } from './room-creator-page/room-creator-page.component'; import { CommentPageComponent } from '../shared/comment-page/comment-page.component'; +import { CommentAnswerComponent } from '../shared/comment-answer/comment-answer.component'; const routes: Routes = [ { @@ -17,6 +18,12 @@ const routes: Routes = [ component: CommentPageComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } + }, + { + path: 'room/:shortId/comment/:commentId', + component: CommentAnswerComponent, + canActivate: [AuthenticationGuard], + data: { roles: [UserRole.CREATOR] } } ]; diff --git a/src/app/components/creator/creator.module.ts b/src/app/components/creator/creator.module.ts index 67f75d0e70035ce0a94f7f2c48174212755f9158..b4fb412f1c6ac89d46df63a10baa0b98cc7aa938 100644 --- a/src/app/components/creator/creator.module.ts +++ b/src/app/components/creator/creator.module.ts @@ -18,7 +18,6 @@ import { TagsComponent } from './_dialogs/tags/tags.component'; import { ModeratorDeleteComponent } from './_dialogs/moderator-delete/moderator-delete.component'; import { DeleteCommentComponent } from './_dialogs/delete-comment/delete-comment.component'; import { DeleteCommentsComponent } from './_dialogs/delete-comments/delete-comments.component'; -import { CommentAnswerFormComponent } from './_dialogs/comment-answer-form/comment-answer-form.component'; import { BonusDeleteComponent } from './_dialogs/bonus-delete/bonus-delete.component'; import { MarkdownModule } from 'ngx-markdown'; @@ -51,8 +50,7 @@ import { MarkdownModule } from 'ngx-markdown'; ModeratorDeleteComponent, DeleteCommentsComponent, DeleteCommentComponent, - BonusDeleteComponent, - CommentAnswerFormComponent, + BonusDeleteComponent ], exports: [], entryComponents: [ @@ -66,8 +64,7 @@ import { MarkdownModule } from 'ngx-markdown'; TagsComponent, DeleteCommentsComponent, DeleteCommentComponent, - BonusDeleteComponent, - CommentAnswerFormComponent + BonusDeleteComponent ] }) export class CreatorModule { diff --git a/src/app/components/participant/participant-routing.module.ts b/src/app/components/participant/participant-routing.module.ts index 46380dea2247996261447e9d7a5b6616f1064a2f..f12c61ee85df42192543d672b997910c73a8f912 100644 --- a/src/app/components/participant/participant-routing.module.ts +++ b/src/app/components/participant/participant-routing.module.ts @@ -1,9 +1,9 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AuthenticationGuard } from '../../guards/authentication.guard'; import { UserRole } from '../../models/user-roles.enum'; import { RoomParticipantPageComponent } from './room-participant-page/room-participant-page.component'; import { CommentPageComponent } from '../shared/comment-page/comment-page.component'; +import { CommentAnswerComponent } from '../shared/comment-answer/comment-answer.component'; const routes: Routes = [ { @@ -15,6 +15,11 @@ const routes: Routes = [ path: 'room/:shortId/comments', component: CommentPageComponent, data: { roles: [UserRole.PARTICIPANT] } + }, + { + path: 'room/:shortId/comment/:commentId', + component: CommentAnswerComponent, + data: { roles: [UserRole.PARTICIPANT] } } ]; diff --git a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.html b/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.html deleted file mode 100644 index dbe5a74bcc00f9310596ab44cf8af0137f1c7513..0000000000000000000000000000000000000000 --- a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<p class="comment-answer"> - {{ answer }} -</p> diff --git a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.scss b/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.scss deleted file mode 100644 index 5c03e1ef32c3d06f6d4af2758a3dff9583f87763..0000000000000000000000000000000000000000 --- a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -.comment-answer { - color: var(--on-surface); - font-size: 140%; - text-align: start; - white-space: pre-line; - hyphens: auto; - overflow-wrap: anywhere !important; -} diff --git a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.ts b/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.ts deleted file mode 100644 index 56220c5fa1f5e5eebc4f0af6df99e26af2abb7f7..0000000000000000000000000000000000000000 --- a/src/app/components/shared/_dialogs/comment-answer-text/comment-answer-text.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { Comment } from '../../../../models/comment'; -import { NotificationService } from '../../../../services/util/notification.service'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material'; -import { TranslateService } from '@ngx-translate/core'; -import { FormControl, Validators } from '@angular/forms'; -import { User } from '../../../../models/user'; -import { CommentListComponent } from '../../comment-list/comment-list.component'; -import { EventService } from '../../../../services/util/event.service'; - -@Component({ - selector: 'app-comment-answer-text', - templateUrl: './comment-answer-text.component.html', - styleUrls: ['./comment-answer-text.component.scss'] -}) -export class CommentAnswerTextComponent implements OnInit { - - answer: string; - - constructor( - private notification: NotificationService, - public dialogRef: MatDialogRef<CommentListComponent>, - private translateService: TranslateService, - public dialog: MatDialog, - private translationService: TranslateService, - public eventService: EventService, - @Inject(MAT_DIALOG_DATA) public data: any) { - } - - ngOnInit() { - this.translateService.use(localStorage.getItem('currentLang')); - } - - onNoClick(): void { - this.dialogRef.close(); - } -} diff --git a/src/app/components/shared/comment-answer/comment-answer.component.html b/src/app/components/shared/comment-answer/comment-answer.component.html new file mode 100644 index 0000000000000000000000000000000000000000..20395fa0db8d1b0b3f241c1de42ce58d61e7861d --- /dev/null +++ b/src/app/components/shared/comment-answer/comment-answer.component.html @@ -0,0 +1,36 @@ +<div fxLayout="column" fxLayoutAlign="center" *ngIf="!isLoading"> + <div fxLayout="row" fxLayoutAlign="center"> + <app-comment [comment]="comment" [userRole]="user.role"></app-comment> + </div> + <div fxLayout="row" fxLayoutAlign="center"> + <mat-card class="answer"> + <markdown *ngIf="isStudent && answer" [data]="answer"></markdown> + <mat-tab-group *ngIf="!isStudent" [dynamicHeight]="true"> + <mat-tab label="{{'comment-page.your-answer' | translate}}"> + <mat-form-field class="input-block"> + <textarea [(ngModel)]="answer" + matInput + matTextareaAutosize + matAutosizeMinRows="3" + matAutosizeMaxRows="8" + maxlength="2000" + name="answer"> + </textarea> + <mat-hint align="end"> + <span aria-hidden="true"> + {{ answer ? answer.length : 0 }} / 2000 + </span> + </mat-hint> + </mat-form-field> + </mat-tab> + <mat-tab label="{{'session.preview' | translate}}" [disabled]="!answer"> + <markdown [data]="answer"></markdown> + </mat-tab> + </mat-tab-group> + <div fxLayout="row" fxLayoutAlign="end"> + <button mat-raised-button *ngIf="!isStudent" class="save" (click)="saveAnswer()"> + {{'comment-page.save-answer' | translate}}</button> + </div> + </mat-card> + </div> +</div> diff --git a/src/app/components/shared/comment-answer/comment-answer.component.scss b/src/app/components/shared/comment-answer/comment-answer.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..d8b5bf773337ed67548c7285a1a4a3f2cacd2195 --- /dev/null +++ b/src/app/components/shared/comment-answer/comment-answer.component.scss @@ -0,0 +1,42 @@ +app-comment, mat-card { + width: 100%; + max-width: 800px; +} + +.answer { + background-color: var(--alt-surface); + color: var(--on-surface); + padding: 3% 3%; + box-sizing: border-box +} + +.save { + background-color: var(--primary); + color: var(--on-primary); + margin-top: 2%; + margin-right: 1%; +} + +mat-form-field { + color: var(--on-surface); +} + +mat-hint { + color: var(--on-surface)!important; + margin-right: 1%; +} + +markdown { + word-break: break-all; +} + +::ng-deep .mat-tab-label-active, +::ng-deep .mat-tab-label { + color: var(--on-surface); + opacity: 1!important; +} + +::ng-deep .mat-ink-bar { + background-color: var(--primary) !important; +} + diff --git a/src/app/components/shared/comment-answer/comment-answer.component.spec.ts b/src/app/components/shared/comment-answer/comment-answer.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..01ce42ba5fc1c04e2f1a5bcfd3ee931665912800 --- /dev/null +++ b/src/app/components/shared/comment-answer/comment-answer.component.spec.ts @@ -0,0 +1,27 @@ +/* +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentAnswerComponent } from './comment-answer.component'; + +describe('CommentAnswerComponent', () => { + let component: CommentAnswerComponent; + let fixture: ComponentFixture<CommentAnswerComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentAnswerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentAnswerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); +*/ diff --git a/src/app/components/shared/comment-answer/comment-answer.component.ts b/src/app/components/shared/comment-answer/comment-answer.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a77070c15b8a1a6a2e0923f6e47952ffb7782c6 --- /dev/null +++ b/src/app/components/shared/comment-answer/comment-answer.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { LanguageService } from '../../../services/util/language.service'; +import { WsCommentServiceService } from '../../../services/websockets/ws-comment-service.service'; +import { CommentService } from '../../../services/http/comment.service'; +import { Comment } from '../../../models/comment'; +import { User } from '../../../models/user'; +import { AuthenticationService } from '../../../services/http/authentication.service'; +import { UserRole } from '../../../models/user-roles.enum'; +import { NotificationService } from '../../../services/util/notification.service'; + +@Component({ + selector: 'app-comment-answer', + templateUrl: './comment-answer.component.html', + styleUrls: ['./comment-answer.component.scss'] +}) +export class CommentAnswerComponent implements OnInit { + + comment: Comment; + answer: string; + isLoading = true; + user: User; + isStudent = true; + + constructor(protected route: ActivatedRoute, + private notificationService: NotificationService, + private translateService: TranslateService, + protected langService: LanguageService, + protected wsCommentService: WsCommentServiceService, + protected commentService: CommentService, + private authenticationService: AuthenticationService) { } + + ngOnInit() { + this.user = this.authenticationService.getUser(); + if (this.user.role !== UserRole.PARTICIPANT) { + this.isStudent = false; + } + this.route.params.subscribe(params => { + this.commentService.getComment(params['commentId']).subscribe(comment => { + this.comment = comment; + this.answer = this.comment.answer; + this.isLoading = false; + }); + }); + } + + saveAnswer() { + this.wsCommentService.answer(this.comment, this.answer); + this.translateService.get('comment-list.comment-answered').subscribe(msg => { + this.notificationService.show(msg); + }); + } + +} diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index af0ab6000fda306190d7254b9f63143534399a6c..d26d3eb90ee04ef6e900a2e03cb5ce42d80f3690 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -20,15 +20,10 @@ </button> <span class="fill-remaining-space"></span> - <button mat-icon-button *ngIf="(isCreator || isModerator) && !comment.answer" (click)="openAnswerDialog()" - tabindex="0"> - <mat-icon class="not-marked" matTooltip="{{ 'comment-page.answer' | translate }}">comment - </mat-icon> - </button> - - <button mat-icon-button *ngIf="comment.answer" (click)="openAnswerTextDialog()" - tabindex="0"> - <mat-icon class="answered-icon" matTooltip="{{ 'comment-page.has-answer' | translate }}">comment + <button mat-icon-button *ngIf="(isCreator || isModerator || comment.answer) && !inAnswerView" + (click)="answerComment()" tabindex="0"> + <mat-icon class="not-marked" [ngClass]="{'answered-icon' : comment.answer}" + matTooltip="{{comment.answer ? ('comment-page.has-answer' | translate) : ('comment-page.answer' | translate) }}">comment </mat-icon> </button> @@ -55,12 +50,12 @@ : ('comment-page.mark-not-favorite' | translate)">grade </mat-icon> </button> - <button mat-icon-button *ngIf="isCreator && !comment.favorite" (click)="openDeleteCommentDialog()" + <button mat-icon-button *ngIf="isCreator && !comment.favorite && !inAnswerView" (click)="openDeleteCommentDialog()" tabindex="0" attr.aria-labelledby="comment_delete{{ comment.id }}"> <mat-icon class="not-marked" matTooltip="{{ 'comment-page.delete' | translate }}">delete </mat-icon> </button> - <button mat-icon-button *ngIf="isCreator || isModerator" (click)="setAck(comment)" + <button mat-icon-button *ngIf="(isCreator || isModerator) && !inAnswerView" (click)="setAck(comment)" tabindex="0" attr.aria-labelledby="comment_moderation{{ comment.id }}"> <mat-icon class="gavel" [matTooltip]="!comment.ack ? ('comment-page.acknowledge' | translate) : ('comment-page.reject' | translate)">gavel diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index ac7502a6c10634e70620d0d0a6dacad383b7300f..214732bd406b8acdbde64e7cf0258126043ac105 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -2,7 +2,7 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; import { Comment } from '../../../models/comment'; import { Vote } from '../../../models/vote'; import { AuthenticationService } from '../../../services/http/authentication.service'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { Location } from '@angular/common'; import { CommentService } from '../../../services/http/comment.service'; import { NotificationService } from '../../../services/util/notification.service'; @@ -10,11 +10,9 @@ import { TranslateService } from '@ngx-translate/core'; import { LanguageService } from '../../../services/util/language.service'; import { WsCommentServiceService } from '../../../services/websockets/ws-comment-service.service'; import { PresentCommentComponent } from '../_dialogs/present-comment/present-comment.component'; -import { CommentAnswerTextComponent } from '../_dialogs/comment-answer-text/comment-answer-text.component'; import { MatDialog } from '@angular/material'; import { animate, keyframes, state, style, transition, trigger } from '@angular/animations'; import { DeleteCommentComponent } from '../../creator/_dialogs/delete-comment/delete-comment.component'; -import { CommentAnswerFormComponent } from '../../creator/_dialogs/comment-answer-form/comment-answer-form.component'; import { CorrectWrong } from '../../../models/correct-wrong.enum'; import { UserRole } from '../../../models/user-roles.enum'; import { Rescale } from '../../../models/rescale'; @@ -57,10 +55,12 @@ export class CommentComponent implements OnInit { language: string; animationState: string; deviceType: string; + inAnswerView = false; constructor(protected authenticationService: AuthenticationService, private route: ActivatedRoute, private location: Location, + protected router: Router, private commentService: CommentService, private notification: NotificationService, private translateService: TranslateService, @@ -87,6 +87,7 @@ export class CommentComponent implements OnInit { this.language = localStorage.getItem('currentLang'); this.translateService.use(this.language); this.deviceType = localStorage.getItem('deviceType'); + this.inAnswerView = !this.router.url.includes('comments'); } startAnimation(state_: any): void { @@ -159,24 +160,9 @@ export class CommentComponent implements OnInit { }); } - openAnswerDialog(): void { - const dialogRef = this.dialog.open(CommentAnswerFormComponent, { - width: '400px' - }); - dialogRef.afterClosed() - .subscribe(result => { - this.wsCommentService.answer(this.comment, result); - this.translateService.get('comment-list.comment-answered').subscribe(msg => { - this.notification.show(msg); - }); - }); - } - - openAnswerTextDialog(): void { - const dialogRef = this.dialog.open(CommentAnswerTextComponent, { - width: '400px' - }); - dialogRef.componentInstance.answer = this.comment.answer; + answerComment() { + const url = this.location.path().slice(0, -1); + this.router.navigate([`${url}/${this.comment.id}`]); } delete(): void { diff --git a/src/app/components/shared/shared.module.ts b/src/app/components/shared/shared.module.ts index 52c6104914fdc7aa87d5dd21a2d1468ff08599dc..d681c16dd4706cb569501a2bab50e14dd1b01d60 100644 --- a/src/app/components/shared/shared.module.ts +++ b/src/app/components/shared/shared.module.ts @@ -19,13 +19,14 @@ import { CommentComponent } from './comment/comment.component'; import { CreateCommentComponent } from './_dialogs/create-comment/create-comment.component'; import { PresentCommentComponent } from './_dialogs/present-comment/present-comment.component'; import { DeleteAccountComponent } from './_dialogs/delete-account/delete-account.component'; -import { CommentAnswerTextComponent } from './_dialogs/comment-answer-text/comment-answer-text.component'; import { DialogActionButtonsComponent } from './dialog/dialog-action-buttons/dialog-action-buttons.component'; import { MatRippleModule } from '@angular/material'; import { QrCodeDialogComponent } from './_dialogs/qr-code-dialog/qr-code-dialog.component'; import { NgxQRCodeModule } from 'ngx-qrcode2'; import { ArsModule } from '../../../../projects/ars/src/lib/ars.module'; import { RemoveFromHistoryComponent } from './_dialogs/remove-from-history/remove-from-history.component'; +import { CommentAnswerComponent } from './comment-answer/comment-answer.component'; +import { MarkdownModule } from 'ngx-markdown'; @NgModule({ imports: [ @@ -35,7 +36,8 @@ import { RemoveFromHistoryComponent } from './_dialogs/remove-from-history/remov SharedRoutingModule, MatRippleModule, NgxQRCodeModule, - ArsModule + ArsModule, + MarkdownModule ], declarations: [ RoomJoinComponent, @@ -54,10 +56,10 @@ import { RemoveFromHistoryComponent } from './_dialogs/remove-from-history/remov CreateCommentComponent, PresentCommentComponent, DeleteAccountComponent, - CommentAnswerTextComponent, DialogActionButtonsComponent, QrCodeDialogComponent, - RemoveFromHistoryComponent + RemoveFromHistoryComponent, + CommentAnswerComponent ], exports: [ RoomJoinComponent, @@ -81,8 +83,7 @@ import { RemoveFromHistoryComponent } from './_dialogs/remove-from-history/remov PresentCommentComponent, DeleteAccountComponent, UserBonusTokenComponent, - RemindOfTokensComponent, - CommentAnswerTextComponent + RemindOfTokensComponent ] }) export class SharedModule { diff --git a/src/app/services/http/comment.service.ts b/src/app/services/http/comment.service.ts index 479179c91ad846cdc9a8d6928cbe682b04ca3460..bf5196cc9f83856f8e8f137b181b5fb88e0fbd73 100644 --- a/src/app/services/http/comment.service.ts +++ b/src/app/services/http/comment.service.ts @@ -23,10 +23,10 @@ export class CommentService extends BaseHttpService { } getComment(commentId: string): Observable<Comment> { - const connectionUrl = `${this.apiUrl.base}${this.apiUrl.comment}/~${commentId}`; + const connectionUrl = `${this.apiUrl.base}${this.apiUrl.comment}/${commentId}`; return this.http.get<Comment>(connectionUrl, httpOptions).pipe( tap(_ => ''), - catchError(this.handleError<Comment>('addComment')) + catchError(this.handleError<Comment>('getComment')) ); } diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json index 706c973422ed59e91494723a2bd4c6cf6cdcaf86..629d8692e4464944c1b963801fa8595c3fd9bf7b 100644 --- a/src/assets/i18n/creator/de.json +++ b/src/assets/i18n/creator/de.json @@ -68,7 +68,10 @@ "abort": "Abbrechen", "ask-question-description": "Gib hier deine Frage ans Auditorium ein!", "acknowledge": "Lässt die Frage zu und setzt sie zurück auf die öffentliche Liste", - "answer": "Kommentiere die Frage", + "your-answer": "Deine Antwort", + "answer": "Frage kommentieren", + "save-answer": "Speichern", + "has-answer": "Du hast die Frage kommentiert.", "cancel": "Abbrechen", "cancel-description": "Abbrechen", "comment": "Die Frage {{ comment }} wurde um {{ time }} Uhr gestellt und hat derzeitig {{ votes }}. {{correct}} {{wrong}} {{bonus}} {{beamer}}", @@ -83,7 +86,6 @@ "exit-description": "Präsentationsmodus verlassen", "export": "Exportieren", "export-description": "Exportieren", - "has-answer": "Du hast die Frage kommentiert.", "live-announcer": "Du befindest dich jetzt auf der Fragen-Seite. Um Informationen zu Tastenkombinationen zu erhalten drücke jetzt die Enter-Taste oder rufe die Ansage zu einem späteren Zeitpunkt mit der Escape-Taste auf.", "live-announcer-moderation": "Du befindest dich jetzt auf der Moderations-Seite. Um Informationen zu Tastenkombinationen zu erhalten drücke jetzt die Enter-Taste oder rufe die Ansage zu einem späteren Zeitpunkt mit der Escape-Taste auf.", "mark-correct": "Frage bejahen", diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json index a1bec1a10306c1beec9781e5d0dbdad2f27e72bd..e6dd9c6d35d5c1ec008ed05fac1d79d9d7254960 100644 --- a/src/assets/i18n/creator/en.json +++ b/src/assets/i18n/creator/en.json @@ -68,7 +68,10 @@ "a11y-text_wrong": "The question was answered in the negative.", "abort": "Cancel", "acknowledge": "Let the question go", + "your-answer": "Your answer", "answer": "Comment this question", + "save-answer": "Save", + "has-answer": "You commented on the question.", "ask-question-description": "Enter your question to the audience here!", "cancel": "Cancel", "cancel-description": "Cancel", @@ -84,7 +87,6 @@ "exit-description": "Exit Presentation Mode", "export": "Export", "export-description": "Export", - "has-answer": "You commented on the question.", "live-announcer": "You are now on the questions page. To get information about key combinations press the Enter key or call the announcement later with the Escape key.", "live-announcer-moderation": "You are now on the moderation page. To get information about key combinations press the Enter key or call the announcement later with the Escape key.", "mark-correct": "Mark as correct", diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index d1688d92466bf7bf1a766ed1b323565ddd688b6b..d648bfdba4bfff09a12d259c3fd24017eace9c8d 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -103,7 +103,6 @@ "room-page": { "a11y-announcer": "Du befindest dich nun in der Sitzung mit dem von dir eingegebenen Sitzungs-Code.", "a11y-question_answer": "Öffnet die Fragen-Seite und bietet dir die Möglichkeit, Fragen zu stellen.", - "answer-statistics": "Statistiken", "comments": "Fragen", "create-comment": "Stell deine Frage!", "default-content-group": "Standard", @@ -115,16 +114,5 @@ "session-id": "Code", "bonus-token": "Tokens für Bonuspunkte", "bonus-token-header": "Tokens für Bonuspunkte" - }, - "statistic": { - "abstentions": "Enthaltungen", - "answer-statistic": "Antwortstatistik", - "answers": "Antworten", - "content": "Frage", - "good": "Gut", - "improvable": "Luft nach oben", - "no-answers": "Keine Antworten", - "no-questions": "Es sind noch keine Antworten vorhanden.", - "percentage": "Prozent" } } diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index 24609b226f5a54ad57b4c76906d6b158028e304c..6c6a9a025f325479428d23599d39344c03f698b4 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -102,7 +102,6 @@ "room-page": { "a11y-announcer": "You are now in the session with the key you entered.", "a11y-question_answer": "Opens the page where you can ask questions and vote up or down other questions.", - "answer-statistics": "Statistics", "comments": "Questions", "create-comment": "Ask a question!", "default-content-group": "Default", @@ -114,16 +113,5 @@ "session-id": "Key", "bonus-token": "Tokens for bonus points", "bonus-token-header": "Tokens for bonus points" - }, - "statistic": { - "abstentions": "Abstentions", - "answer-statistic": "Answer statistics", - "answers": "Answers", - "content": "Content", - "good": "Good", - "improvable": "Improvable", - "no-answers": "No answers", - "no-questions": "There are no answers yet.", - "percentage": "Percentage" } } diff --git a/src/theme/dark-theme/darkTheme.const.ts b/src/theme/dark-theme/darkTheme.const.ts index a31c9635cb1776927528ef1f691e6e7a7be79558..a8f7ab5e7e6adc9746ce3ffc143162c71f2dcc58 100644 --- a/src/theme/dark-theme/darkTheme.const.ts +++ b/src/theme/dark-theme/darkTheme.const.ts @@ -10,6 +10,7 @@ export const dark = { '--surface': '#212121', '--dialog': '#37474f', '--cancel': '#26343c', + '--alt-surface': '#323232', '--alt-dialog': '#455a64', '--on-primary': '#000000', diff --git a/src/theme/high-contrast-theme/highContrastTheme.const.ts b/src/theme/high-contrast-theme/highContrastTheme.const.ts index 25307d294195f3b04ec7decb4832a42531d97103..fbf1121c7c095477a6d41ee54c8f82bb890827fc 100644 --- a/src/theme/high-contrast-theme/highContrastTheme.const.ts +++ b/src/theme/high-contrast-theme/highContrastTheme.const.ts @@ -9,6 +9,7 @@ export const highcontrast = { '--background': '#141414', '--surface': '#1e1e1e', '--dialog': '#37474f', + '--alt-surface': '#323232', '--alt-dialog': '#455a64', '--on-primary': '#141414', diff --git a/src/theme/light-theme/light-theme.ts b/src/theme/light-theme/light-theme.ts index e6879ae1fb4fd35c4fb0a87b735ec99e8ffe4aac..0158aaa81c269e297770b1320e11c09075c77b60 100644 --- a/src/theme/light-theme/light-theme.ts +++ b/src/theme/light-theme/light-theme.ts @@ -10,6 +10,7 @@ export const arsnova = { '--surface': '#FFFFFF', '--dialog': '#FFFFFF', '--cancel': '#263238', + '--alt-surface': '#eeeeee', '--alt-dialog': '#eeeeee', '--on-primary': '#ffffff', diff --git a/src/theme/purple-theme/purpleTheme.const.ts b/src/theme/purple-theme/purpleTheme.const.ts index 287320618f6395be6075ad42e5da3374b8b51a02..39a919ce0a7f4f5896f1998943aa879b8970a739 100644 --- a/src/theme/purple-theme/purpleTheme.const.ts +++ b/src/theme/purple-theme/purpleTheme.const.ts @@ -9,6 +9,7 @@ export const purple = { '--background': 'beige', '--surface': 'white', '--dialog': 'white', + '--alt-surface': '#eeeeee', '--alt-dialog': '#eeeeee', '--on-primary': 'white',