Skip to content

chore: fix dashboard deployment #7632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@angular/platform-browser-dynamic": "^4.4.4",
"@angular/router": "^4.4.4",
"@swimlane/ngx-charts": "^6.0.0",
"angularfire2": "^4.0.0-rc.1",
"angularfire2": "^5.0.0-rc.2",
"core-js": "^2.4.1",
"d3": "^4.9.1",
"firebase": "^4.1.3",
"firebase": "^4.5.0",
"rxjs": "^5.4.2",
"zone.js": "^0.8.12"
},
Expand Down
5 changes: 4 additions & 1 deletion tools/dashboard/src/app/coverage-chart/coverage-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
[autoScale]="true">
</ngx-charts-line-chart>

<mat-spinner *ngIf="!chartData.length" class="coverage-chart-loading"></mat-spinner>
<mat-spinner *ngIf="!chartData.length" class="panel-loading-indicator"
[diameter]="50"
[strokeWidth]="5">
</mat-spinner>
20 changes: 0 additions & 20 deletions tools/dashboard/src/app/coverage-chart/coverage-chart.scss
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
$coverage-chart-loading-size: 50px;

:host {
display: block;
position: relative;

height: 400px;
width: 100%;
max-width: 700px;
}

.coverage-chart-loading {
position: absolute;

top: calc(50% - #{$coverage-chart-loading-size});
left: calc(50% - #{$coverage-chart-loading-size});

height: $coverage-chart-loading-size;
width: $coverage-chart-loading-size;
}
5 changes: 4 additions & 1 deletion tools/dashboard/src/app/coverage-chart/coverage-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {NgxChartResult} from '../ngx-definitions';
selector: 'coverage-chart',
templateUrl: './coverage-chart.html',
styleUrls: ['./coverage-chart.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'class': 'dashboard-panel'
}
})
export class CoverageChart {

Expand Down
11 changes: 6 additions & 5 deletions tools/dashboard/src/app/dashboard-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Component} from '@angular/core';
import {AngularFireDatabase, FirebaseListObservable} from 'angularfire2/database';
import {AngularFireDatabase} from 'angularfire2/database';
import {Observable} from 'rxjs/Observable';

// This import is only used to define a generic type. The current TypeScript version incorrectly
// considers such imports as unused (https://github.com/Microsoft/TypeScript/issues/14953)
Expand All @@ -14,14 +15,14 @@ import {PayloadResult, CoverageResult} from './data-definitions';
export class DashboardApp {

/** Observable that emits all payload results from Firebase. */
payloads: FirebaseListObservable<PayloadResult[]>;
payloads: Observable<PayloadResult[]>;

/** Observable that emits all coverage reports from Firebase. */
coverage: FirebaseListObservable<CoverageResult[]>;
coverage: Observable<CoverageResult[]>;

constructor(database: AngularFireDatabase) {
this.payloads = database.list(`payloads`);
this.coverage = database.list(`coverage-reports`);
this.payloads = database.list(`payloads`).valueChanges();
this.coverage = database.list(`coverage-reports`).valueChanges();
}
}

5 changes: 4 additions & 1 deletion tools/dashboard/src/app/payload-chart/payload-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
[autoScale]="true">
</ngx-charts-line-chart>

<mat-spinner *ngIf="!chartData.length" class="payload-chart-loading"></mat-spinner>
<mat-spinner *ngIf="!chartData.length" class="panel-loading-indicator"
[diameter]="50"
[strokeWidth]="5">
</mat-spinner>
20 changes: 0 additions & 20 deletions tools/dashboard/src/app/payload-chart/payload-chart.scss
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
$payload-chart-loading-size: 50px;

:host {
display: block;
position: relative;

height: 400px;
width: 100%;
max-width: 700px;
}

.payload-chart-loading {
position: absolute;

top: calc(50% - #{$payload-chart-loading-size});
left: calc(50% - #{$payload-chart-loading-size});

height: $payload-chart-loading-size;
width: $payload-chart-loading-size;
}
5 changes: 4 additions & 1 deletion tools/dashboard/src/app/payload-chart/payload-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {NgxChartItem, NgxChartResult} from '../ngx-definitions';
selector: 'payload-chart',
templateUrl: './payload-chart.html',
styleUrls: ['./payload-chart.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'class': 'dashboard-panel'
}
})
export class PayloadChart {

Expand Down
21 changes: 21 additions & 0 deletions tools/dashboard/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
$panel-loading-indicator-diameter: 50px;

body, html {
margin: 0;
font-family: Roboto, Arial, sans-serif;
min-height: 100vh;
}

.panel-loading-indicator {
position: absolute;

top: calc(50% - #{$panel-loading-indicator-diameter});
left: calc(50% - #{$panel-loading-indicator-diameter});

height: $panel-loading-indicator-diameter;
width: $panel-loading-indicator-diameter;
}

.dashboard-panel {
display: block;
position: relative;

height: 400px;
width: 100%;
max-width: 700px;
}