From 0cea52b4d2cc4e4e97842a42b1a807f5535d6365 Mon Sep 17 00:00:00 2001 From: mechtelm <nicht@mehr.fragen> Date: Sat, 28 Mar 2020 17:59:22 +0100 Subject: [PATCH] build just before major change: LoginData --> AuthData --- .../admin-starter.component.html | 18 +++ .../admin-starter.component.spec.ts | 25 ++++ .../admin-starter/admin-starter.component.ts | 24 ++++ src/app/app-root/app-root.component.html | 3 - src/app/app-root/app-root.component.ts | 46 +++---- .../app-status/app-status.component.css | 0 .../app-status/app-status.component.html | 1 - .../app-status/app-status.component.ts | 15 --- .../code-input/code-input.component.html | 15 +++ .../code-input.component.spec.ts} | 10 +- .../code-input/code-input.component.ts | 58 +++++++++ src/app/app-root/login/login.component.ts | 54 ++++++-- src/app/app-routing-guards.ts | 18 +++ src/app/app-routing.module.ts | 5 +- src/app/app.component.ts | 120 +++++++++--------- src/app/app.interfaces.ts | 18 +++ src/app/app.module.ts | 6 +- src/app/maindata.service.ts | 2 + src/app/superadmin/superadmin.component.html | 11 +- src/app/sys-check/sys-check.component.scss | 4 +- .../workspace-admin/workspace.component.html | 14 +- 21 files changed, 321 insertions(+), 146 deletions(-) create mode 100644 src/app/app-root/admin-starter/admin-starter.component.html create mode 100644 src/app/app-root/admin-starter/admin-starter.component.spec.ts create mode 100644 src/app/app-root/admin-starter/admin-starter.component.ts delete mode 100644 src/app/app-root/app-root.component.html delete mode 100644 src/app/app-root/app-status/app-status.component.css delete mode 100644 src/app/app-root/app-status/app-status.component.html delete mode 100644 src/app/app-root/app-status/app-status.component.ts create mode 100644 src/app/app-root/code-input/code-input.component.html rename src/app/app-root/{app-status/app-status.component.spec.ts => code-input/code-input.component.spec.ts} (61%) create mode 100644 src/app/app-root/code-input/code-input.component.ts create mode 100644 src/app/app-routing-guards.ts diff --git a/src/app/app-root/admin-starter/admin-starter.component.html b/src/app/app-root/admin-starter/admin-starter.component.html new file mode 100644 index 00000000..f8c4e18e --- /dev/null +++ b/src/app/app-root/admin-starter/admin-starter.component.html @@ -0,0 +1,18 @@ +<mat-card fxFlex="0 0 400px" fxLayout="column"> + <mat-card-title>Verwaltung: Bitte Studie wählen</mat-card-title> + <mat-card-content> + <div fxLayoutGap="10px" fxLayout="column"> + <p *ngIf="(mds.loginData$ | async)?.workspaces.length === 0"> + Sie sind mit Administrator-Funktionen angemeldet. Aktuell sind keine Studien für Sie freigegeben. + </p> + <button mat-raised-button color="primary" (click)="buttonGotoWorkspaceAdmin(ws)" + *ngFor="let ws of (mds.loginData$ | async)?.workspaces"> + {{ws.name}} + </button> + </div> + </mat-card-content> + <mat-card-actions> + <button mat-raised-button color="foreground" *ngIf="(mds.loginData$ | async)?.isSuperadmin" [routerLink]="['/superadmin']">System-Admin</button> + <button mat-raised-button color="foreground" (click)="resetLogin()">Neu anmelden</button> + </mat-card-actions> +</mat-card> diff --git a/src/app/app-root/admin-starter/admin-starter.component.spec.ts b/src/app/app-root/admin-starter/admin-starter.component.spec.ts new file mode 100644 index 00000000..f617ed0d --- /dev/null +++ b/src/app/app-root/admin-starter/admin-starter.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AdminStarterComponent } from './admin-starter.component'; + +describe('WorkspaceAdminStarterComponent', () => { + let component: AdminStarterComponent; + let fixture: ComponentFixture<AdminStarterComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AdminStarterComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdminStarterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/app-root/admin-starter/admin-starter.component.ts b/src/app/app-root/admin-starter/admin-starter.component.ts new file mode 100644 index 00000000..e9904c89 --- /dev/null +++ b/src/app/app-root/admin-starter/admin-starter.component.ts @@ -0,0 +1,24 @@ +import { Component } from '@angular/core'; +import {MainDataService} from "../../maindata.service"; +import {WorkspaceData} from "../../app.interfaces"; +import {Router} from "@angular/router"; + +@Component({ + templateUrl: './admin-starter.component.html', +}) +export class AdminStarterComponent { + + constructor( + private router: Router, + public mds: MainDataService + ) { } + + buttonGotoWorkspaceAdmin(ws: WorkspaceData) { + this.router.navigateByUrl('/admin/' + ws.id.toString() + '/files'); + } + + resetLogin() { + this.mds.setNewLoginData(); + this.router.navigate(['/']); + } +} diff --git a/src/app/app-root/app-root.component.html b/src/app/app-root/app-root.component.html deleted file mode 100644 index 4b415943..00000000 --- a/src/app/app-root/app-root.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<div class="root-frame" fxLayout="row wrap" fxLayoutAlign="center stretch"> - <router-outlet></router-outlet> -</div> diff --git a/src/app/app-root/app-root.component.ts b/src/app/app-root/app-root.component.ts index 79aab753..85788888 100644 --- a/src/app/app-root/app-root.component.ts +++ b/src/app/app-root/app-root.component.ts @@ -1,36 +1,30 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {MainDataService} from "../maindata.service"; -import {FormControl, FormGroup, Validators} from "@angular/forms"; -import {CustomtextService} from "iqb-components"; +import {Component} from '@angular/core'; @Component({ - selector: 'app-app-root', - templateUrl: './app-root.component.html', + template: `<div class="root-frame" fxLayout="row wrap" fxLayoutAlign="center stretch"> + <router-outlet></router-outlet> + </div> + `, styles: ['.root-frame {padding: 80px;}'] }) -export class AppRootComponent implements OnInit, OnDestroy { - loginForm = new FormGroup({ - name: new FormControl('', [Validators.required, Validators.minLength(3)]), - pw: new FormControl('') - }); - +export class AppRootComponent { +/* constructor( public mds: MainDataService, - public cts: CustomtextService + private router: Router, + private route: ActivatedRoute ) { } ngOnInit(): void { - } - - login() { - const loginData = this.loginForm.value; - this.mds.appError$.next({ - label: loginData['name'], - description: loginData['pw'], - category: "FATAL" - }) - } - - ngOnDestroy() { - } + const loginData = this.mds.loginData$.getValue(); + if (loginData.adminToken.length > 0) { + this.router.navigate(['./admin-starter'], {relativeTo: this.route}); + } else if (loginData.loginToken.length > 0) { + this.router.navigate(['./code-input'], {relativeTo: this.route}); + } else if (loginData.personToken.length > 0) { + this.router.navigate(['./test-starter'], {relativeTo: this.route}); + } else { + this.router.navigate(['./login'], {relativeTo: this.route}); + } + } */ } diff --git a/src/app/app-root/app-status/app-status.component.css b/src/app/app-root/app-status/app-status.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/app-root/app-status/app-status.component.html b/src/app/app-root/app-status/app-status.component.html deleted file mode 100644 index a36e38a5..00000000 --- a/src/app/app-root/app-status/app-status.component.html +++ /dev/null @@ -1 +0,0 @@ -<p>app-status works!</p> diff --git a/src/app/app-root/app-status/app-status.component.ts b/src/app/app-root/app-status/app-status.component.ts deleted file mode 100644 index a2c6b53b..00000000 --- a/src/app/app-root/app-status/app-status.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-app-status', - templateUrl: './app-status.component.html', - styleUrls: ['./app-status.component.css'] -}) -export class AppStatusComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/app-root/code-input/code-input.component.html b/src/app/app-root/code-input/code-input.component.html new file mode 100644 index 00000000..ef7d7b48 --- /dev/null +++ b/src/app/app-root/code-input/code-input.component.html @@ -0,0 +1,15 @@ +<mat-card fxFlex="0 0 400px"> + <form [formGroup]="codeinputform" (ngSubmit)="codeinput()"> + <mat-card-title>{{ 'login_codeInputTitle' | customtext:'login_codeInputTitle':cts.updateCount }}</mat-card-title> + <mat-card-subtitle>{{ 'login_codeInputPrompt' | customtext:'login_codeInputPrompt':cts.updateCount }}</mat-card-subtitle> + <mat-card-content> + <mat-form-field> + <input matInput formControlName="code" (keyup.enter)="codeinput()"> <!-- no placeholder! --> + </mat-form-field> + </mat-card-content> + <mat-card-actions> + <button mat-raised-button type="submit" [disabled]="codeinputform.invalid" color="primary">Weiter</button> + <button mat-raised-button color="foreground" (click)="resetLogin()">Neu anmelden</button> + </mat-card-actions> + </form> +</mat-card> diff --git a/src/app/app-root/app-status/app-status.component.spec.ts b/src/app/app-root/code-input/code-input.component.spec.ts similarity index 61% rename from src/app/app-root/app-status/app-status.component.spec.ts rename to src/app/app-root/code-input/code-input.component.spec.ts index f97e369e..fbcbd63c 100644 --- a/src/app/app-root/app-status/app-status.component.spec.ts +++ b/src/app/app-root/code-input/code-input.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { AppStatusComponent } from './app-status.component'; +import { CodeInputComponent } from './code-input.component'; describe('AppStatusComponent', () => { - let component: AppStatusComponent; - let fixture: ComponentFixture<AppStatusComponent>; + let component: CodeInputComponent; + let fixture: ComponentFixture<CodeInputComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AppStatusComponent ] + declarations: [ CodeInputComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(AppStatusComponent); + fixture = TestBed.createComponent(CodeInputComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/app-root/code-input/code-input.component.ts b/src/app/app-root/code-input/code-input.component.ts new file mode 100644 index 00000000..90d5afcd --- /dev/null +++ b/src/app/app-root/code-input/code-input.component.ts @@ -0,0 +1,58 @@ +import { Component } from '@angular/core'; +import {Router} from "@angular/router"; +import {MainDataService} from "../../maindata.service"; +import {FormControl, FormGroup, Validators} from "@angular/forms"; +import {CustomtextService, MessageDialogComponent, MessageDialogData, MessageType} from "iqb-components"; +import {MatDialog} from "@angular/material/dialog"; + +@Component({ + templateUrl: './code-input.component.html' +}) +export class CodeInputComponent { + codeinputform = new FormGroup({ + code: new FormControl('', [Validators.required, Validators.minLength(2)]), + }); + + constructor( + private router: Router, + public messageDialog: MatDialog, + public cts: CustomtextService, + public mds: MainDataService + ) { } + + codeinput() { + const loginData = this.mds.loginData$.getValue(); + const validCodes = Object.keys(loginData.booklets); + const myCode = this.codeinputform.get('code').value as string; + if (myCode.length === 0) { + this.messageDialog.open(MessageDialogComponent, { + width: '400px', + data: <MessageDialogData>{ + // @ts-ignore + title: this.cts.getCustomText('login_codeInputTitle') + ': Leer', + // @ts-ignore + content: this.cts.getCustomText('login_codeInputPrompt'), + type: MessageType.error + } + }); + } else if (validCodes.indexOf(myCode) < 0) { + this.messageDialog.open(MessageDialogComponent, { + width: '400px', + data: <MessageDialogData>{ + // @ts-ignore + title: this.cts.getCustomText('login_codeInputTitle') + ': Ungültig', + // @ts-ignore + content: this.cts.getCustomText('login_codeInputPrompt'), + type: MessageType.error + } + }); + } else { + this.mds.setCode(myCode); + } + } + + resetLogin() { + this.mds.setNewLoginData(); + this.router.navigate(['/']); + } +} diff --git a/src/app/app-root/login/login.component.ts b/src/app/app-root/login/login.component.ts index afa6861b..ad34ace6 100644 --- a/src/app/app-root/login/login.component.ts +++ b/src/app/app-root/login/login.component.ts @@ -1,9 +1,12 @@ import {Component, OnDestroy, OnInit} from '@angular/core'; import {FormControl, FormGroup, Validators} from "@angular/forms"; import {MainDataService} from "../../maindata.service"; -import {CustomtextService} from "iqb-components"; +import {CustomtextService, ServerError} from "iqb-components"; import {ActivatedRoute, Router} from "@angular/router"; import {Subscription} from "rxjs"; +import {appconfig} from "../../app.config"; +import {LoginData} from "../../app.interfaces"; +import {BackendService} from "../../backend.service"; @Component({ templateUrl: './login.component.html', @@ -26,6 +29,7 @@ export class LoginComponent implements OnInit, OnDestroy { constructor( public mds: MainDataService, public cts: CustomtextService, + private bs: BackendService, private router: Router, private route: ActivatedRoute ) { } @@ -37,16 +41,48 @@ export class LoginComponent implements OnInit, OnDestroy { } login() { + this.mds.incrementDelayedProcessesCount(); const loginData = this.loginForm.value; LoginComponent.oldLoginName = loginData['name']; - this.mds.appError$.next({ - label: loginData['name'], - description: loginData['pw'], - category: "FATAL" - }); - if (this.returnTo) { - this.router.navigateByUrl(this.returnTo); - } + this.bs.login(loginData['name'], loginData['pw']).subscribe( + loginData => { + if (loginData instanceof ServerError) { + const e = loginData as ServerError; + this.mds.appError$.next({ + label: e.labelNice, + description: e.labelSystem + ' (' + e.code.toString + ')', + category: "PROBLEM" + }); + this.mds.addCustomtextsFromDefList(appconfig.customtextsLogin); + // no change in other data + } else { + if ((loginData as LoginData).customTexts) { + this.cts.addCustomTexts((loginData as LoginData).customTexts); + } + this.mds.setNewLoginData(loginData as LoginData); + + if (this.returnTo) { + this.router.navigateByUrl(this.returnTo); + } else { + const loginDataCleaned = this.mds.loginData$.getValue(); + if (loginDataCleaned.adminToken.length > 0) { + this.router.navigate(['../admin-starter'], {relativeTo: this.route}); + } else if (loginDataCleaned.loginToken.length > 0) { + this.router.navigate(['../code-input'], {relativeTo: this.route}); + } else if (loginDataCleaned.personToken.length > 0) { + this.router.navigate(['../test-starter'], {relativeTo: this.route}); + } else { + this.mds.appError$.next({ + label: 'Keine Berechtigung für diese Anmeldedaten gefunden.', + description: 'Request ohne Fehler, aber kein Token?!', + category: "PROBLEM" + }); + } + } + } + this.mds.decrementDelayedProcessesCount(); + } + ); } ngOnDestroy() { diff --git a/src/app/app-routing-guards.ts b/src/app/app-routing-guards.ts new file mode 100644 index 00000000..2ba5fb0d --- /dev/null +++ b/src/app/app-routing-guards.ts @@ -0,0 +1,18 @@ +import {Injectable} from "@angular/core"; +import {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot} from "@angular/router"; +import {MainDataService} from "./maindata.service"; +import {Observable} from "rxjs"; + +@Injectable() +export class AdminRouteActivateGuard implements CanActivate { + constructor( + private mds: MainDataService, + ) { + } + + canActivate( + next: ActivatedRouteSnapshot, + state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean { + + } +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e18980da..812657c4 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -5,16 +5,19 @@ import { Routes, RouterModule } from '@angular/router'; import {AppRootComponent} from "./app-root/app-root.component"; import {LoginComponent} from "./app-root/login/login.component"; import {SysCheckStarterComponent} from "./app-root/sys-check-starter/sys-check-starter.component"; +import {AdminStarterComponent} from "./app-root/admin-starter/admin-starter.component"; +import {CodeInputComponent} from "./app-root/code-input/code-input.component"; const routes: Routes = [ {path: '', redirectTo: 'r', pathMatch: 'full'}, {path: 'r', component: AppRootComponent, children: [ - {path: '', redirectTo: 'login', pathMatch: 'full'}, {path: 'login/:returnTo', component: LoginComponent}, {path: 'about', component: AboutComponent}, {path: 'check-starter', component: SysCheckStarterComponent}, + {path: 'admin-starter', component: AdminStarterComponent}, + {path: 'code-input', component: CodeInputComponent}, {path: '**', component: LoginComponent} ] }, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ccba6872..2216949f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -38,78 +38,72 @@ export class AppComponent implements OnInit, OnDestroy { } ngOnInit() { - this.mds.addCustomtextsFromDefList(appconfig.customtextsApp); - this.mds.addCustomtextsFromDefList(appconfig.customtextsLogin); - this.mds.addCustomtextsFromDefList(appconfig.customtextsBooklet); - - this.appErrorSubscription = this.mds.appError$.subscribe(err => { - if (err) { - this.showError = true; - } - }); + setTimeout(() => { + this.mds.addCustomtextsFromDefList(appconfig.customtextsApp); + this.mds.addCustomtextsFromDefList(appconfig.customtextsLogin); + this.mds.addCustomtextsFromDefList(appconfig.customtextsBooklet); - window.addEventListener('message', (event: MessageEvent) => { - const msgData = event.data; - const msgType = msgData['type']; - if ((msgType !== undefined) && (msgType !== null)) { - if (msgType.substr(0, 3) === 'vo.') { - this.mds.postMessage$.next(event); + this.appErrorSubscription = this.mds.appError$.subscribe(err => { + if (err) { + this.showError = true; } - } - }); + }); - this.bs.getSysConfig().subscribe(sc => { - this.mds.setDefaultCustomtexts(sc); - this.mds.addCustomtextsFromDefList(appconfig.customtextsApp); - // restore login status if stored in localStorage - const adminToken = AppComponent.getStringFromLocalStorage('at'); - if (adminToken) { - this.bs.getAdminSession(adminToken).subscribe( - (admindata: LoginData) => { - if (admindata instanceof ServerError) { - this.mds.setNewLoginData(); - } else { - this.mds.setNewLoginData(admindata); - } + window.addEventListener('message', (event: MessageEvent) => { + const msgData = event.data; + const msgType = msgData['type']; + if ((msgType !== undefined) && (msgType !== null)) { + if (msgType.substr(0, 3) === 'vo.') { + this.mds.postMessage$.next(event); } - ); - } else { - const loginToken = AppComponent.getStringFromLocalStorage('lt'); - if (loginToken) { - const personToken = AppComponent.getStringFromLocalStorage('pt'); - let bookletDbId = 0; - if (personToken) { - const bookletDbIdStr = AppComponent.getStringFromLocalStorage('bi'); - if (bookletDbIdStr) { - bookletDbId = Number(bookletDbIdStr); // TODO: not used after assigning? - } - } - const code = AppComponent.getStringFromLocalStorage('c'); + } + }); - // bookletDbId is not yet checked by getLoginData, only passed-through - this.bs.getSession(loginToken, personToken).subscribe(ld => { - if (ld instanceof ServerError) { - this.mds.setNewLoginData(); - } else { - const loginData = ld as LoginData; - loginData.loginToken = loginToken; - loginData.personToken = personToken; - if (personToken.length === 0) { - loginData.code = code; - loginData.testId = 0; - } - this.mds.setNewLoginData(loginData); - if (loginData.customTexts) { - this.cts.addCustomTexts(loginData.customTexts); + this.bs.getSysConfig().subscribe(sc => { + this.mds.setDefaultCustomtexts(sc); + this.mds.addCustomtextsFromDefList(appconfig.customtextsApp); + // restore login status if stored in localStorage + const adminToken = AppComponent.getStringFromLocalStorage('at'); + if (adminToken) { + this.bs.getAdminSession(adminToken).subscribe( + (admindata: LoginData) => { + if (admindata instanceof ServerError) { + this.mds.setNewLoginData(); + } else { + this.mds.setNewLoginData(admindata); } } - }); + ); } else { - this.mds.setNewLoginData(); - this.mds.addCustomtextsFromDefList(appconfig.customtextsLogin); - this.mds.addCustomtextsFromDefList(appconfig.customtextsBooklet); + const loginToken = AppComponent.getStringFromLocalStorage('lt'); + if (loginToken) { + const personToken = AppComponent.getStringFromLocalStorage('pt'); + const code = AppComponent.getStringFromLocalStorage('c'); + + this.bs.getSession(loginToken, personToken).subscribe(ld => { + if (ld instanceof ServerError) { + this.mds.setNewLoginData(); + } else { + const loginData = ld as LoginData; + loginData.loginToken = loginToken; + loginData.personToken = personToken; + if (personToken.length === 0) { + loginData.code = code; + loginData.testId = 0; + } + this.mds.setNewLoginData(loginData); + if (loginData.customTexts) { + this.cts.addCustomTexts(loginData.customTexts); + } + } + }); + } else { + this.mds.setNewLoginData(); + this.mds.addCustomtextsFromDefList(appconfig.customtextsLogin); + this.mds.addCustomtextsFromDefList(appconfig.customtextsBooklet); + } } - } + }); }); } diff --git a/src/app/app.interfaces.ts b/src/app/app.interfaces.ts index e4e53795..fddbc074 100644 --- a/src/app/app.interfaces.ts +++ b/src/app/app.interfaces.ts @@ -12,6 +12,24 @@ export interface BookletListByCode { [code: string]: string[]; } +export enum AuthType { + LOGIN = "LOGIN", + ADMIN = "ADMIN", + PERSON = "PERSON", + SUPERADMIN = "SUPERADMIN" +} + +export interface AccessRightList { + [key: string]: string[]; +} + +export interface AuthData { + token: string; + authTypes: AuthType[]; + displayName: string; + accessRights: AccessRightList; +} + export interface LoginData { loginToken: string; personToken: string; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8b6ec3e3..96a42e44 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -31,7 +31,8 @@ import {RouterModule} from "@angular/router"; import { AppRootComponent } from './app-root/app-root.component'; import { SysCheckStarterComponent } from './app-root/sys-check-starter/sys-check-starter.component'; import { LoginComponent } from './app-root/login/login.component'; -import { AppStatusComponent } from './app-root/app-status/app-status.component'; +import { CodeInputComponent } from './app-root/code-input/code-input.component'; +import { AdminStarterComponent } from './app-root/admin-starter/admin-starter.component'; @@ -43,7 +44,8 @@ import { AppStatusComponent } from './app-root/app-status/app-status.component'; AppRootComponent, SysCheckStarterComponent, LoginComponent, - AppStatusComponent + CodeInputComponent, + AdminStarterComponent ], imports: [ ApplicationModule, diff --git a/src/app/maindata.service.ts b/src/app/maindata.service.ts index f73a6dcf..8f532622 100644 --- a/src/app/maindata.service.ts +++ b/src/app/maindata.service.ts @@ -58,6 +58,8 @@ export class MainDataService { this.delayedProcessesCount$.next(this.delayedProcessesCount$.getValue() - 1); } + + // ensures consistency setNewLoginData(logindata?: LoginData) { const myLoginData: LoginData = MainDataService.defaultLoginData; diff --git a/src/app/superadmin/superadmin.component.html b/src/app/superadmin/superadmin.component.html index d1a5470a..81c55274 100644 --- a/src/app/superadmin/superadmin.component.html +++ b/src/app/superadmin/superadmin.component.html @@ -1,12 +1,7 @@ -<div id="buttonsContainer" fxLayout="row" fxLayoutAlign="start center"> - <a [routerLink]="['/']"> - <img src="assets/IQB-LogoA.png" matTooltip="Startseite"/> - </a> - <div fxLayout="row wrap" fxLayoutAlign="space-around center" fxFlex> - <div class="error-msg">{{ (mds.globalErrorMsg$ | async)?.labelNice }}</div> - <div>IQB-Testcenter Systemverwaltung</div> - </div> +<div class="page-header"> + <p>IQB-Testcenter Systemverwaltung</p> </div> + <div class="page-body"> <div class="adminbackground"> diff --git a/src/app/sys-check/sys-check.component.scss b/src/app/sys-check/sys-check.component.scss index 8c5e8094..6dc3520d 100644 --- a/src/app/sys-check/sys-check.component.scss +++ b/src/app/sys-check/sys-check.component.scss @@ -1,4 +1,4 @@ -::ng-deep .scrollable { +::ng-deep .scrollable { /* TODO ng-deep is deprecated */ overflow: auto; box-sizing: border-box; position: absolute; @@ -16,6 +16,6 @@ mat-card { margin: 10px; } -::ng-deep .mat-card-header-text { +::ng-deep .mat-card-header-text { /* TODO ng-deep is deprecated */ margin-left: 0 !important; } diff --git a/src/app/workspace-admin/workspace.component.html b/src/app/workspace-admin/workspace.component.html index 6f5cf00c..8bd3f2db 100644 --- a/src/app/workspace-admin/workspace.component.html +++ b/src/app/workspace-admin/workspace.component.html @@ -1,17 +1,9 @@ -<div id="buttonsContainer" fxLayout="row" fxLayoutAlign="start center"> - <a [routerLink]="['/']"> - <img src="assets/IQB-LogoA.png" matTooltip="Startseite"/> - </a> - <div fxLayout="row wrap" fxLayoutAlign="space-between center" fxFlex> - <div class="error-msg">{{ (mds.globalErrorMsg$ | async)?.labelNice }}</div> - <div>IQB-Testcenter Verwaltung</div> - <div>{{ wds.wsName }} ({{ wds.wsRole }})</div> - </div> +<div class="page-header"> + <p>IQB-Testcenter Verwaltung: {{wds.wsName}} ({{ wds.wsRole }})</p> </div> + <div class="page-body"> <div class="adminbackground"> - - <nav mat-tab-nav-bar> <a mat-tab-link *ngFor="let link of wds.navLinks" -- GitLab