File

src/app/test-controller/test-status/test-status.component.ts

Implements

OnInit

Metadata

styleUrls ./test-status.component.css
templateUrl ./test-status.component.html

Index

Properties
Methods

Constructor

constructor(tcs: TestControllerService)
Parameters :
Name Type Optional
tcs TestControllerService No

Methods

ngOnInit
ngOnInit()
Returns : void
terminateTest
terminateTest()
Returns : void

Properties

loginName
Type : string
Default value : '??'
Public tcs
Type : TestControllerService
import { Component, OnInit } from '@angular/core';
import { TestControllerService } from '../test-controller.service';
import { MainDataService } from '../../maindata.service';

@Component({
  templateUrl: './test-status.component.html',
  styleUrls: ['./test-status.component.css']
})

export class TestStatusComponent implements OnInit {
  loginName = '??';

  constructor(
    public tcs: TestControllerService
  ) { }

  ngOnInit(): void {
    setTimeout(() => {
      const authData = MainDataService.getAuthData();
      if (authData) {
        this.loginName = authData.displayName;
      }
    });
  }

  terminateTest(): void {
    this.tcs.terminateTest('BOOKLETLOCKEDbyTESTEE');
  }
}
<div class="status-body">
  <div fxLayout="row wrap" fxLayoutAlign="center stretch">

    <mat-card fxFlex="0 0 400px" fxLayout="column" class="mat-card-box"
              *ngIf="tcs.currentUnitSequenceId > 0 && ((tcs.testStatus$ | async) === tcs.testStatusEnum.ERROR) || ((tcs.testStatus$ | async) === tcs.testStatusEnum.PAUSED) || ((tcs.testStatus$ | async) === tcs.testStatusEnum.RUNNING)">
      <mat-card-title>{{ tcs.rootTestlet?.title }}</mat-card-title>
      <mat-card-content>
        <p><b>Angemeldet als "{{loginName}}"</b></p>
        <p><b>{{tcs.testMode.modeLabel}}</b></p>
        <p *ngIf="(tcs.testStatus$ | async) === tcs.testStatusEnum.ERROR" style="color: chocolate">
          <b>{{ 'Es ist ein Fehler aufgetreten.' | customtext:'booklet_errormessage' | async }} </b>
        </p>
        <p *ngIf="(tcs.testStatus$ | async) === tcs.testStatusEnum.PAUSED" style="color: chocolate">
          <b>{{ 'Testpause' | customtext:'booklet_pausedmessage' | async }} </b>
        </p>
        <p *ngIf="(tcs.testStatus$ | async) === tcs.testStatusEnum.RUNNING" style="color: chocolate">
          <b>Der Test ist aktiv.</b>
        </p>
      </mat-card-content>
      <mat-card-actions *ngIf="(tcs.testStatus$ | async) !== tcs.testStatusEnum.PAUSED">
        <button mat-raised-button color="primary" (click)="terminateTest()">
          {{ 'Test beenden'  | customtext:'login_testEndButtonLabel' | async}}
        </button>
      </mat-card-actions>
    </mat-card>

    <mat-card *ngIf="(tcs.testStatus$ | async) === tcs.testStatusEnum.LOADING" class="progress-bar">
      <mat-card-title>{{ tcs.rootTestlet?.title }} - bitte warten</mat-card-title>
      <mat-card-content fxLayout="column">
        <mat-progress-bar
          color="primary"
          mode="determinate"
          [value]="tcs.loadProgressValue">
        </mat-progress-bar>
      </mat-card-content>
    </mat-card>

  </div>
</div>

./test-status.component.css

.status-body {
  position: absolute;
  width: 100%;
}

mat-card {
  margin: 10px;
}

.mat-card-box {
  background-color: var(--tc-box-background)
}

.active-unit {
  background-color: #b2ff59;
  padding: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.non-active-unit {
  background-color: transparent;
  padding: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.testlet-marker-non {
  background-color: transparent;
}

.testlet-marker-a {
  background-color: royalblue;
}

.testlet-marker-b {
  background-color: mediumorchid;
}
.progress-bar {
  position: absolute;
  right: 150px;
  top: 300px;
  left: 150px;
  z-index: 999;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""