From 2ed5e8ea6b249e223c194b6721641eff08332067 Mon Sep 17 00:00:00 2001
From: Julia Langhammer <julia.langhammer@mni.thm.de>
Date: Wed, 4 Sep 2019 21:22:15 +0200
Subject: [PATCH] Add data-protection page, update scss-file for imprint page,
 refactor code in footer.component.ts

---
 src/app/app-routing.module.ts                 |  5 +++
 src/app/app.module.ts                         |  4 ++-
 .../data-protection.component.html            |  8 +++++
 .../data-protection.component.scss            | 12 +++++++
 .../data-protection.component.spec.ts         | 25 +++++++++++++
 .../data-protection.component.ts              | 22 ++++++++++++
 .../_dialogs/imprint/imprint.component.scss   | 12 +++++++
 .../shared/footer/footer.component.html       |  2 +-
 .../shared/footer/footer.component.ts         | 35 +++++++++++++------
 9 files changed, 112 insertions(+), 13 deletions(-)
 create mode 100644 src/app/components/home/_dialogs/data-protection/data-protection.component.html
 create mode 100644 src/app/components/home/_dialogs/data-protection/data-protection.component.scss
 create mode 100644 src/app/components/home/_dialogs/data-protection/data-protection.component.spec.ts
 create mode 100644 src/app/components/home/_dialogs/data-protection/data-protection.component.ts

diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index a091f8993..bccb83f00 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -4,6 +4,7 @@ import { PageNotFoundComponent } from './components/shared/page-not-found/page-n
 import { HomePageComponent } from './components/home/home-page/home-page.component';
 import { UserHomeComponent } from './components/home/user-home/user-home.component';
 import { ImprintComponent } from './components/home/_dialogs/imprint/imprint.component';
