Skip to content

Commit af3663f

Browse files
committed
(feat) help message footer with configurable contactEmail (#396)
* remove bannerColor getter as it's not used (banner color set by css) * Add a help message footer with configurable contactEmail
1 parent 79d68f5 commit af3663f

6 files changed

Lines changed: 31 additions & 14 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/app-config.module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class AppConfig {
2121
} | undefined = undefined;
2222
statusMessage = "";
2323
statusCode: "INFO" | "WARN" | "NONE" = "NONE";
24+
contactEmail = "";
2425
}
2526

2627
export const APP_DI_CONFIG: AppConfig = {
@@ -36,7 +37,9 @@ export const APP_DI_CONFIG: AppConfig = {
3637
retrieveToEmail: environment["retrieveToEmail"] ?? undefined,
3738
statusMessage: environment["statusMessage"] || "",
3839
statusCode: (["INFO", "WARN", "NONE"].includes(environment["statusCode"])
39-
? environment["statusCode"] : "NONE") as "INFO" | "WARN" | "NONE",
40+
? environment["statusCode"]
41+
: "NONE") as "INFO" | "WARN" | "NONE",
42+
contactEmail: environment["contactEmail"] || "",
4043
};
4144

4245
@NgModule({

src/app/app.component.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
<router-outlet></router-outlet>
1414

15-
<mat-toolbar class="footer" *ngIf="appConfig.showLogoBanner">
16-
<img src="../assets/logo_banner.png" width="412" alt="logo_banner" />
17-
</mat-toolbar>
15+
<footer class="footer">
16+
<mat-toolbar class="logo-banner" *ngIf="appConfig.showLogoBanner">
17+
<img src="../assets/logo_banner.png" width="412" alt="logo_banner" />
18+
</mat-toolbar>
19+
20+
<address *ngIf="appConfig.contactEmail">
21+
If you have any questions or need help, please contact <a href="mailto:{{ appConfig.contactEmail }}">{{
22+
appConfig.contactEmail }}</a>.
23+
</address>
24+
</footer>

src/app/app.component.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/* AppComponent's private CSS styles */
2+
:host {
3+
display: flex;
4+
flex-direction: column;
5+
min-height: 100vh;
6+
}
27

38
.header {
49
position: sticky;
@@ -7,10 +12,20 @@
712
}
813

914
.footer {
15+
margin-top: auto;
16+
}
17+
18+
.logo-banner {
1019
height: 77px;
1120
justify-content: center;
1221
}
1322

23+
address {
24+
font-size: 16px;
25+
padding: 0.5em;
26+
background-color: whitesmoke;
27+
}
28+
1429
.spacer {
1530
flex: 1 1 auto;
1631
text-align: left;

src/app/shared/modules/status-message/status-banner/status-banner.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-toolbar [color]="bannerColor" [class]='["toolbar", "toolbar-" + appConfig.statusCode]'>
1+
<mat-toolbar [class]='["toolbar", "toolbar-" + appConfig.statusCode]'>
22
<span [innerHTML]="appConfig.statusMessage" class="status-message"></span>
33
<span class="spacer"></span>
44
<button mat-icon-button aria-label="Dismiss" (click)="onDismiss()">

src/app/shared/modules/status-message/status-banner/status-banner.component.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,4 @@ export class StatusBannerComponent {
1414
onDismiss() {
1515
this.dismiss.emit();
1616
}
17-
18-
get bannerColor() {
19-
switch (this.appConfig.statusCode) {
20-
case "INFO": return "accent";
21-
case "WARN": return "warn";
22-
default: return "";
23-
}
24-
}
2517
}

0 commit comments

Comments
 (0)