Skip to content
Snippets Groups Projects
Commit 21e530a7 authored by Sebastian Wittek's avatar Sebastian Wittek
Browse files

outsource comment-page

parent e44430ed
No related merge requests found
Showing
with 76 additions and 32 deletions
<div fxLayout="row" fxLayoutAlign="center">
<app-comment-list></app-comment-list>
</div>
<app-comment-page></app-comment-page>
<app-comment-page></app-comment-page>
/*
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();
});
});
*/
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() {
}
}
......@@ -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] }
},
......
......@@ -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 {
......
......@@ -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>
......
/*
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SubmitCommentComponent } from './submit-comment.component';
......@@ -23,3 +24,4 @@ describe('SubmitCommentComponent', () => {
expect(component).toBeTruthy();
});
});
*/
......@@ -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,
......
/* 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();
});
......
......@@ -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;
......
......@@ -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 {
......
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