+import { DataProtectionComponent } from './components/home/_dialogs/data-protection/data-protection.component';
 
 const routes: Routes = [
   {
@@ -23,6 +24,10 @@ const routes: Routes = [
     path: 'imprint',
     component: ImprintComponent
   },
+  {
+    path: 'data-protection',
+    component: DataProtectionComponent
+  },
   {
     path: 'creator',
     loadChildren: './components/creator/creator.module#CreatorModule'
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 5a7b7a00d..be9f4805a 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -43,6 +43,7 @@ import { HomeParticipantPageComponent } from './components/home/home-participant
 import { CommentSettingsService } from './services/http/comment-settings.service';
 import { ModeratorModule } from './components/moderator/moderator.module';
 import { ImprintComponent } from './components/home/_dialogs/imprint/imprint.component';
+import { DataProtectionComponent } from './components/home/_dialogs/data-protection/data-protection.component';
 
 export function dialogClose(dialogResult: any) {
 }
@@ -63,7 +64,8 @@ export function initializeApp(appConfig: AppConfig) {
     UserHomeComponent,
     HomeCreatorPageComponent,
     HomeParticipantPageComponent,
-    ImprintComponent
+    ImprintComponent,
+    DataProtectionComponent
   ],
   entryComponents: [
     RegisterComponent,
diff --git a/src/app/components/home/_dialogs/data-protection/data-protection.component.html b/src/app/components/home/_dialogs/data-protection/data-protection.component.html
new file mode 100644
index 000000000..7d50cf4e7
--- /dev/null
+++ b/src/app/components/home/_dialogs/data-protection/data-protection.component.html
@@ -0,0 +1,8 @@
+<div>
+
+  <p>
+    data-protection works!
+  </p>
+
+
+</div>
diff --git a/src/app/components/home/_dialogs/data-protection/data-protection.component.scss b/src/app/components/home/_dialogs/data-protection/data-protection.component.scss
new file mode 100644
index 000000000..33009b54e
--- /dev/null
+++ b/src/app/components/home/_dialogs/data-protection/data-protection.component.scss
@@ -0,0 +1,12 @@
+h1 {
+  font-size: 2em;
+}
+
+h2 {
+  font-size: large;
+}
+
+div {
+  font-family: Roboto, "Helvetica Neue", sans-serif;
+  color: var(--on-surface);
+}
diff --git a/src/app/components/home/_dialogs/data-protection/data-protection.component.spec.ts b/src/app/components/home/_dialogs/data-protection/data-protection.component.spec.ts
new file mode 100644
index 000000000..844334451
--- /dev/null
+++ b/src/app/components/home/_dialogs/data-protection/data-protection.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DataProtectionComponent } from './data-protection.component';
+
+describe('DataProtectionComponent', () => {
+  let component: DataProtectionComponent;
+  let fixture: ComponentFixture<DataProtectionComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ DataProtectionComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(DataProtectionComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/src/app/components/home/_dialogs/data-protection/data-protection.component.ts b/src/app/components/home/_dialogs/data-protection/data-protection.component.ts
new file mode 100644
index 000000000..2d4650b68
--- /dev/null
+++ b/src/app/components/home/_dialogs/data-protection/data-protection.component.ts
@@ -0,0 +1,22 @@
+import { Component, OnInit } from '@angular/core';
+import { Location } from '@angular/common';
+
+@Component({
+  selector: 'app-data-protection',
+  templateUrl: './data-protection.component.html',
+  styleUrls: ['./data-protection.component.scss']
+})
+export class DataProtectionComponent implements OnInit {
+
+  deviceType: string;
+
+  constructor(private location: Location) { }
+
+  ngOnInit() {
+  }
+
+  goBack() {
+    this.location.back();
+  }
+
+}
diff --git a/src/app/components/home/_dialogs/imprint/imprint.component.scss b/src/app/components/home/_dialogs/imprint/imprint.component.scss
index e69de29bb..33009b54e 100644
--- a/src/app/components/home/_dialogs/imprint/imprint.component.scss
+++ b/src/app/components/home/_dialogs/imprint/imprint.component.scss
@@ -0,0 +1,12 @@
+h1 {
+  font-size: 2em;
+}
+
+h2 {
+  font-size: large;
+}
+
+div {
+  font-family: Roboto, "Helvetica Neue", sans-serif;
+  color: var(--on-surface);
+}
diff --git a/src/app/components/shared/footer/footer.component.html b/src/app/components/shared/footer/footer.component.html
index 34e2b55d8..9234d42b3 100644
--- a/src/app/components/shared/footer/footer.component.html
+++ b/src/app/components/shared/footer/footer.component.html
@@ -30,7 +30,7 @@
     </button>
 
     <span class="fill-remaining-space"></span>
-    <button mat-button (click)="navToDSGVO()">
+    <button mat-button routerLink="/data-protection">
       <mat-icon>security</mat-icon>
       <span *ngIf="deviceType === 'desktop'">
         {{ 'footer.dsgvo' | translate}}
diff --git a/src/app/components/shared/footer/footer.component.ts b/src/app/components/shared/footer/footer.component.ts
index d9c0d1b12..81087824a 100644
--- a/src/app/components/shared/footer/footer.component.ts
+++ b/src/app/components/shared/footer/footer.component.ts
@@ -9,7 +9,8 @@ import { User } from '../../../models/user';
 import { Room } from '../../../models/room';
 import { DemoVideoComponent } from '../../home/_dialogs/demo-video/demo-video.component';
 import { ThemeService } from '../../../../theme/theme.service';
-import { ImprintComponent } from 'app/components/home/_dialogs/imprint/imprint.component';
+import { ImprintComponent } from '../../home/_dialogs/imprint/imprint.component';
+import { DataProtectionComponent } from '../../home/_dialogs/data-protection/data-protection.component';
 
 @Component({
   selector: 'app-footer',
@@ -62,6 +63,7 @@ export class FooterComponent implements OnInit {
     });
   }
 
+  // check if still needed
   navToDSGVO() {
     this.translateService.get('footer.will-open').subscribe(message => {
       this.translateService.get('footer.dsgvo').subscribe(what => {
@@ -77,6 +79,17 @@ export class FooterComponent implements OnInit {
     });
   }
 
+  showDSGVO() {
+    const dialogRef = this.dialog.open(DataProtectionComponent, {
+      maxWidth: '100vw',
+      maxHeight: '100vh',
+      height: '95%',
+      width: '50%'
+    });
+    dialogRef.componentInstance.deviceType = this.deviceType;
+  }
+
+  // check if still needed
   navToImprint() {
     this.translateService.get('footer.will-open').subscribe(message => {
       this.translateService.get('footer.imprint').subscribe(what => {
@@ -92,6 +105,16 @@ export class FooterComponent implements OnInit {
     });
   }
 
+  showImprint() {
+    const dialogRef = this.dialog.open(ImprintComponent, {
+      maxWidth: '100vw',
+      maxHeight: '100vh',
+      height: '95%',
+      width: '50%'
+    });
+    dialogRef.componentInstance.deviceType = this.deviceType;
+  }
+
   showDemo() {
     const dialogRef = this.dialog.open(DemoVideoComponent, {
       position: {
@@ -106,16 +129,6 @@ export class FooterComponent implements OnInit {
     dialogRef.componentInstance.deviceType = this.deviceType;
   }
 
-  showImprint() {
-    const dialogRef = this.dialog.open(ImprintComponent, {
-      maxWidth: '100vw',
-      maxHeight: '100vh',
-      height: '95%',
-      width: '50%'
-    });
-    dialogRef.componentInstance.deviceType = this.deviceType;
-  }
-
   useLanguage(language: string) {
     this.translateService.use(language);
     localStorage.setItem('currentLang', language);
-- 
GitLab