Skip to content
Snippets Groups Projects
Commit 1f72836f authored by mechtelm's avatar mechtelm
Browse files

Set warning in alert tag at login page

Move warning from card-header to alert tag; remove workaround via customTexts (system_announcement)
parent a899a4ec
No related branches found
No related tags found
No related merge requests found
Pipeline #19256 failed
<div fxLayout="row wrap" fxLayoutAlign="center stretch"> <div fxLayout="row wrap" fxLayoutAlign="center stretch">
<mat-card fxFlex="0 0 400px"> <mat-card fxFlex="0 0 400px">
<mat-card-title>Anmelden</mat-card-title> <mat-card-title>Anmelden</mat-card-title>
<mat-card-header *ngIf="mds.globalWarning">{{mds.globalWarning}}</mat-card-header>
<form [formGroup]="loginForm" (ngSubmit)="login()" *ngIf="mds.appConfig?.isValidApiVersion"> <form [formGroup]="loginForm" (ngSubmit)="login()" *ngIf="mds.appConfig?.isValidApiVersion">
<mat-card-content fxLayout="column"> <mat-card-content fxLayout="column">
<mat-form-field> <mat-form-field>
...@@ -24,7 +23,7 @@ ...@@ -24,7 +23,7 @@
</form> </form>
<p style="color: chocolate"><b>{{ problemText }}</b></p> <p style="color: chocolate"><b>{{ problemText }}</b></p>
<p style="color: chocolate" *ngIf="!mds.appConfig?.isValidApiVersion"><b>Die Verbindung mit dem Server ist nicht möglich.</b></p> <p style="color: chocolate" *ngIf="!mds.appConfig?.isValidApiVersion"><b>Die Verbindung mit dem Server ist nicht möglich.</b></p>
<alert *ngIf="systemAnnouncement !== '-'" level="warning" [text]="systemAnnouncement"></alert> <alert *ngIf="mds.globalWarning" level="warning" [text]="mds.globalWarning"></alert>
</mat-card> </mat-card>
<mat-card fxFlex="0 0 400px" class="mat-card-gray"> <mat-card fxFlex="0 0 400px" class="mat-card-gray">
......
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { CustomtextService } from 'iqb-components';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { MainDataService } from '../../maindata.service'; import { MainDataService } from '../../maindata.service';
...@@ -20,7 +19,6 @@ import { BackendService } from '../../backend.service'; ...@@ -20,7 +19,6 @@ import { BackendService } from '../../backend.service';
export class LoginComponent implements OnInit, OnDestroy { export class LoginComponent implements OnInit, OnDestroy {
static oldLoginName = ''; static oldLoginName = '';
private routingSubscription: Subscription = null; private routingSubscription: Subscription = null;
private systemAnnouncementSubscription: Subscription = null;
returnTo = ''; returnTo = '';
problemText = ''; problemText = '';
showPassword = false; showPassword = false;
...@@ -30,14 +28,11 @@ export class LoginComponent implements OnInit, OnDestroy { ...@@ -30,14 +28,11 @@ export class LoginComponent implements OnInit, OnDestroy {
pw: new FormControl('') pw: new FormControl('')
}); });
systemAnnouncement: string = '-';
constructor( constructor(
public mds: MainDataService, public mds: MainDataService,
private bs: BackendService, private bs: BackendService,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute
private cts: CustomtextService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
...@@ -45,8 +40,6 @@ export class LoginComponent implements OnInit, OnDestroy { ...@@ -45,8 +40,6 @@ export class LoginComponent implements OnInit, OnDestroy {
this.mds.appSubTitle$.next('Bitte Anmelden'); 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')
.subscribe(text => { this.systemAnnouncement = text || '-'; });
} }
login(): void { login(): void {
......
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