GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 5cfc467c authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel

Merge branch '142-rework-the-cookie-and-privacy-agreement' into 'master'

Allow the user to use only if he has accepted cookies and privacy protection

Closes #142

See merge request frag.jetzt!147
parents 8a91abc2 fbb23169
...@@ -30,7 +30,8 @@ export class CookiesComponent implements OnInit { ...@@ -30,7 +30,8 @@ export class CookiesComponent implements OnInit {
acceptCookies() { acceptCookies() {
localStorage.setItem('cookieAccepted', 'true'); localStorage.setItem('cookieAccepted', 'true');
this.dialogRef.close(); localStorage.setItem('dataProtectionConsent', 'true');
this.dialogRef.close(true);
setTimeout( () => { setTimeout( () => {
document.getElementById('live_announcer-button').focus(); document.getElementById('live_announcer-button').focus();
}, 500); }, 500);
...@@ -39,7 +40,7 @@ export class CookiesComponent implements OnInit { ...@@ -39,7 +40,7 @@ export class CookiesComponent implements OnInit {
exitApp() { exitApp() {
localStorage.setItem('cookieAccepted', 'false'); localStorage.setItem('cookieAccepted', 'false');
// TODO somehow exit the app, since the user didn't accept cookie usage // TODO somehow exit the app, since the user didn't accept cookie usage
this.dialogRef.close(true); this.dialogRef.close(false);
} }
openDataProtection() { openDataProtection() {
......
...@@ -25,7 +25,7 @@ export class DataProtectionComponent implements OnInit { ...@@ -25,7 +25,7 @@ export class DataProtectionComponent implements OnInit {
accept() { accept() {
this.dataProtectionConsent(true); this.dataProtectionConsent(true);
this.dialogRef.close(); this.dialogRef.close(true);
} }
decline() { decline() {
...@@ -40,7 +40,7 @@ export class DataProtectionComponent implements OnInit { ...@@ -40,7 +40,7 @@ export class DataProtectionComponent implements OnInit {
} else { // otherwise: go there } else { // otherwise: go there
this.router.navigate(['/home']); this.router.navigate(['/home']);
} }
this.dialogRef.close(); this.dialogRef.close(false);
} }
/** /**
......
...@@ -32,6 +32,7 @@ export class FooterComponent implements OnInit { ...@@ -32,6 +32,7 @@ export class FooterComponent implements OnInit {
public open: string; public open: string;
public deviceType: string; public deviceType: string;
public cookieAccepted: boolean; public cookieAccepted: boolean;
public dataProtectionConsent: boolean;
public themeClass = localStorage.getItem('theme'); public themeClass = localStorage.getItem('theme');
...@@ -60,11 +61,12 @@ export class FooterComponent implements OnInit { ...@@ -60,11 +61,12 @@ export class FooterComponent implements OnInit {
this.themes = this.themeService.getThemes(); this.themes = this.themeService.getThemes();
this.updateScale(this.themeService.getThemeByKey(this.themeClass)); this.updateScale(this.themeService.getThemeByKey(this.themeClass));
this.cookieAccepted = localStorage.getItem('cookieAccepted') === 'true'; this.cookieAccepted = localStorage.getItem('cookieAccepted') === 'true';
this.dataProtectionConsent = localStorage.getItem('dataProtectionConsent') === 'true';
if (!localStorage.getItem('cookieAccepted')) { if (!localStorage.getItem('cookieAccepted')) {
this.showCookieModal(); this.showCookieModal();
} else { } else {
if (!this.cookieAccepted) { if (!this.cookieAccepted || !this.dataProtectionConsent) {
this.showOverlay(); this.showOverlay();
} }
} }
...@@ -86,7 +88,9 @@ export class FooterComponent implements OnInit { ...@@ -86,7 +88,9 @@ export class FooterComponent implements OnInit {
dialogRef.disableClose = true; dialogRef.disableClose = true;
dialogRef.componentInstance.deviceType = this.deviceType; dialogRef.componentInstance.deviceType = this.deviceType;
dialogRef.afterClosed().subscribe(res => { dialogRef.afterClosed().subscribe(res => {
if (res) { this.cookieAccepted = res;
this.dataProtectionConsent = res;
if (!res) {
this.showOverlay(); this.showOverlay();
} }
}); });
...@@ -111,6 +115,12 @@ export class FooterComponent implements OnInit { ...@@ -111,6 +115,12 @@ export class FooterComponent implements OnInit {
width: '80%' width: '80%'
}); });
dialogRef.componentInstance.deviceType = this.deviceType; dialogRef.componentInstance.deviceType = this.deviceType;
dialogRef.afterClosed().subscribe(res => {
this.dataProtectionConsent = res;
if (!res) {
this.showOverlay();
}
});
} }
showOverlay() { showOverlay() {
...@@ -120,7 +130,11 @@ export class FooterComponent implements OnInit { ...@@ -120,7 +130,11 @@ export class FooterComponent implements OnInit {
dialogRef.disableClose = true; dialogRef.disableClose = true;
dialogRef.afterClosed().subscribe(res => { dialogRef.afterClosed().subscribe(res => {
if (res) { if (res) {
this.showCookieModal(); if (!this.cookieAccepted) {
this.showCookieModal();
} else if (!this.dataProtectionConsent) {
this.showDataProtection();
}
} }
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment