From ac99fbc74c0322eaa50a6bb510124714c72aa070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Fri, 11 Jun 2021 15:21:50 +0200 Subject: [PATCH] chore(cookie-policy): reactivate the cookie policy banner (DSP-1727) (#461) * chore(cookie-policy): reactivate the cookie policy banner (DSP-1727) * fix(cookie-policy): bug fix in cookie policy link * chore(cookie-policy): better sentence --- src/app/app.component.html | 12 +++++++ src/app/app.component.scss | 28 +++++++++++++++ src/app/app.component.ts | 19 ++++++++++- .../cookie-policy.component.scss | 3 ++ src/app/main/main.component.html | 13 +------ src/app/main/main.component.scss | 34 ------------------- src/app/main/main.component.ts | 9 ----- 7 files changed, 62 insertions(+), 56 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 39f2d8557a..f4fc623999 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -8,4 +8,16 @@ + + diff --git a/src/app/app.component.scss b/src/app/app.component.scss index e69de29bb2..a1c56f6c16 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -0,0 +1,28 @@ +@import "../assets/style/theme"; + + +.cookie-banner { + position: fixed; + bottom: 0; + height: 128px; + width: 100%; + background: rgba(0, 0, 0, 0.75); + color: #fff; + z-index: 100; + // display: inline-flex; + padding: 24px 0; + + .note { + text-align: center; + + .link { + color: $accent; + text-decoration: underline; + } + } + + .action button { + margin: 0 auto 24px auto; + display: block; + } +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f8006a625e..ffccdf73fe 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; +import { Router } from '@angular/router'; @Component({ selector: 'app-root', @@ -8,10 +9,13 @@ import { Title } from '@angular/platform-browser'; }) export class AppComponent implements OnInit { + showCookieBanner = true; session = false; constructor( - private _titleService: Title) { + private _router: Router, + private _titleService: Title + ) { // set the page title this._titleService.setTitle('DaSCH Service Platform'); @@ -19,6 +23,19 @@ export class AppComponent implements OnInit { } ngOnInit() { + if (sessionStorage.getItem('cookieBanner') === null) { + sessionStorage.setItem('cookieBanner', JSON.stringify(this.showCookieBanner)); + } else { + this.showCookieBanner = JSON.parse(sessionStorage.getItem('cookieBanner')); + } + } + + goToCookiePolicy() { + this._router.navigate(['cookie-policy']); + } + closeCookieBanner() { + this.showCookieBanner = !this.showCookieBanner; + sessionStorage.setItem('cookieBanner', JSON.stringify(this.showCookieBanner)); } } diff --git a/src/app/main/cookie-policy/cookie-policy.component.scss b/src/app/main/cookie-policy/cookie-policy.component.scss index e69de29bb2..eb1705dc77 100644 --- a/src/app/main/cookie-policy/cookie-policy.component.scss +++ b/src/app/main/cookie-policy/cookie-policy.component.scss @@ -0,0 +1,3 @@ +.content.large.middle { + padding-bottom: 196px; +} diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html index bad545bd8a..12e78f0771 100644 --- a/src/app/main/main.component.html +++ b/src/app/main/main.component.html @@ -1,17 +1,6 @@
- +
diff --git a/src/app/main/main.component.scss b/src/app/main/main.component.scss index a266b183be..9fed8daecd 100644 --- a/src/app/main/main.component.scss +++ b/src/app/main/main.component.scss @@ -74,32 +74,6 @@ section { } } -.cookie-banner { - position: fixed; - bottom: 0; - height: 128px; - width: 100%; - background: rgba(0, 0, 0, 0.75); - color: #fff; - z-index: 100; - // display: inline-flex; - padding: 24px 0; - - .note { - text-align: center; - - a { - color: inherit; - text-decoration: underline; - } - } - - .action button { - margin: 0 auto 24px auto; - display: block; - } -} - .app-headline { line-height: 1.5; letter-spacing: 2px; @@ -119,14 +93,6 @@ section { height: 140px; } - .help-page, - .landing-page { - .features, - .projects { - // width: calc(100% - 16px); - } - } - .research { .content-research { padding: 16px 0 1px 0 !important; diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index bd74c2197a..9e0cb480da 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -84,11 +84,6 @@ export class MainComponent implements OnInit { } ngOnInit() { - if (sessionStorage.getItem('cookieBanner') === null) { - sessionStorage.setItem('cookieBanner', JSON.stringify(this.showCookieBanner)); - } else { - this.showCookieBanner = JSON.parse(sessionStorage.getItem('cookieBanner')); - } this.loadProjects(); } @@ -127,8 +122,4 @@ export class MainComponent implements OnInit { ); } - closeCookieBanner() { - this.showCookieBanner = !this.showCookieBanner; - sessionStorage.setItem('cookieBanner', JSON.stringify(this.showCookieBanner)); - } }