Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cookie-policy): reactivate the cookie policy banner (DSP-1727) #461

Merged
merged 3 commits into from Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/app/app.component.html
Expand Up @@ -8,4 +8,16 @@
<router-outlet></router-outlet>
</div>

<!-- cookie information banner -->
<div class="cookie-banner" *ngIf="showCookieBanner">
<p class="note">
This web-application uses cookies to provide you with great user experience. By using the application you
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a greater user experience

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewritten in fd2ecf2

accept our <span class="link" (click)="goToCookiePolicy()">use of cookies</span>.
</p>
<div class="action">
<button mat-flat-button color="accent" (click)="closeCookieBanner()">
ACCEPT
</button>
</div>
</div>
</div>
28 changes: 28 additions & 0 deletions 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;
}
}
19 changes: 18 additions & 1 deletion 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',
Expand All @@ -8,17 +9,33 @@ 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');

}

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));
}
}
3 changes: 3 additions & 0 deletions src/app/main/cookie-policy/cookie-policy.component.scss
@@ -0,0 +1,3 @@
.content.large.middle {
padding-bottom: 196px;
}
13 changes: 1 addition & 12 deletions src/app/main/main.component.html
@@ -1,17 +1,6 @@
<!-- show landing page in case of guest user -->
<div class="landing-page">
<div class="cookie-banner" *ngIf="showCookieBanner">
<p class="note">
This web-application uses cookies to provide you with great user experience. By using the application you
accept our
<a href="./cookie-policy">use of cookies</a>.
</p>
<div class="action">
<button mat-flat-button color="accent" (click)="closeCookieBanner()">
ACCEPT
</button>
</div>
</div>

<!-- introduction: headline, info and parallax background image -->
<section class="intro parallax-wrapper bg-1">
<div class="parallax-curtain">
Expand Down
34 changes: 0 additions & 34 deletions src/app/main/main.component.scss
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions src/app/main/main.component.ts
Expand Up @@ -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();
}

Expand Down Expand Up @@ -127,8 +122,4 @@ export class MainComponent implements OnInit {
);
}

closeCookieBanner() {
this.showCookieBanner = !this.showCookieBanner;
sessionStorage.setItem('cookieBanner', JSON.stringify(this.showCookieBanner));
}
}