Skip to content

Commit

Permalink
latest items missing status information added (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Nov 4, 2022
1 parent f21908b commit 5147828
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/app/AppRoutingModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { AuthGuard } from "./auth.guard";
import { LoginComponent } from "./login/login.component";
import { CommonModule } from "@angular/common";
import { ReactiveFormsModule } from "@angular/forms";
import { NgbTooltipModule } from "@ng-bootstrap/ng-bootstrap";

const routes: Routes = [
{ path: "dashboard", component: DashboardComponent, canActivate: [AuthGuard] },
Expand All @@ -18,7 +19,7 @@ const routes: Routes = [

// configures NgModule imports and exports
@NgModule({
imports: [RouterModule.forRoot(routes), CommonModule, ReactiveFormsModule],
imports: [RouterModule.forRoot(routes), CommonModule, ReactiveFormsModule, NgbTooltipModule],
declarations: [
LoginComponent, DashboardComponent
],
Expand Down
5 changes: 5 additions & 0 deletions src/app/dashboard/dashboard.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@ tbody tr:hover {
font-weight: 600;
color: #4b7cf3;
}

.issue {
margin-left: 10px;
font-size: 19px;
}
11 changes: 10 additions & 1 deletion src/app/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,23 @@ <h6 class="card-header bg-transparent">Recent Test Runs</h6>
{{_.environment}}
</td>
<td class="ellipsis">
{{_.startTime | date:'d. L. yyyy H:mm'}}
{{_.overview.startDate | date:'d. L. yyyy H:mm'}}
</td>
<td>
<span *ngIf="_.status === '0'" title="Passed"><i class="fas fa-check-circle text-success status-icon"></i></span>
<span *ngIf="_.status === '1'" title="Error/Terminated"><i class="fas fa-minus-circle text-secondary status-icon"></i></span>
<span *ngIf="_.status === '2'" title="Terminated"><i class="fas fa-minus-circle text-secondary status-icon"></i></span>
<span *ngIf="_.status === '3'" title="Failed"><i class="fas fa-minus-circle text-danger status-icon"></i></span>
<span *ngIf="_.status === '10'" title="Status not set"><i class="far fa-circle text-secondary status-icon"></i></span>
<i *ngIf="_.thresholdPassed === false"
class="fas fa-exclamation-circle text-alizarin issue"></i>
<i *ngIf="_.zeroErrorToleranceEnabled && showZeroErrorToleranceWarning(_.overview.errorCount, _.overview.errorRate) === true" placement="bottom"
ngbTooltip="Errors occurred during the test run"><i class="fas fa-bug text-alizarin issue"></i></i>
<i *ngIf="_.zeroErrorToleranceEnabled && !showZeroErrorToleranceWarning(_.overview.errorCount, _.overview.errorRate)" placement="bottom"
ngbTooltip="No errors were detected"><i class="fas fa-check-square text-success issue"></i></i>
<i *ngIf="_.zeroErrorToleranceEnabled && showZeroErrorToleranceWarning(_.overview.errorCount, _.overview.errorRate) === 'unknown'" placement="bottom"
ngbTooltip="Not all required data are available"><i class="far fa-question-circle issue"></i></i>

</td>
</tr>
</tbody>
Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ProjectApiService } from "../project-api.service";
import { ItemsListing, ProjectsOverallStats } from "../items.service.model";
import { Router } from "@angular/router";
import { SharedMainBarService } from "../shared-main-bar.service";
import { showZeroErrorWarning } from "../utils/showZeroErrorTolerance";

@Component({
selector: "app-dashboard",
Expand Down Expand Up @@ -38,4 +39,9 @@ export class DashboardComponent implements OnInit {
open(projectName, scenarioName, itemId) {
this.router.navigate([`./project/${projectName}/scenario/${scenarioName}/item/${itemId}`]);
}

showZeroErrorToleranceWarning(errorCount, errorRate) {
return showZeroErrorWarning(errorRate, errorCount);

}
}
6 changes: 4 additions & 2 deletions src/app/items.service.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ export interface ItemsListing {
name: string;
projectName: string;
environment: string;
startTime: string;
status: string;
overview: ItemOverview;
zeroErrorToleranceEnabled: boolean;
thresholdPassed?: boolean
overview: ItemOverview

}

export interface Items {
Expand Down
2 changes: 1 addition & 1 deletion src/app/scenario/scenario.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, ChangeDetectorRef } from "@angular/core";
import { Component, OnInit, OnDestroy } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { of, Observable, Subscription } from "rxjs";
import { switchMap, catchError } from "rxjs/operators";
Expand Down

0 comments on commit 5147828

Please sign in to comment.