From 7be40ed23638525181e0c2bfba02cc0c3b9b607b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 17 Mar 2023 13:18:33 +0100 Subject: [PATCH] Added imprint and privacy urls --- .../components/footer/footer.component.html | 6 ++++-- .../app/components/footer/footer.component.ts | 7 ++++++- kdb-web/src/app/models/config/appsettings.ts | 4 +++- .../app/services/settings/settings.service.ts | 18 +++++++++++++++++- kdb-web/src/assets/config.json | 4 +++- kdb-web/src/assets/i18n/de.json | 3 ++- kdb-web/src/assets/i18n/en.json | 3 ++- 7 files changed, 37 insertions(+), 8 deletions(-) diff --git a/kdb-web/src/app/components/footer/footer.component.html b/kdb-web/src/app/components/footer/footer.component.html index 240f8583..9d0a7414 100644 --- a/kdb-web/src/app/components/footer/footer.component.html +++ b/kdb-web/src/app/components/footer/footer.component.html @@ -21,6 +21,8 @@
- {{'footer.imprint' | translate}} + {{'footer.privacy' | translate}} + | + {{'footer.imprint' | translate}}
- \ No newline at end of file + diff --git a/kdb-web/src/app/components/footer/footer.component.ts b/kdb-web/src/app/components/footer/footer.component.ts index ae891bc6..d1c0d4a9 100644 --- a/kdb-web/src/app/components/footer/footer.component.ts +++ b/kdb-web/src/app/components/footer/footer.component.ts @@ -17,13 +17,18 @@ export class FooterComponent implements OnInit { frontendVersion: SoftwareVersion = new SoftwareVersion("0", "0", "0"); backendVersion: SoftwareVersion = new SoftwareVersion("0", "0", "0"); + public privacy: string = ""; + public imprint: string = ""; + constructor( private settings: SettingsService, private guiService: GuiService, private spinnerService: SpinnerService - ) { } + ) {} ngOnInit(): void { + this.privacy = this.settings.getPrivacyURL(); + this.imprint = this.settings.getImprintURL(); this.frontendVersion = this.settings.getWebVersion() ?? new SoftwareVersion('0', '0', '0'); this.spinnerService.showSpinner(); diff --git a/kdb-web/src/app/models/config/appsettings.ts b/kdb-web/src/app/models/config/appsettings.ts index de434a03..f3f5796b 100644 --- a/kdb-web/src/app/models/config/appsettings.ts +++ b/kdb-web/src/app/models/config/appsettings.ts @@ -3,6 +3,8 @@ import { Theme } from '../view/theme'; export interface Appsettings { ApiURL: string; + PrivacyURL: string; + ImprintURL: string; WebVersion: SoftwareVersion; Themes: Theme[]; -} \ No newline at end of file +} diff --git a/kdb-web/src/app/services/settings/settings.service.ts b/kdb-web/src/app/services/settings/settings.service.ts index 52b8238b..81afc135 100644 --- a/kdb-web/src/app/services/settings/settings.service.ts +++ b/kdb-web/src/app/services/settings/settings.service.ts @@ -30,13 +30,29 @@ export class SettingsService { } public getApiURL(): string { - if (!this.appsettings || !this.appsettings.Themes) { + if (!this.appsettings || !this.appsettings.ApiURL) { console.error('ApiUrl is not set!'); return ""; } return this.appsettings.ApiURL; } + public getPrivacyURL(): string { + if (!this.appsettings || !this.appsettings.PrivacyURL) { + console.error('PrivacyURL is not set!'); + return ""; + } + return this.appsettings.PrivacyURL; + } + + public getImprintURL(): string { + if (!this.appsettings || !this.appsettings.ImprintURL) { + console.error('ImprintURL is not set!'); + return ""; + } + return this.appsettings.ImprintURL; + } + public getWebVersion(): SoftwareVersion | null { if (!this.appsettings || !this.appsettings.WebVersion) { console.error('WebVersion is not set!'); diff --git a/kdb-web/src/assets/config.json b/kdb-web/src/assets/config.json index 3847c4c1..cb6190e2 100644 --- a/kdb-web/src/assets/config.json +++ b/kdb-web/src/assets/config.json @@ -1,5 +1,7 @@ { "ApiURL": "http://localhost:8044", + "PrivacyURL": "https://www.sh-edraft.de/Datenschutz", + "ImprintURL": "https://www.sh-edraft.de/Impressum", "WebVersion": { "Major": "1", "Minor": "0", @@ -23,4 +25,4 @@ "Name": "sh-edraft-dark-theme" } ] -} \ No newline at end of file +} diff --git a/kdb-web/src/assets/i18n/de.json b/kdb-web/src/assets/i18n/de.json index 79234f3d..af34e987 100644 --- a/kdb-web/src/assets/i18n/de.json +++ b/kdb-web/src/assets/i18n/de.json @@ -163,7 +163,8 @@ "footer": { "backend": "API", "frontend": "Webseite", - "imprint": "Impressum" + "imprint": "Impressum", + "privacy": "Datenschutz" }, "general": { "days": "Tage", diff --git a/kdb-web/src/assets/i18n/en.json b/kdb-web/src/assets/i18n/en.json index 0eebcb6f..d8840535 100644 --- a/kdb-web/src/assets/i18n/en.json +++ b/kdb-web/src/assets/i18n/en.json @@ -163,7 +163,8 @@ "footer": { "backend": "Website", "frontend": "API", - "imprint": "Imprint" + "imprint": "Imprint", + "privacy": "Privacy" }, "general": { "days": "Days",