diff --git a/src/app/components/creator/comment-creator-page/comment-creator-page.component.html b/src/app/components/creator/comment-creator-page/comment-creator-page.component.html index cb304da36e93923b448b9828927e96afbd907ab6..2445a6fcae34f3159b6597b46220b8fe37935acc 100644 --- a/src/app/components/creator/comment-creator-page/comment-creator-page.component.html +++ b/src/app/components/creator/comment-creator-page/comment-creator-page.component.html @@ -1,3 +1 @@ -<div fxLayout="row" fxLayoutAlign="center"> - <app-comment-list></app-comment-list> -</div> +<app-comment-page></app-comment-page> diff --git a/src/app/components/participant/comment-participant-page/comment-participant-page.component.html b/src/app/components/participant/comment-participant-page/comment-participant-page.component.html new file mode 100644 index 0000000000000000000000000000000000000000..2445a6fcae34f3159b6597b46220b8fe37935acc --- /dev/null +++ b/src/app/components/participant/comment-participant-page/comment-participant-page.component.html @@ -0,0 +1 @@ +<app-comment-page></app-comment-page> diff --git a/src/app/components/participant/comment-participant-page/comment-participant-page.component.scss b/src/app/components/participant/comment-participant-page/comment-participant-page.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/components/participant/comment-participant-page/comment-participant-page.component.spec.ts b/src/app/components/participant/comment-participant-page/comment-participant-page.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..6287f88a12f29bf8718cfa17ad8ef9dc0ea7b490 --- /dev/null +++ b/src/app/components/participant/comment-participant-page/comment-participant-page.component.spec.ts @@ -0,0 +1,27 @@ +/* +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentParticipantPageComponent } from './comment-participant-page.component'; + +describe('CommentParticipantPageComponent', () => { + let component: CommentParticipantPageComponent; + let fixture: ComponentFixture<CommentParticipantPageComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentParticipantPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentParticipantPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); +*/ diff --git a/src/app/components/participant/comment-participant-page/comment-participant-page.component.ts b/src/app/components/participant/comment-participant-page/comment-participant-page.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..e652a59ef795450533ed4f834ce437bfe4545ee8 --- /dev/null +++ b/src/app/components/participant/comment-participant-page/comment-participant-page.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-comment-participant-page', + templateUrl: './comment-participant-page.component.html', + styleUrls: ['./comment-participant-page.component.scss'] +}) +export class CommentParticipantPageComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/participant/participant-routing.module.ts b/src/app/components/participant/participant-routing.module.ts index b4b33c4e59fc1066fbfb6dae8a08a82d82ccb22b..1b6054cae8add874cad84fa73b8b247118b9549c 100644 --- a/src/app/components/participant/participant-routing.module.ts +++ b/src/app/components/participant/participant-routing.module.ts @@ -4,11 +4,11 @@ import { HomeParticipantPageComponent } from './home-participant-page/home-parti import { AuthenticationGuard } from '../../guards/authentication.guard'; import { UserRole } from '../../models/user-roles.enum'; import { RoomParticipantPageComponent } from './room-participant-page/room-participant-page.component'; -import { CommentCreatePageComponent } from './comment-create-page/comment-create-page.component'; import { FeedbackBarometerPageComponent } from '../shared/feedback-barometer-page/feedback-barometer-page.component'; import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page/participant-content-carousel-page.component'; import { StatisticsPageComponent } from '../shared/statistics-page/statistics-page.component'; import { StatisticComponent } from '../shared/statistic/statistic.component'; +import { CommentParticipantPageComponent } from './comment-participant-page/comment-participant-page.component'; const routes: Routes = [ { @@ -36,8 +36,8 @@ const routes: Routes = [ data: { roles: [UserRole.PARTICIPANT] } }, { - path: 'room/:roomId/create-comment', - component: CommentCreatePageComponent, + path: 'room/:roomId/comments', + component: CommentParticipantPageComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.PARTICIPANT] } }, diff --git a/src/app/components/participant/participant.module.ts b/src/app/components/participant/participant.module.ts index 761eb713673706f2f7fdf18427c47f81fca42b0b..640952e86f8c4ee683e67d86574822321a401f5f 100644 --- a/src/app/components/participant/participant.module.ts +++ b/src/app/components/participant/participant.module.ts @@ -11,7 +11,7 @@ import { ParticipantContentCarouselPageComponent } from './participant-content-c import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { HttpClient } from '@angular/common/http'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { SubmitCommentComponent } from './_diaglogs/submit-comment/submit-comment.component'; +import { CommentParticipantPageComponent } from './comment-participant-page/comment-participant-page.component'; @NgModule({ imports: [ @@ -34,10 +34,7 @@ import { SubmitCommentComponent } from './_diaglogs/submit-comment/submit-commen HomeParticipantPageComponent, RoomParticipantPageComponent, ParticipantContentCarouselPageComponent, - SubmitCommentComponent - ], - entryComponents: [ - SubmitCommentComponent + CommentParticipantPageComponent ] }) export class ParticipantModule { diff --git a/src/app/components/participant/room-participant-page/room-participant-page.component.html b/src/app/components/participant/room-participant-page/room-participant-page.component.html index c361e9994ecc4f6cb84c41cc0c8c464e4ef89283..796d69a139da388bb89fc22608beb7f01105e26b 100644 --- a/src/app/components/participant/room-participant-page/room-participant-page.component.html +++ b/src/app/components/participant/room-participant-page/room-participant-page.component.html @@ -24,7 +24,7 @@ <mat-grid-list cols="3" rowHeight="2:1"> <mat-grid-tile> <button mat-icon-button color="primary" matTooltip="{{ 'room-page.create-comment' | translate}}" - routerLink="/participant/room/{{ room.id }}/create-comment"> + routerLink="/participant/room/{{ room.id }}/comments"> <mat-icon>question_answer</mat-icon> </button> </mat-grid-tile> diff --git a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.html b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.html similarity index 100% rename from src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.html rename to src/app/components/shared/_dialogs/submit-comment/submit-comment.component.html diff --git a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.scss b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.scss similarity index 100% rename from src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.scss rename to src/app/components/shared/_dialogs/submit-comment/submit-comment.component.scss diff --git a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.spec.ts b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.spec.ts similarity index 99% rename from src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.spec.ts rename to src/app/components/shared/_dialogs/submit-comment/submit-comment.component.spec.ts index 0b5da7180021cfd25ad195e686dd9bead9444cab..730881f3daa422eb190a18e9dc1b3e73fbdd6d99 100644 --- a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.spec.ts +++ b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.spec.ts @@ -1,3 +1,4 @@ +/* import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { SubmitCommentComponent } from './submit-comment.component'; @@ -23,3 +24,4 @@ describe('SubmitCommentComponent', () => { expect(component).toBeTruthy(); }); }); +*/ diff --git a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.ts b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts similarity index 87% rename from src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.ts rename to src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts index 8560264538462093ec872957021b4319c0a2e546..1c6179372c6c3a428a9d688ae791aaf972532b12 100644 --- a/src/app/components/participant/_diaglogs/submit-comment/submit-comment.component.ts +++ b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts @@ -4,7 +4,7 @@ import { Router } from '@angular/router'; import { NotificationService } from '../../../../services/util/notification.service'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; -import { CommentCreatePageComponent } from '../../comment-create-page/comment-create-page.component'; +import { CommentPageComponent } from '../../comment-page/comment-page.component'; import { AuthenticationService } from '../../../../services/http/authentication.service'; @@ -19,7 +19,7 @@ export class SubmitCommentComponent implements OnInit { constructor(private router: Router, private notification: NotificationService, - public dialogRef: MatDialogRef<CommentCreatePageComponent>, + public dialogRef: MatDialogRef<CommentPageComponent>, private translateService: TranslateService, protected authenticationService: AuthenticationService, public dialog: MatDialog, diff --git a/src/app/components/participant/comment-create-page/comment-create-page.component.html b/src/app/components/shared/comment-page/comment-page.component.html similarity index 100% rename from src/app/components/participant/comment-create-page/comment-create-page.component.html rename to src/app/components/shared/comment-page/comment-page.component.html diff --git a/src/app/components/participant/comment-create-page/comment-create-page.component.scss b/src/app/components/shared/comment-page/comment-page.component.scss similarity index 100% rename from src/app/components/participant/comment-create-page/comment-create-page.component.scss rename to src/app/components/shared/comment-page/comment-page.component.scss diff --git a/src/app/components/participant/comment-create-page/comment-create-page.component.spec.ts b/src/app/components/shared/comment-page/comment-page.component.spec.ts similarity index 51% rename from src/app/components/participant/comment-create-page/comment-create-page.component.spec.ts rename to src/app/components/shared/comment-page/comment-page.component.spec.ts index 5db9a7cbab98cfbc030de539c2b687a12c506703..de9e0a549095b50aebd1bcd4d020a2a1b99510ca 100644 --- a/src/app/components/participant/comment-create-page/comment-create-page.component.spec.ts +++ b/src/app/components/shared/comment-page/comment-page.component.spec.ts @@ -1,20 +1,20 @@ /* import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { CommentCreatePageComponent } from './comment-create-page.component'; +import { CommentPageComponent } from './comment-page.component'; -describe('CommentCreatePageComponent', () => { - let component: CommentCreatePageComponent; - let fixture: ComponentFixture<CommentCreatePageComponent>; +describe('CommentPageComponent', () => { + let component: CommentPageComponent; + let fixture: ComponentFixture<CommentPageComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CommentCreatePageComponent ] + declarations: [ CommentPageComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(CommentCreatePageComponent); + fixture = TestBed.createComponent(CommentPageComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/components/participant/comment-create-page/comment-create-page.component.ts b/src/app/components/shared/comment-page/comment-page.component.ts similarity index 89% rename from src/app/components/participant/comment-create-page/comment-create-page.component.ts rename to src/app/components/shared/comment-page/comment-page.component.ts index d7bf0d24eec4f6eb42433627fcb41ec0f45555ad..a332193512462c55930ef464d6db19c43f42c36b 100644 --- a/src/app/components/participant/comment-create-page/comment-create-page.component.ts +++ b/src/app/components/shared/comment-page/comment-page.component.ts @@ -7,16 +7,16 @@ import { CommentService } from '../../../services/http/comment.service'; import { NotificationService } from '../../../services/util/notification.service'; import { AuthenticationService } from '../../../services/http/authentication.service'; import { User } from '../../../models/user'; -import { CommentListComponent } from '../../shared/comment-list/comment-list.component'; +import { CommentListComponent } from '../comment-list/comment-list.component'; import { MatDialog } from '@angular/material'; -import { SubmitCommentComponent } from '../_diaglogs/submit-comment/submit-comment.component'; +import { SubmitCommentComponent } from '../_dialogs/submit-comment/submit-comment.component'; @Component({ - selector: 'app-comment-create-page', - templateUrl: './comment-create-page.component.html', - styleUrls: ['./comment-create-page.component.scss'] + selector: 'app-comment-page', + templateUrl: './comment-page.component.html', + styleUrls: ['./comment-page.component.scss'] }) -export class CommentCreatePageComponent implements OnInit { +export class CommentPageComponent implements OnInit { @ViewChild(CommentListComponent) child: CommentListComponent; roomId: string; roomShortId: string; diff --git a/src/app/components/shared/shared.module.ts b/src/app/components/shared/shared.module.ts index 7370a65112733d2088832c348afd509a1aab15c6..4bb3e3c73924f38f7250a4a43e474c7427505715 100644 --- a/src/app/components/shared/shared.module.ts +++ b/src/app/components/shared/shared.module.ts @@ -11,7 +11,7 @@ import { RoomPageComponent } from './room-page/room-page.component'; import { StatisticsPageComponent } from './statistics-page/statistics-page.component'; import { AnswerEditComponent } from '../creator/_dialogs/answer-edit/answer-edit.component'; import { ContentDeleteComponent } from '../creator/_dialogs/content-delete/content-delete.component'; -import { CommentCreatePageComponent } from '../participant/comment-create-page/comment-create-page.component'; +import { CommentPageComponent } from './comment-page/comment-page.component'; import { EssentialsModule } from '../essentials/essentials.module'; import { SharedRoutingModule } from './shared-routing.module'; import { ListStatisticComponent } from './list-statistic/list-statistic.component'; @@ -22,6 +22,7 @@ import { RoomCreateComponent } from './_dialogs/room-create/room-create.componen import { LoginComponent } from './login/login.component'; import { StatisticHelpComponent } from './_dialogs/statistic-help/statistic-help.component'; import { CommentComponent } from './comment/comment.component'; +import {SubmitCommentComponent} from "./_dialogs/submit-comment/submit-comment.component"; @NgModule({ imports: [ @@ -42,7 +43,7 @@ import { CommentComponent } from './comment/comment.component'; FeedbackBarometerPageComponent, FooterComponent, FeedbackBarometerPageComponent, - CommentCreatePageComponent, + CommentPageComponent, CommentListComponent, StatisticsPageComponent, ListStatisticComponent, @@ -50,7 +51,8 @@ import { CommentComponent } from './comment/comment.component'; RoomCreateComponent, LoginComponent, StatisticHelpComponent, - CommentComponent + CommentComponent, + SubmitCommentComponent ], exports: [ RoomJoinComponent, @@ -64,14 +66,16 @@ import { CommentComponent } from './comment/comment.component'; FeedbackBarometerPageComponent, FooterComponent, FeedbackBarometerPageComponent, - CommentCreatePageComponent, + CommentPageComponent, CommentListComponent, - StatisticsPageComponent + StatisticsPageComponent, + SubmitCommentComponent ], entryComponents: [ RoomCreateComponent, LoginComponent, - StatisticHelpComponent + StatisticHelpComponent, + SubmitCommentComponent ] }) export class SharedModule {