diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 04c43e13e81eb8b09258b8483e7263044df47fd8..66888b24f38b2f89bfe3e592773cf8ffd0b5fe3c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,7 +3,7 @@ import { RouterModule, Routes } from '@angular/router'; import { PageNotFoundComponent } from './components/pages/page-not-found/page-not-found.component'; import { LoginScreenComponent } from './components/pages/login-screen/login-screen.component'; import { CreatorHomeScreenComponent } from './components/pages/creator-home-screen/creator-home-screen.component'; -import { CreateCommentComponent } from './components/pages/create-comment/create-comment.component'; +import { CreateCommentComponent } from './components/pages/comment-create/comment-create.component'; import { ParticipantHomeScreenComponent } from './components/pages/participant-home-screen/participant-home-screen.component'; import { AuthenticationGuard } from './guards/authentication.guard'; import { UserRole } from './models/user-roles.enum'; @@ -11,7 +11,6 @@ import { ParticipantRoomComponent } from './components/pages/participant-room/pa import { CreatorRoomComponent } from './components/pages/creator-room/creator-room.component'; import { CommentListComponent } from './components/fragments/comment-list/comment-list.component'; import { ContentListComponent } from './components/fragments/content-list/content-list.component'; -import { ContentDetailComponent } from './components/pages/content-detail/content-detail.component'; import { AnswerStatisticsComponent } from './components/fragments/statistics/statistics.component'; import { AddContentComponent } from './components/pages/content-create/content-create.component'; import { @@ -64,12 +63,6 @@ const routes: Routes = [ canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, - { - path: 'creator/room/:roomId/content/:contentId', - component: ContentDetailComponent, - canActivate: [AuthenticationGuard], - data: { roles: [UserRole.CREATOR] } - }, { path: 'participant', component: ParticipantHomeScreenComponent, @@ -83,7 +76,7 @@ const routes: Routes = [ data: { roles: [UserRole.PARTICIPANT] } }, { - path: 'participant/room/:roomId/create-comment', + path: 'participant/room/:roomId/comment-create', component: CreateCommentComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.PARTICIPANT] } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 63086f6e66be969b3e1f86df5464da82e83090b9..f7e45e691667281b7a7db14c59ce371d16f42442 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -57,7 +57,7 @@ import { AuthenticationGuard } from './guards/authentication.guard'; import { RoomService } from './services/http/room.service'; import { RoomListComponent } from './components/fragments/room-list/room-list.component'; import { CreatorHomeScreenComponent } from './components/pages/creator-home-screen/creator-home-screen.component'; -import { CreateCommentComponent } from './components/pages/create-comment/create-comment.component'; +import { CreateCommentComponent } from './components/pages/comment-create/comment-create.component'; import { CommentService } from './services/http/comment.service'; import { ParticipantHomeScreenComponent } from './components/pages/participant-home-screen/participant-home-screen.component'; import { ParticipantRoomComponent } from './components/pages/participant-room/participant-room.component'; diff --git a/src/app/components/pages/create-comment/create-comment.component.html b/src/app/components/pages/comment-create/comment-create.component.html similarity index 100% rename from src/app/components/pages/create-comment/create-comment.component.html rename to src/app/components/pages/comment-create/comment-create.component.html diff --git a/src/app/components/pages/create-comment/create-comment.component.scss b/src/app/components/pages/comment-create/comment-create.component.scss similarity index 100% rename from src/app/components/pages/create-comment/create-comment.component.scss rename to src/app/components/pages/comment-create/comment-create.component.scss diff --git a/src/app/components/pages/create-comment/create-comment.component.spec.ts b/src/app/components/pages/comment-create/comment-create.component.spec.ts similarity index 90% rename from src/app/components/pages/create-comment/create-comment.component.spec.ts rename to src/app/components/pages/comment-create/comment-create.component.spec.ts index eccf5fa7e4462f47147ab1b407667a1a5327b696..c1d8c5d74f09d94785ec1a114f5767a508676c2c 100644 --- a/src/app/components/pages/create-comment/create-comment.component.spec.ts +++ b/src/app/components/pages/comment-create/comment-create.component.spec.ts @@ -1,6 +1,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { CreateCommentComponent } from './create-comment.component'; +import { CreateCommentComponent } from './comment-create.component'; describe('CreateCommentComponent', () => { let component: CreateCommentComponent; diff --git a/src/app/components/pages/create-comment/create-comment.component.ts b/src/app/components/pages/comment-create/comment-create.component.ts similarity index 95% rename from src/app/components/pages/create-comment/create-comment.component.ts rename to src/app/components/pages/comment-create/comment-create.component.ts index a16daeccea51abe9a923c5e583ef145bd9255a93..9351a4cdf71b16eb751ba35f2407e190999c3434 100644 --- a/src/app/components/pages/create-comment/create-comment.component.ts +++ b/src/app/components/pages/comment-create/comment-create.component.ts @@ -12,8 +12,8 @@ import { CommentListComponent } from '../../fragments/comment-list/comment-list. @Component({ selector: 'app-create-comment', - templateUrl: './create-comment.component.html', - styleUrls: ['./create-comment.component.scss'] + templateUrl: './comment-create.component.html', + styleUrls: ['./comment-create.component.scss'] }) export class CreateCommentComponent implements OnInit { @ViewChild(CommentListComponent) child: CommentListComponent; diff --git a/src/app/components/pages/content-create/content-create.component.ts b/src/app/components/pages/content-create/content-create.component.ts index 4138f52ef648ff740c97590f4e6ef5fe74f159ad..1b62ef10dfdbda27739dbf2c3c9b8f7c7bf00cf3 100644 --- a/src/app/components/pages/content-create/content-create.component.ts +++ b/src/app/components/pages/content-create/content-create.component.ts @@ -11,5 +11,4 @@ export class AddContentComponent implements OnInit { ngOnInit() { } - } diff --git a/src/app/components/pages/content-detail/content-detail.component.html b/src/app/components/pages/content-detail/content-detail.component.html deleted file mode 100644 index 4e68b015b3d96654881ca18de04b262e651ba43d..0000000000000000000000000000000000000000 --- a/src/app/components/pages/content-detail/content-detail.component.html +++ /dev/null @@ -1,34 +0,0 @@ -<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill> - <div *ngIf="content" fxLayout="row" fxLayoutAlign="center"> - <mat-card> - <mat-card-header> - <mat-card-title> - <h3 class="subheading-2">{{content.subject}}</h3> - </mat-card-title> - <mat-card-subtitle>ID: {{ content.contentId }} - <br> Round: {{ content.round }}</mat-card-subtitle> - </mat-card-header> - <mat-divider></mat-divider> - <mat-card-content> - <p> - {{ content.body }} - </p> - <mat-divider></mat-divider> - <div> - <app-content-answers-list></app-content-answers-list> - </div> - </mat-card-content> - <mat-divider></mat-divider> - <!-- answes list here --> - <mat-card-actions> - <button mat-button color="primary" matTooltip="Create new content" routerLink="/creator/room/{{content.contentId}}/content-creation"> - Create answer - </button> - <button mat-button color="warn" matTooltip="Delete selected answer"> - <!-- on click, add a 'x' on the right end of each answer to make it deletable --> - Delete answer - </button> - </mat-card-actions> - </mat-card> - </div> -</div> diff --git a/src/app/components/pages/content-detail/content-detail.component.scss b/src/app/components/pages/content-detail/content-detail.component.scss deleted file mode 100644 index 78348d75ebc905c70ce1c8c0e6b0596305491911..0000000000000000000000000000000000000000 --- a/src/app/components/pages/content-detail/content-detail.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -mat-card { - max-width: 800px; -} - -mat-card-content > :first-child { - margin-top: 16px; -} - \ No newline at end of file diff --git a/src/app/components/pages/content-detail/content-detail.component.spec.ts b/src/app/components/pages/content-detail/content-detail.component.spec.ts deleted file mode 100644 index 00c63bd7d7ddfeacfa0920a868069c46f44186f8..0000000000000000000000000000000000000000 --- a/src/app/components/pages/content-detail/content-detail.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ContentDetailComponent } from './content-detail.component'; - -describe('ContentDetailComponent', () => { - let component: ContentDetailComponent; - let fixture: ComponentFixture<ContentDetailComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ContentDetailComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ContentDetailComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/pages/content-detail/content-detail.component.ts b/src/app/components/pages/content-detail/content-detail.component.ts deleted file mode 100644 index 966d225a34b20008d2ef5c11aac218b20dc1155a..0000000000000000000000000000000000000000 --- a/src/app/components/pages/content-detail/content-detail.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Content } from '../../../models/content'; -import { ContentService } from '../../../services/http/content.service'; -import { ActivatedRoute } from '@angular/router'; - -@Component({ - selector: 'app-content-detail', - templateUrl: './content-detail.component.html', - styleUrls: ['./content-detail.component.scss'] -}) -export class ContentDetailComponent implements OnInit { - content: Content = null; - - constructor( - private contentService: ContentService, - private route: ActivatedRoute - ) {} - - ngOnInit() { - this.route.params.subscribe(params => { - this.getContent(params['contentId']); - }); - } - - getContent(contentId: string): void { - this.contentService.getContent(contentId) - .subscribe(content => this.content = content[0]); - } -}