diff --git a/src/app/components/pages/comment-create-page/comment-create-page.component.html b/src/app/components/pages/comment-create-page/comment-create-page.component.html index b27e4dff450a58ea11a6b3290b849b58a1e881c0..e897654f004ef247839c2dd421225cb23ea9f023 100644 --- a/src/app/components/pages/comment-create-page/comment-create-page.component.html +++ b/src/app/components/pages/comment-create-page/comment-create-page.component.html @@ -13,8 +13,5 @@ <button mat-raised-button color="primary" (click)="send(commentSubject.value, commentBody.value)">Send</button> </form> </div> - <div fxLayout="row" fxLayoutAlign="center"> - <app-comment-list></app-comment-list> - </div> </div> diff --git a/src/app/components/pages/comment-create-page/comment-create-page.component.scss b/src/app/components/pages/comment-create-page/comment-create-page.component.scss index 4f2d9ebe54123d95a7e61e3dc185d7c3b2213e67..0ca4a4971d6f02fba366e5d74b2233c196a38c70 100644 --- a/src/app/components/pages/comment-create-page/comment-create-page.component.scss +++ b/src/app/components/pages/comment-create-page/comment-create-page.component.scss @@ -4,8 +4,3 @@ form { max-width: 800px; margin-bottom: 50px; } - -app-comment-list { - width: 100%; - max-width: 800px; -} diff --git a/src/app/components/pages/comment-create-page/comment-create-page.component.ts b/src/app/components/pages/comment-create-page/comment-create-page.component.ts index 0df47cf0898d5c8a6ac416a20c15f6179f62b953..f5cae7e27c2b9d222ee74fc6fc3a8aade96f8c35 100644 --- a/src/app/components/pages/comment-create-page/comment-create-page.component.ts +++ b/src/app/components/pages/comment-create-page/comment-create-page.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, ViewChild } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Location } from '@angular/common'; import { Room } from '../../../models/room'; @@ -6,9 +6,6 @@ import { Comment } from '../../../models/comment'; import { RoomService } from '../../../services/http/room.service'; 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 '../../fragments/comment-list/comment-list.component'; @Component({ selector: 'app-comment-create-page', @@ -16,12 +13,9 @@ import { CommentListComponent } from '../../fragments/comment-list/comment-list. styleUrls: ['./comment-create-page.component.scss'] }) export class CommentCreatePageComponent implements OnInit { - @ViewChild(CommentListComponent) child: CommentListComponent; @Input() room: Room; - user: User; constructor( - protected authenticationService: AuthenticationService, private route: ActivatedRoute, private roomService: RoomService, private commentService: CommentService, @@ -29,7 +23,6 @@ export class CommentCreatePageComponent implements OnInit { private notification: NotificationService) { } ngOnInit(): void { - this.user = this.authenticationService.getUser(); this.route.params.subscribe(params => { this.getRoom(params['roomId']); }); @@ -46,14 +39,11 @@ export class CommentCreatePageComponent implements OnInit { return; } this.commentService.addComment({ - id: '', roomId: this.room.id, - userId: this.user.id, subject: subject, body: body, creationTimestamp: new Date(Date.now()) } as Comment).subscribe(() => { - this.child.getComments(this.room.id); this.notification.show(`Comment '${subject}' successfully created.`); }); } diff --git a/src/app/models/comment.ts b/src/app/models/comment.ts index ed636d119cf2032562b9c8ac0d958b6c24ece93d..d16510a5b082ca39a0c4fe26461fbe5cb7573423 100644 --- a/src/app/models/comment.ts +++ b/src/app/models/comment.ts @@ -1,7 +1,6 @@ export class Comment { id: string; roomId: string; - userId: string; revision: string; subject: string; body: string;