Skip to content
Snippets Groups Projects
Commit 56bf156c authored by Hartung, Michael's avatar Hartung, Michael
Browse files

privacy policy banner and rename cookie keys from netex to drugstone

parent 67c6aa28
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ import { GroupSelectionComponent } from './pages/explorer-page/group-selection/g
import { FaSolidIconComponent } from './components/fa-solid-icon/fa-solid-icon.component';
import { FaIconsComponent } from './pages/explorer-page/fa-icons/fa-icons.component';
import { LoadingScreenComponent } from './components/loading-screen/loading-screen.component';
import { PrivacyBannerComponent } from './components/privacy-banner/privacy-banner.component';
@NgModule({
......@@ -78,6 +79,7 @@ import { LoadingScreenComponent } from './components/loading-screen/loading-scre
FaSolidIconComponent,
FaIconsComponent,
LoadingScreenComponent,
PrivacyBannerComponent,
],
imports: [
BrowserModule,
......
<div class="notification center" [class.disabled]="disabled" id="privacy-banner">
<button class="delete" (click)="close()"></button>
All data will be processed at Drugst.One.&nbsp;<a target="_blank" href="https://drugst.one/doc#privacy_policy">More information</a>
</div>
@import "src/stylesheets/variables";
#privacy-banner{
position: absolute;
bottom: 0;
z-index: $privacy-banner-z;
width: 100%;
&.disabled {
display: none;
}
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PrivacyBannerComponent } from './privacy-banner.component';
describe('PrivacyBannerComponent', () => {
let component: PrivacyBannerComponent;
let fixture: ComponentFixture<PrivacyBannerComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PrivacyBannerComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PrivacyBannerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-privacy-banner',
templateUrl: './privacy-banner.component.html',
styleUrls: ['./privacy-banner.component.scss']
})
export class PrivacyBannerComponent implements OnInit {
constructor() { }
ngOnInit(): void {
console.log(localStorage.getItem(this.privacyBannerCookieKey) )
if (localStorage.getItem(this.privacyBannerCookieKey) === 'true') {
this.disable();
};
}
public disabled = false;
private privacyBannerCookieKey = `drugstone-privacypolicy-${window.location.host}`;
public close() {
this.saveCookie();
this.disable();
}
public disable() {
this.disabled = true;
}
private saveCookie() {
localStorage.setItem(this.privacyBannerCookieKey, 'true');
}
}
......@@ -3,6 +3,7 @@
<div class="is-hidden-mobile fullheight" id="appContainer">
<app-fa-icons></app-fa-icons>
<app-loading-screen></app-loading-screen>
<app-privacy-banner></app-privacy-banner>
<app-license-agreement></app-license-agreement>
<app-launch-analysis
......
......@@ -61,8 +61,8 @@ export class AnalysisService {
private selections = new Map<string, Map<string, Wrapper>>();
public tokens: string[] = [];
private tokensCookieKey = `netex-tokens-${window.location.host}`;
private tokensFinishedCookieKey = `netex-finishedTokens-${window.location.host}`;
private tokensCookieKey = `drugstone-tokens-${window.location.host}`;
private tokensFinishedCookieKey = `drugstone-finishedTokens-${window.location.host}`;
public finishedTokens: string[] = [];
public tasks: Task[] = [];
......@@ -314,7 +314,7 @@ export class AnalysisService {
}).toPromise();
this.tokens.push(resp.token);
localStorage.setItem(`netex-tokens-${window.location.host}`, JSON.stringify(this.tokens));
localStorage.setItem(`drugstone-tokens-${window.location.host}`, JSON.stringify(this.tokens));
this.startWatching();
this.toast.setNewToast({
......
......@@ -63,7 +63,7 @@ $b-text-smaller-font-size: 12px;
$text-normal-font-size: 12px;
$text-small-font-size: 11px;
$toast-z: 100;
$privacy-banner-z: 100;
$fullscreen-z: 2147483646;
$toast-z: 2147483647;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment