Skip to content
Snippets Groups Projects
Commit 7d7e0a52 authored by mechtelm's avatar mechtelm
Browse files

Apply new page title (application name) and subtitle to all components

parent 29d9b2ba
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 23 deletions
<div fxLayout="row wrap" fxLayoutAlign="center stretch"> <div fxLayout="row wrap" fxLayoutAlign="center stretch">
<mat-card fxFlex="0 0 400px" fxLayout="column"> <mat-card fxFlex="0 0 400px" fxLayout="column">
<mat-card-title>Verwaltung: Bitte Studie wählen</mat-card-title> <mat-card-title>Verwaltung</mat-card-title>
<mat-card-subtitle>Bitte Arbeitsbereich wählen</mat-card-subtitle>
<mat-card-content> <mat-card-content>
<div fxLayoutGap="10px" fxLayout="column"> <div fxLayoutGap="10px" fxLayout="column">
<p *ngIf="workspaces.length === 0"> <p *ngIf="workspaces.length === 0">
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }}</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
......
...@@ -2,7 +2,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; ...@@ -2,7 +2,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { from, Subscription } from 'rxjs'; import { from, Subscription } from 'rxjs';
import { concatMap } from 'rxjs/operators'; import { concatMap } from 'rxjs/operators';
import { CustomtextService } from 'iqb-components';
import { BackendService } from '../../backend.service'; import { BackendService } from '../../backend.service';
import { AuthAccessKeyType, AuthData, WorkspaceData } from '../../app.interfaces'; import { AuthAccessKeyType, AuthData, WorkspaceData } from '../../app.interfaces';
import { MainDataService } from '../../maindata.service'; import { MainDataService } from '../../maindata.service';
...@@ -23,11 +22,12 @@ export class AdminStarterComponent implements OnInit, OnDestroy { ...@@ -23,11 +22,12 @@ export class AdminStarterComponent implements OnInit, OnDestroy {
constructor( constructor(
private router: Router, private router: Router,
private bs: BackendService, private bs: BackendService,
private mds: MainDataService public mds: MainDataService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.mds.appSubTitle$.next('Verwaltung: Bitte Arbeitsbereich wählen');
this.mds.setSpinnerOn(); this.mds.setSpinnerOn();
this.bs.getSessionData().subscribe(authDataUntyped => { this.bs.getSessionData().subscribe(authDataUntyped => {
if (this.getWorkspaceDataSubscription !== null) { if (this.getWorkspaceDataSubscription !== null) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }}</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
......
...@@ -35,6 +35,7 @@ export class CodeInputComponent implements OnInit { ...@@ -35,6 +35,7 @@ export class CodeInputComponent implements OnInit {
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.mds.appSubTitle$.next('Bitte Code eingeben');
const element = <HTMLElement>document.querySelector('.mat-input-element[formControlName="code"]'); const element = <HTMLElement>document.querySelector('.mat-input-element[formControlName="code"]');
if (element) { if (element) {
element.focus(); element.focus();
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
<mat-card-title>{{ 'IQB-Testcenter' | customtext:'app_title' | async }}</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
<div [innerHTML]="mds.appConfig?.trusted_intro_html"></div> <div [innerHTML]="mds.appConfig?.trusted_intro_html"></div>
......
...@@ -41,6 +41,7 @@ export class LoginComponent implements OnInit, OnDestroy { ...@@ -41,6 +41,7 @@ export class LoginComponent implements OnInit, OnDestroy {
ngOnInit(): void { ngOnInit(): void {
this.mds.setSpinnerOff(); this.mds.setSpinnerOff();
this.mds.appSubTitle$.next('Bitte Anmelden');
this.routingSubscription = this.route.params this.routingSubscription = this.route.params
.subscribe(params => { this.returnTo = params.returnTo; }); .subscribe(params => { this.returnTo = params.returnTo; });
this.systemAnnouncementSubscription = <Subscription> this.cts.getCustomText$('system_announcement') this.systemAnnouncementSubscription = <Subscription> this.cts.getCustomText$('system_announcement')
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }}</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
......
...@@ -16,18 +16,19 @@ import { ...@@ -16,18 +16,19 @@ import {
export class MonitorStarterComponent implements OnInit, OnDestroy { export class MonitorStarterComponent implements OnInit, OnDestroy {
accessObjects: { [accessType: string]: (AccessObject|BookletData)[] } = {}; accessObjects: { [accessType: string]: (AccessObject|BookletData)[] } = {};
private getMonitorDataSubscription: Subscription = null; private getMonitorDataSubscription: Subscription = null;
public AuthAccessKeyType = AuthAccessKeyType; AuthAccessKeyType = AuthAccessKeyType;
public problemText: string; problemText: string;
constructor( constructor(
private router: Router, private router: Router,
private bs: BackendService, private bs: BackendService,
public cts: CustomtextService, public cts: CustomtextService,
private mds: MainDataService public mds: MainDataService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.mds.appSubTitle$.next(this.cts.getCustomText('gm_headline'));
this.mds.setSpinnerOn(); this.mds.setSpinnerOn();
this.bs.getSessionData().subscribe(authDataUntyped => { this.bs.getSessionData().subscribe(authDataUntyped => {
if (typeof authDataUntyped === 'number') { if (typeof authDataUntyped === 'number') {
......
<div class="root-body"> <div class="root-body">
<div fxLayout="row" fxLayoutAlign="center start"> <div fxLayout="row" fxLayoutAlign="center start">
<mat-card fxFlex="0 0 500px"> <mat-card fxFlex="0 0 500px">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }} - Impressum/Datenschutz</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<!-- - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - -->
<mat-card-content> <mat-card-content>
......
import { Component, Inject } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { MainDataService } from '../../maindata.service'; import { MainDataService } from '../../maindata.service';
@Component({ @Component({
...@@ -7,7 +7,7 @@ import { MainDataService } from '../../maindata.service'; ...@@ -7,7 +7,7 @@ import { MainDataService } from '../../maindata.service';
'mat-card {margin: 10px}' 'mat-card {margin: 10px}'
] ]
}) })
export class PrivacyComponent { export class PrivacyComponent implements OnInit {
constructor( constructor(
@Inject('APP_NAME') public appName: string, @Inject('APP_NAME') public appName: string,
@Inject('APP_PUBLISHER') public appPublisher: string, @Inject('APP_PUBLISHER') public appPublisher: string,
...@@ -16,4 +16,8 @@ export class PrivacyComponent { ...@@ -16,4 +16,8 @@ export class PrivacyComponent {
@Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean, @Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean,
public mds: MainDataService public mds: MainDataService
) { } ) { }
ngOnInit(): void {
setTimeout(() => this.mds.appSubTitle$.next('Impressum/Datenschutz'));
}
} }
<div fxLayout="row wrap" fxLayoutAlign="center stretch"> <div fxLayout="row wrap" fxLayoutAlign="center stretch">
<mat-card fxFlex="0 2 500px"> <mat-card fxFlex="0 2 500px">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }}: System-Check</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
<p>Hier können Sie ermitteln, ob das Computersystem, das Sie gerade benutzen, für <p>Hier können Sie ermitteln, ob das Computersystem, das Sie gerade benutzen, für
die hier vorgesehenen Testungen geeignet ist.</p> die hier vorgesehenen Testungen geeignet ist.</p>
......
...@@ -20,6 +20,7 @@ export class SysCheckStarterComponent implements OnInit { ...@@ -20,6 +20,7 @@ export class SysCheckStarterComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.mds.appSubTitle$.next('System-Check Auswahl');
this.loading = true; this.loading = true;
this.mds.setSpinnerOn(); this.mds.setSpinnerOn();
this.bs.getSysCheckInfo().subscribe(myConfigs => { this.bs.getSysCheckInfo().subscribe(myConfigs => {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
<mat-card-title>{{ 'app_title' | customtext:'app_title' | async }}</mat-card-title> <mat-card-title>{{mds.appTitle$ | async}}</mat-card-title>
<mat-card-content> <mat-card-content>
<p *ngIf="openTestletsCount === 0">{{ 'login_bookletSelectPromptNull' | customtext: 'login_bookletSelectPromptNull' | async}}</p> <p *ngIf="openTestletsCount === 0">{{ 'login_bookletSelectPromptNull' | customtext: 'login_bookletSelectPromptNull' | async}}</p>
......
...@@ -15,17 +15,19 @@ export class TestStarterComponent implements OnInit, OnDestroy { ...@@ -15,17 +15,19 @@ export class TestStarterComponent implements OnInit, OnDestroy {
booklets: BookletData[] = []; booklets: BookletData[] = [];
openTestletsCount = 0; openTestletsCount = 0;
private getBookletDataSubscription: Subscription = null; private getBookletDataSubscription: Subscription = null;
public bookletSelectTitle = 'Bitte wählen'; bookletSelectTitle = 'Bitte wählen';
problemText = ''; problemText = '';
constructor( constructor(
private router: Router, private router: Router,
private bs: BackendService, private bs: BackendService,
private mds: MainDataService private cts:CustomtextService,
public mds: MainDataService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.mds.appSubTitle$.next('');
this.mds.setSpinnerOn(); this.mds.setSpinnerOn();
this.bs.getSessionData().subscribe(authDataUntyped => { this.bs.getSessionData().subscribe(authDataUntyped => {
if (typeof authDataUntyped !== 'number') { if (typeof authDataUntyped !== 'number') {
...@@ -53,6 +55,13 @@ export class TestStarterComponent implements OnInit, OnDestroy { ...@@ -53,6 +55,13 @@ export class TestStarterComponent implements OnInit, OnDestroy {
}, },
() => { () => {
this.problemText = this.booklets.length ? '' : 'Für diese Anmeldung wurde kein Test gefunden.'; this.problemText = this.booklets.length ? '' : 'Für diese Anmeldung wurde kein Test gefunden.';
if (this.openTestletsCount <= 0) {
this.mds.appSubTitle$.next(this.cts.getCustomText('login_bookletSelectPromptNull'));
} else if (this.openTestletsCount === 1) {
this.mds.appSubTitle$.next(this.cts.getCustomText('login_bookletSelectPromptOne'));
} else {
this.mds.appSubTitle$.next(this.cts.getCustomText('login_bookletSelectPromptMany'));
}
this.mds.setSpinnerOff(); this.mds.setSpinnerOff();
} }
); );
......
import { import {
Component, OnDestroy, OnInit Component, OnDestroy, OnInit
} from '@angular/core'; } from '@angular/core';
import { Subscription } from 'rxjs'; import { Subscription, combineLatest } from 'rxjs';
import { CustomtextService } from 'iqb-components'; import { CustomtextService } from 'iqb-components';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer, Title } from '@angular/platform-browser';
import { MainDataService } from './maindata.service'; import { MainDataService } from './maindata.service';
import { BackendService } from './backend.service'; import { BackendService } from './backend.service';
import { AppError } from './app.interfaces'; import { AppError } from './app.interfaces';
...@@ -16,6 +16,7 @@ import { AppConfig } from './config/app.config'; ...@@ -16,6 +16,7 @@ import { AppConfig } from './config/app.config';
export class AppComponent implements OnInit, OnDestroy { export class AppComponent implements OnInit, OnDestroy {
private appErrorSubscription: Subscription = null; private appErrorSubscription: Subscription = null;
private appTitleSubscription: Subscription = null;
showError = false; showError = false;
errorData: AppError; errorData: AppError;
...@@ -24,6 +25,7 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -24,6 +25,7 @@ export class AppComponent implements OnInit, OnDestroy {
public mds: MainDataService, public mds: MainDataService,
private bs: BackendService, private bs: BackendService,
private cts: CustomtextService, private cts: CustomtextService,
private titleService: Title,
private sanitizer: DomSanitizer private sanitizer: DomSanitizer
) { } ) { }
...@@ -39,6 +41,16 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -39,6 +41,16 @@ export class AppComponent implements OnInit, OnDestroy {
this.showError = true; this.showError = true;
} }
}); });
this.appTitleSubscription = combineLatest([this.mds.appTitle$, this.mds.appSubTitle$, this.mds.isSpinnerOn$])
.subscribe(titles => {
if (titles[2]) {
this.titleService.setTitle(`${titles[0]} | Bitte warten}`);
} else if (titles[1]) {
this.titleService.setTitle(`${titles[0]} | ${titles[1]}`);
} else {
this.titleService.setTitle(titles[0]);
}
});
window.addEventListener('message', (event: MessageEvent) => { window.addEventListener('message', (event: MessageEvent) => {
const msgData = event.data; const msgData = event.data;
...@@ -54,6 +66,7 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -54,6 +66,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.bs.getSysConfig().subscribe(sysConfig => { this.bs.getSysConfig().subscribe(sysConfig => {
this.mds.appConfig = new AppConfig(sysConfig, this.cts, this.mds.expectedApiVersion, this.sanitizer); this.mds.appConfig = new AppConfig(sysConfig, this.cts, this.mds.expectedApiVersion, this.sanitizer);
this.mds.appTitle$.next(this.mds.appConfig.app_title);
if (!sysConfig) { if (!sysConfig) {
this.mds.appError$.next({ this.mds.appError$.next({
label: 'Server-Problem: Konnte Konfiguration nicht laden', label: 'Server-Problem: Konnte Konfiguration nicht laden',
...@@ -122,5 +135,8 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -122,5 +135,8 @@ export class AppComponent implements OnInit, OnDestroy {
if (this.appErrorSubscription !== null) { if (this.appErrorSubscription !== null) {
this.appErrorSubscription.unsubscribe(); this.appErrorSubscription.unsubscribe();
} }
if (this.appTitleSubscription !== null) {
this.appTitleSubscription.unsubscribe();
}
} }
} }
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
"gm_headline": { "gm_headline": {
"label": "Überschrift: Gruppenmonitor", "label": "Überschrift: Gruppenmonitor",
"defaultvalue": "IQB-Testcenter Gruppenüberwachung" "defaultvalue": "Gruppenüberwachung"
}, },
"gm_menu_filter": { "gm_menu_filter": {
"label": "Meinueintrag: Sitzungen ausblenden", "label": "Meinueintrag: Sitzungen ausblenden",
......
<div class="page-header"> <div class="page-header">
<p> <p>
{{'IQB-Testcenter Gruppenüberwachung' | customtext:'gm_headline' | async}} - {{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}} -
<span *ngIf="ownGroup$ | async as ownGroup">{{ownGroup.label}}</span> <span *ngIf="ownGroup$ | async as ownGroup">{{ownGroup.label}}</span>
</p> </p>
<span class="fill-remaining-space"></span> <span class="fill-remaining-space"></span>
......
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
import { TestSessionManager } from './test-session-manager/test-session-manager.service'; import { TestSessionManager } from './test-session-manager/test-session-manager.service';
import { ConnectionStatus } from '../shared/websocket-backend.service'; import { ConnectionStatus } from '../shared/websocket-backend.service';
import { BookletUtil } from './booklet/booklet.util'; import { BookletUtil } from './booklet/booklet.util';
import { MainDataService } from '../maindata.service';
@Component({ @Component({
selector: 'app-group-monitor', selector: 'app-group-monitor',
...@@ -60,7 +61,8 @@ export class GroupMonitorComponent implements OnInit, OnDestroy { ...@@ -60,7 +61,8 @@ export class GroupMonitorComponent implements OnInit, OnDestroy {
private bs: BackendService, private bs: BackendService,
public tsm: TestSessionManager, public tsm: TestSessionManager,
private router: Router, private router: Router,
private cts: CustomtextService private cts: CustomtextService,
public mds: MainDataService
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
...@@ -85,6 +87,7 @@ export class GroupMonitorComponent implements OnInit, OnDestroy { ...@@ -85,6 +87,7 @@ export class GroupMonitorComponent implements OnInit, OnDestroy {
]; ];
this.connectionStatus$ = this.bs.connectionStatus$; this.connectionStatus$ = this.bs.connectionStatus$;
this.mds.appSubTitle$.next(this.cts.getCustomText('gm_headline'));
} }
private commandResponseToMessage(commandResponse: CommandResponse): UIMessage { private commandResponseToMessage(commandResponse: CommandResponse): UIMessage {
......
...@@ -20,6 +20,8 @@ export class MainDataService { ...@@ -20,6 +20,8 @@ export class MainDataService {
progressVisualEnabled = true; progressVisualEnabled = true;
appConfig: AppConfig = null; appConfig: AppConfig = null;
sysCheckAvailable = false; sysCheckAvailable = false;
appTitle$ = new BehaviorSubject<string>('IQB-Testcenter');
appSubTitle$ = new BehaviorSubject<string>('');
defaultTcHeaderHeight = document.documentElement.style.getPropertyValue('--tc-header-height'); defaultTcHeaderHeight = document.documentElement.style.getPropertyValue('--tc-header-height');
defaultTcUnitTitleHeight = document.documentElement.style.getPropertyValue('--tc-unit-title-height'); defaultTcUnitTitleHeight = document.documentElement.style.getPropertyValue('--tc-unit-title-height');
......
<div class="page-header"> <div class="page-header">
<p>IQB-Testcenter Systemverwaltung</p> <p>{{mds.appTitle$ | async}} {{mds.appSubTitle$ | async}}</p>
</div> </div>
<div class="page-body"> <div class="page-body">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment