Skip to content

Commit a8da490

Browse files
authored
feat: add help cards in /help and /about, based on configurable supportEmail (#1933)
## Description This PR adds an environment variable `supportEmail`. If set, a card "Questions or issues" is added in the `/help` page like so: ![Screenshot from 2025-07-08 14-55-16](https://github.com/user-attachments/assets/789f4e20-ee0f-49b3-badf-2ee4f54666e9) ## Motivation Currently, users had no way to look up a contact email in case of issues or questions. This PR adds it via a configurable `supportEmail` env var. ## Fixes: None ## Changes: Please provide a list of the changes implemented by this PR * add `supportEmail` in appConfig * add a card in /help component ## Tests included - [ ] Included for each change/fix? - [x] Passing? (Merge will not be approved unless this is checked) ## Documentation - [ ] swagger documentation updated \[required\] - [x] official documentation updated \[nice-to-have\] SciCatProject/documentation#81 ### official documentation info N/A ## Backend version - [ ] Does it require a specific version of the backend - which version of the backend is required: ## Summary by Sourcery Add supportEmail configuration and display contextual help cards in the UI New Features: - Introduce supportEmail environment variable in AppConfig - Render a “Questions or issues?” card on the /help page when supportEmail is set - Render a “Getting help” card on the /about page for PSI facility with optional contact email
1 parent d7bfbbb commit a8da490

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/app/app-config.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export interface AppConfigInterface {
120120
labelsLocalization?: LabelsLocalization;
121121
dateFormat?: string;
122122
defaultMainPage?: MainPageConfiguration;
123+
supportEmail?: string;
123124
}
124125

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

src/app/help/help/help.component.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,15 @@
108108
</mat-card-content>
109109
</mat-card>
110110
</p>
111+
112+
<p *ngIf="supportEmail">
113+
<mat-card class="help-card">
114+
<mat-card-header>
115+
<mat-card-title> Questions or issues? </mat-card-title>
116+
</mat-card-header>
117+
<mat-card-content>
118+
If you have any questions or need help, please contact
119+
<a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a>.
120+
</mat-card-content>
121+
</mat-card>
122+
</p>

src/app/help/help/help.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class HelpComponent implements OnInit {
1414
gettingStarted: string | null = null;
1515
shoppingCartEnabled = false;
1616
helpMessages: HelpMessages;
17+
supportEmail: string | undefined;
1718
constructor(public appConfigService: AppConfigService) {}
1819

1920
ngOnInit() {
@@ -25,5 +26,6 @@ export class HelpComponent implements OnInit {
2526
);
2627
this.gettingStarted = this.appConfig.gettingStarted;
2728
this.shoppingCartEnabled = this.appConfig.shoppingCartEnabled;
29+
this.supportEmail = this.appConfig.supportEmail;
2830
}
2931
}

0 commit comments

Comments
 (0)