From cadadb6cd7cbde3634fa65663db68670bdd2b68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Mon, 10 Dec 2018 14:02:58 +0100 Subject: [PATCH] Rename statistics-comoponent to 'statistics-page' --- src/app/components/creator/creator-routing.module.ts | 4 ++-- .../list-statistic/list-statistic.component.html | 2 +- src/app/components/shared/shared.module.ts | 8 +++++--- .../statistics-page.component.html} | 0 .../statistics-page.component.scss} | 0 .../statistics-page.component.spec.ts} | 12 ++++++------ .../statistics-page.component.ts} | 6 +++--- 7 files changed, 17 insertions(+), 15 deletions(-) rename src/app/components/shared/{statistics/statistics.component.html => statistics-page/statistics-page.component.html} (100%) rename src/app/components/shared/{statistics/statistics.component.scss => statistics-page/statistics-page.component.scss} (100%) rename src/app/components/shared/{statistics/statistics.component.spec.ts => statistics-page/statistics-page.component.spec.ts} (52%) rename src/app/components/shared/{statistics/statistics.component.ts => statistics-page/statistics-page.component.ts} (86%) diff --git a/src/app/components/creator/creator-routing.module.ts b/src/app/components/creator/creator-routing.module.ts index cd09cdd33..81b92a64e 100644 --- a/src/app/components/creator/creator-routing.module.ts +++ b/src/app/components/creator/creator-routing.module.ts @@ -5,7 +5,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 { ContentCreatePageComponent } from './content-create-page/content-create-page.component'; -import { StatisticsComponent } from '../shared/statistics/statistics.component'; +import { StatisticsPageComponent } from '../shared/statistics-page/statistics-page.component'; import { CommentListComponent } from '../shared/comment-list/comment-list.component'; import { FeedbackBarometerPageComponent } from '../shared/feedback-barometer-page/feedback-barometer-page.component'; import { ContentListComponent } from './content-list/content-list.component'; @@ -31,7 +31,7 @@ const routes: Routes = [ }, { path: 'room/:roomId/statistics', - component: StatisticsComponent, + component: StatisticsPageComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } }, diff --git a/src/app/components/shared/list-statistic/list-statistic.component.html b/src/app/components/shared/list-statistic/list-statistic.component.html index 5c327e230..91b94d2d7 100644 --- a/src/app/components/shared/list-statistic/list-statistic.component.html +++ b/src/app/components/shared/list-statistic/list-statistic.component.html @@ -4,7 +4,7 @@ <mat-progress-bar class="progress-theme" mode="determinate" value="{{total}}" *ngIf="total < status.good && total >= status.okay" color="accent"></mat-progress-bar> <mat-progress-bar class="progress-theme" mode="determinate" value="{{total}}" - *ngIf="total < status.okay && total > status.empty" color="warn"></mat-progress-bar> + *ngIf="total < status.okay && total >= status.empty" color="warn"></mat-progress-bar> <mat-toolbar></mat-toolbar> <table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> diff --git a/src/app/components/shared/shared.module.ts b/src/app/components/shared/shared.module.ts index d15a30939..738ea138d 100644 --- a/src/app/components/shared/shared.module.ts +++ b/src/app/components/shared/shared.module.ts @@ -10,7 +10,7 @@ import { PageNotFoundComponent } from './page-not-found/page-not-found.component import { RoomJoinComponent } from './room-join/room-join.component'; import { RoomListComponent } from './room-list/room-list.component'; import { RoomPageComponent } from './room-page/room-page.component'; -import { StatisticsComponent } from './statistics/statistics.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 { MarkdownHelpDialogComponent } from '../creator/_dialogs/markdown-help-dialog/markdown-help-dialog.component'; @@ -19,11 +19,13 @@ import { CommentCreatePageComponent } from '../participant/comment-create-page/c import { EssentialsModule } from '../essentials/essentials.module'; import { SharedRoutingModule } from './shared-routing.module'; import { ListStatisticComponent } from './list-statistic/list-statistic.component'; +import { ChartsModule } from 'ng2-charts'; @NgModule({ imports: [ CommonModule, EssentialsModule, + ChartsModule, SharedRoutingModule ], declarations: [ @@ -43,7 +45,7 @@ import { ListStatisticComponent } from './list-statistic/list-statistic.componen FeedbackBarometerPageComponent, CommentCreatePageComponent, CommentListComponent, - StatisticsComponent, + StatisticsPageComponent, ListStatisticComponent ], exports: [ @@ -63,7 +65,7 @@ import { ListStatisticComponent } from './list-statistic/list-statistic.componen FeedbackBarometerPageComponent, CommentCreatePageComponent, CommentListComponent, - StatisticsComponent + StatisticsPageComponent ], entryComponents: [ MarkdownHelpDialogComponent, diff --git a/src/app/components/shared/statistics/statistics.component.html b/src/app/components/shared/statistics-page/statistics-page.component.html similarity index 100% rename from src/app/components/shared/statistics/statistics.component.html rename to src/app/components/shared/statistics-page/statistics-page.component.html diff --git a/src/app/components/shared/statistics/statistics.component.scss b/src/app/components/shared/statistics-page/statistics-page.component.scss similarity index 100% rename from src/app/components/shared/statistics/statistics.component.scss rename to src/app/components/shared/statistics-page/statistics-page.component.scss diff --git a/src/app/components/shared/statistics/statistics.component.spec.ts b/src/app/components/shared/statistics-page/statistics-page.component.spec.ts similarity index 52% rename from src/app/components/shared/statistics/statistics.component.spec.ts rename to src/app/components/shared/statistics-page/statistics-page.component.spec.ts index 30693b4f6..b4458552f 100644 --- a/src/app/components/shared/statistics/statistics.component.spec.ts +++ b/src/app/components/shared/statistics-page/statistics-page.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { StatisticsComponent } from './statistics.component'; +import { StatisticsPageComponent } from './statistics-page.component'; -describe('StatisticsComponent', () => { - let component: StatisticsComponent; - let fixture: ComponentFixture<StatisticsComponent>; +describe('StatisticsPageComponent', () => { + let component: StatisticsPageComponent; + let fixture: ComponentFixture<StatisticsPageComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StatisticsComponent ] + declarations: [ StatisticsPageComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(StatisticsComponent); + fixture = TestBed.createComponent(StatisticsPageComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/components/shared/statistics/statistics.component.ts b/src/app/components/shared/statistics-page/statistics-page.component.ts similarity index 86% rename from src/app/components/shared/statistics/statistics.component.ts rename to src/app/components/shared/statistics-page/statistics-page.component.ts index 09f682bb7..876d81df0 100644 --- a/src/app/components/shared/statistics/statistics.component.ts +++ b/src/app/components/shared/statistics-page/statistics-page.component.ts @@ -8,11 +8,11 @@ import { LanguageService } from '../../../services/util/language.service'; @Component({ selector: 'app-statistics', - templateUrl: './statistics.component.html', - styleUrls: ['./statistics.component.scss'] + templateUrl: './statistics-page.component.html', + styleUrls: ['./statistics-page.component.scss'] }) -export class StatisticsComponent implements OnInit { +export class StatisticsPageComponent implements OnInit { room: Room; contentGroups: ContentGroup[]; -- GitLab