Skip to content

Commit e2cd366

Browse files
armandobermudezmartinezJohannes Reppin
authored andcommitted
Add footer for privacyUrl and imrprintUrl
1 parent 552e551 commit e2cd366

File tree

10 files changed

+139
-0
lines changed

10 files changed

+139
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@use "@angular/material" as mat;
2+
3+
@mixin color($theme) {
4+
$color-config: map-get($theme, "color");
5+
$primary: map-get($color-config, "primary");
6+
7+
.footer {
8+
// Invert colors: background gets contrast color, text gets main color
9+
background-color: mat.get-color-from-palette($primary, "default-contrast");
10+
color: mat.get-color-from-palette($primary);
11+
12+
a,
13+
.toplink,
14+
.footer-copy,
15+
mat-icon {
16+
color: mat.get-color-from-palette($primary);
17+
}
18+
}
19+
}
20+
21+
@mixin theme($theme) {
22+
$color-config: mat.get-color-config($theme);
23+
@if $color-config != null {
24+
@include color($theme);
25+
}
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<div class="footer">
2+
<mat-toolbar class="mat-elevation-z1">
3+
<span class="spacer"></span>
4+
5+
<span>
6+
<h6>
7+
<a
8+
class="toplink"
9+
href="{{ imprintUrl }}"
10+
target="_blank"
11+
rel="noopener"
12+
>
13+
<mat-icon>description</mat-icon>
14+
<span class="large-screen-text">Imprint</span>
15+
</a>
16+
</h6>
17+
</span>
18+
19+
<span>
20+
<h6>
21+
<a
22+
class="toplink"
23+
href="{{ privacyUrl }}"
24+
target="_blank"
25+
rel="noopener"
26+
>
27+
<mat-icon>lock</mat-icon>
28+
<span class="large-screen-text">Privacy</span>
29+
</a>
30+
</h6>
31+
</span>
32+
</mat-toolbar>
33+
</div>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.footer {
2+
// background: white;
3+
// width: 100%;
4+
// padding: 1rem;
5+
// text-align: center;
6+
7+
background-color: white;
8+
9+
mat-toolbar {
10+
background: white !important;
11+
height: 3.5rem;
12+
13+
.spacer {
14+
flex: 1 1 auto;
15+
}
16+
17+
.toplink {
18+
padding: 0.5rem 1rem;
19+
font: bold;
20+
font-size: 11pt;
21+
22+
mat-icon {
23+
vertical-align: middle;
24+
}
25+
}
26+
}
27+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AppFooterComponent } from './app-footer.component';
4+
5+
describe('AppFooterComponent', () => {
6+
let component: AppFooterComponent;
7+
let fixture: ComponentFixture<AppFooterComponent>;
8+
9+
beforeEach(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [AppFooterComponent]
12+
});
13+
fixture = TestBed.createComponent(AppFooterComponent);
14+
component = fixture.componentInstance;
15+
fixture.detectChanges();
16+
});
17+
18+
it('should create', () => {
19+
expect(component).toBeTruthy();
20+
});
21+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Component, OnInit } from "@angular/core";
2+
import { AppConfigService } from "app-config.service";
3+
4+
@Component({
5+
selector: "app-app-footer",
6+
templateUrl: "./app-footer.component.html",
7+
styleUrls: ["./app-footer.component.scss"],
8+
})
9+
export class AppFooterComponent implements OnInit {
10+
appConfig = this.appConfigService.getConfig();
11+
12+
imprintUrl = "";
13+
privacyUrl = "";
14+
15+
constructor(public appConfigService: AppConfigService) {}
16+
17+
ngOnInit() {
18+
this.imprintUrl =
19+
this.appConfig.imprintUrl || "https://example.com/imprint";
20+
this.privacyUrl =
21+
this.appConfig.privacyUrl || "https://example.com/privacy";
22+
}
23+
}

src/app/_layout/app-layout/app-layout.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<div class="main">
44
<router-outlet></router-outlet>
55
</div>
6+
<app-app-footer></app-app-footer>
67
</div>

src/app/_layout/layout.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import { AppMainLayoutComponent } from "./app-main-layout/app-main-layout.compon
1212
import { BatchCardModule } from "datasets/batch-card/batch-card.module";
1313
import { BreadcrumbModule } from "shared/modules/breadcrumb/breadcrumb.module";
1414
import { UsersModule } from "../users/users.module";
15+
import { AppFooterComponent } from './app-footer/app-footer.component';
1516

1617
@NgModule({
1718
declarations: [
1819
AppLayoutComponent,
1920
AppHeaderComponent,
2021
AppMainLayoutComponent,
22+
AppFooterComponent,
2123
],
2224
imports: [
2325
CommonModule,

src/app/app-config.service.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ const appConfig: AppConfigInterface = {
5555
multipleDownloadAction: "http://localhost:3012/zip",
5656
multipleDownloadEnabled: true,
5757
multipleDownloadUseAuthToken: false,
58+
imprintUrl = "https://example.com/imprint",
59+
privacyUrl = "https://example.com/privacy",
5860
oAuth2Endpoints: [],
5961
policiesEnabled: true,
6062
retrieveDestinations: [],

src/app/app-config.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ export interface AppConfigInterface {
143143
mainMenu?: MainMenuConfiguration;
144144
supportEmail?: string;
145145
checkBoxFilterClickTrigger?: boolean;
146+
imprintUrl?: string;
147+
privacyUrl?: string;
146148
}
147149

148150
function isMainPageConfiguration(obj: any): obj is MainPageConfiguration {

src/styles.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@use "@angular/material" as mat;
55
@use "./app/app-theme" as app;
66
@use "./app/_layout/app-header/app-header-theme" as app-header;
7+
@use "./app/_layout/app-footer/app-footer-theme" as app-footer;
78
@use "./app/datasets/batch-view/batch-view-theme" as batch-view;
89
@use "./app/datasets/dashboard/dashboard-theme" as dashboard;
910
@use "./app/datasets/datafiles/datafiles-theme" as datafiles;
@@ -229,6 +230,7 @@ $theme: map.merge(
229230
@include mat.all-component-themes($theme);
230231
@include app.theme($theme);
231232
@include app-header.theme($theme);
233+
@include app-footer.theme($theme);
232234
@include batch-view.theme($theme);
233235
@include dashboard.theme($theme);
234236
@include datafiles.theme($theme);

0 commit comments

Comments
 (0)