-
Notifications
You must be signed in to change notification settings - Fork 33
Add privacy & imprint footer #1991
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| @use "@angular/material" as mat; | ||
| @use "sass:map"; | ||
|
|
||
| @mixin color($theme) { | ||
| $color-config: map.get($theme, "color"); | ||
| $primary: map.get($color-config, "primary"); | ||
|
|
||
| .footer { | ||
| background-color: mat.m2-get-color-from-palette($primary, "default-contrast"); | ||
| color: mat.m2-get-color-from-palette($primary); | ||
|
|
||
| a, | ||
| .toplink, | ||
| .footer-copy, | ||
| mat-icon { | ||
| color: mat.m2-get-color-from-palette($primary); | ||
|
|
||
| } | ||
|
|
||
| mat-toolbar { | ||
| background-color: mat.m2-get-color-from-palette($primary, "darker"); | ||
| } | ||
|
|
||
| a { | ||
| color: mat.m2-get-color-from-palette($primary, "default-contrast"); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @mixin theme($theme) { | ||
|
|
||
| // Check if the 'color' key exists in the theme map | ||
| @if map.has-key($theme, "color") { | ||
| @include color($theme); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <div class="footer"> | ||
| <mat-toolbar class="mat-elevation-z1"> | ||
| <span class="spacer"></span> | ||
|
|
||
| <span> | ||
| <h6> | ||
| <a | ||
| class="toplink" | ||
| href="{{ imprintUrl }}" | ||
| target="_blank" | ||
| rel="noopener" | ||
| > | ||
| <mat-icon>description</mat-icon> | ||
| <span class="large-screen-text">Imprint</span> | ||
| </a> | ||
| </h6> | ||
| </span> | ||
|
|
||
| <span> | ||
| <h6> | ||
| <a | ||
| class="toplink" | ||
| href="{{ privacyUrl }}" | ||
| target="_blank" | ||
| rel="noopener" | ||
| > | ||
| <mat-icon>lock</mat-icon> | ||
| <span class="large-screen-text">Privacy</span> | ||
| </a> | ||
| </h6> | ||
| </span> | ||
| </mat-toolbar> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| .footer { | ||
| // background: white; | ||
| // width: 100%; | ||
| // padding: 1rem; | ||
| // text-align: center; | ||
|
Comment on lines
+2
to
+5
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the commented lines |
||
|
|
||
| background-color: white; | ||
|
|
||
| mat-toolbar { | ||
| background: white !important; | ||
| height: 3.5rem; | ||
|
|
||
| .spacer { | ||
| flex: 1 1 auto; | ||
| } | ||
|
|
||
| .toplink { | ||
| padding: 0.5rem 1rem; | ||
| font: bold; | ||
| font-size: 11pt; | ||
|
|
||
| mat-icon { | ||
| vertical-align: middle; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
|
||
| import { AppFooterComponent } from './app-footer.component'; | ||
|
|
||
| describe('AppFooterComponent', () => { | ||
| let component: AppFooterComponent; | ||
| let fixture: ComponentFixture<AppFooterComponent>; | ||
|
|
||
| beforeEach(() => { | ||
| TestBed.configureTestingModule({ | ||
| declarations: [AppFooterComponent] | ||
| }); | ||
| fixture = TestBed.createComponent(AppFooterComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { Component, OnInit } from "@angular/core"; | ||
| import { AppConfigService } from "app-config.service"; | ||
|
|
||
| @Component({ | ||
| selector: "app-app-footer", | ||
| templateUrl: "./app-footer.component.html", | ||
| styleUrls: ["./app-footer.component.scss"], | ||
| standalone: false, | ||
| }) | ||
| export class AppFooterComponent implements OnInit { | ||
| appConfig = this.appConfigService.getConfig(); | ||
|
|
||
| imprintUrl = ""; | ||
| privacyUrl = ""; | ||
|
|
||
| constructor(public appConfigService: AppConfigService) { } | ||
|
|
||
| ngOnInit() { | ||
| this.imprintUrl = | ||
| this.appConfig.imprintUrl || "https://example.com/imprint"; | ||
| this.privacyUrl = | ||
| this.appConfig.privacyUrl || "https://example.com/privacy"; | ||
|
Comment on lines
+19
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add explicit configuration option to enable/disable imprint and privacy |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ | |
| <div class="main"> | ||
| <router-outlet></router-outlet> | ||
| </div> | ||
| <app-app-footer></app-app-footer> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we show the footer if nothing is shown in the footer |
||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,8 @@ | |
| multipleDownloadAction: "http://localhost:3012/zip", | ||
| multipleDownloadEnabled: true, | ||
| multipleDownloadUseAuthToken: false, | ||
| imprintUrl = "https://example.com/imprint", | ||
| privacyUrl = "https://example.com/privacy", | ||
|
Comment on lines
+58
to
+59
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Assignment operator used instead of colon in object literal. Please replace the equals sign with a colon to avoid syntax errors in the object literal.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change as suggested
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely! To fix the syntax error, update the const appConfig: AppConfigInterface = {
multipleDownloadAction: "http://localhost:3012/zip",
multipleDownloadEnabled: true,
multipleDownloadUseAuthToken: false,
imprintUrl: "https://example.com/imprint",
privacyUrl: "https://example.com/privacy",
}Just replace the equals signs ( |
||
| oAuth2Endpoints: [], | ||
| policiesEnabled: true, | ||
| retrieveDestinations: [], | ||
|
|
@@ -307,7 +309,7 @@ | |
|
|
||
| const mockHttpGet = (backendError = false) => { | ||
| spyOn(service["http"], "get").and.callFake( | ||
| (url: string): Observable<any> => { | ||
| if (url === "/api/v3/admin/config") { | ||
| if (backendError) { | ||
| return new Observable((sub) => | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ | |
| datasetReduceEnabled: boolean; | ||
| datasetDetailsShowMissingProposalId: boolean; | ||
| datafilesActionsEnabled: boolean; | ||
| datafilesActions: any[]; | ||
| editDatasetEnabled: boolean; | ||
| editDatasetSampleEnabled: boolean; | ||
| editMetadataEnabled: boolean; | ||
|
|
@@ -143,9 +143,11 @@ | |
| mainMenu?: MainMenuConfiguration; | ||
| supportEmail?: string; | ||
| checkBoxFilterClickTrigger?: boolean; | ||
| imprintUrl?: string; | ||
| privacyUrl?: string; | ||
|
Comment on lines
+146
to
+147
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add also explicit configuration options to enable/disable showing the imprint and the privacy.
|
||
| } | ||
|
|
||
| function isMainPageConfiguration(obj: any): obj is MainPageConfiguration { | ||
| const validKeys = Object.keys(MainPageOptions); | ||
| return ( | ||
| obj && | ||
|
|
@@ -196,12 +198,12 @@ | |
| .pipe(timeout(2000)) | ||
| .toPromise(); | ||
| this.appConfig = Object.assign({}, this.appConfig, config); | ||
| } catch (err) { | ||
| console.log("No config available in backend, trying with local config."); | ||
| try { | ||
| const config = await this.mergeConfig(); | ||
| this.appConfig = Object.assign({}, this.appConfig, config); | ||
| } catch (err) { | ||
| console.error("No config provided."); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 suggestion (security): Consider adding 'noreferrer' to rel attribute for external links.
This helps prevent referrer information from being shared with external sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! To include the suggestion, update the
relattribute in your anchor tag as follows:This will ensure both security and privacy by preventing the new page from accessing the window object and by not sending referrer information. Let me know if you need help with anything else!