Skip to content

Commit 6f67e03

Browse files
devversionandrewseguin
authored andcommitted
chore: fix dashboard deployment (#7632)
* Fixes that the dashboard deployment fails due to incorrect dependencies with AngularFire. * Upgrades to the latest AngularFire version with a new API for the Realtime Database. * Less code duplication for different panels in the dashboard.
1 parent 9976988 commit 6f67e03

File tree

9 files changed

+45
-51
lines changed

9 files changed

+45
-51
lines changed

tools/dashboard/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"@angular/platform-browser-dynamic": "^4.4.4",
2323
"@angular/router": "^4.4.4",
2424
"@swimlane/ngx-charts": "^6.0.0",
25-
"angularfire2": "^4.0.0-rc.1",
25+
"angularfire2": "^5.0.0-rc.2",
2626
"core-js": "^2.4.1",
2727
"d3": "^4.9.1",
28-
"firebase": "^4.1.3",
28+
"firebase": "^4.5.0",
2929
"rxjs": "^5.4.2",
3030
"zone.js": "^0.8.12"
3131
},

tools/dashboard/src/app/coverage-chart/coverage-chart.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414
[autoScale]="true">
1515
</ngx-charts-line-chart>
1616

17-
<mat-spinner *ngIf="!chartData.length" class="coverage-chart-loading"></mat-spinner>
17+
<mat-spinner *ngIf="!chartData.length" class="panel-loading-indicator"
18+
[diameter]="50"
19+
[strokeWidth]="5">
20+
</mat-spinner>
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +0,0 @@
1-
$coverage-chart-loading-size: 50px;
2-
3-
:host {
4-
display: block;
5-
position: relative;
6-
7-
height: 400px;
8-
width: 100%;
9-
max-width: 700px;
10-
}
11-
12-
.coverage-chart-loading {
13-
position: absolute;
14-
15-
top: calc(50% - #{$coverage-chart-loading-size});
16-
left: calc(50% - #{$coverage-chart-loading-size});
17-
18-
height: $coverage-chart-loading-size;
19-
width: $coverage-chart-loading-size;
20-
}

tools/dashboard/src/app/coverage-chart/coverage-chart.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import {NgxChartResult} from '../ngx-definitions';
66
selector: 'coverage-chart',
77
templateUrl: './coverage-chart.html',
88
styleUrls: ['./coverage-chart.scss'],
9-
changeDetection: ChangeDetectionStrategy.OnPush
9+
changeDetection: ChangeDetectionStrategy.OnPush,
10+
host: {
11+
'class': 'dashboard-panel'
12+
}
1013
})
1114
export class CoverageChart {
1215

tools/dashboard/src/app/dashboard-app.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {Component} from '@angular/core';
2-
import {AngularFireDatabase, FirebaseListObservable} from 'angularfire2/database';
2+
import {AngularFireDatabase} from 'angularfire2/database';
3+
import {Observable} from 'rxjs/Observable';
34

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

1617
/** Observable that emits all payload results from Firebase. */
17-
payloads: FirebaseListObservable<PayloadResult[]>;
18+
payloads: Observable<PayloadResult[]>;
1819

1920
/** Observable that emits all coverage reports from Firebase. */
20-
coverage: FirebaseListObservable<CoverageResult[]>;
21+
coverage: Observable<CoverageResult[]>;
2122

2223
constructor(database: AngularFireDatabase) {
23-
this.payloads = database.list(`payloads`);
24-
this.coverage = database.list(`coverage-reports`);
24+
this.payloads = database.list(`payloads`).valueChanges();
25+
this.coverage = database.list(`coverage-reports`).valueChanges();
2526
}
2627
}
2728

tools/dashboard/src/app/payload-chart/payload-chart.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414
[autoScale]="true">
1515
</ngx-charts-line-chart>
1616

17-
<mat-spinner *ngIf="!chartData.length" class="payload-chart-loading"></mat-spinner>
17+
<mat-spinner *ngIf="!chartData.length" class="panel-loading-indicator"
18+
[diameter]="50"
19+
[strokeWidth]="5">
20+
</mat-spinner>
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +0,0 @@
1-
$payload-chart-loading-size: 50px;
2-
3-
:host {
4-
display: block;
5-
position: relative;
6-
7-
height: 400px;
8-
width: 100%;
9-
max-width: 700px;
10-
}
11-
12-
.payload-chart-loading {
13-
position: absolute;
14-
15-
top: calc(50% - #{$payload-chart-loading-size});
16-
left: calc(50% - #{$payload-chart-loading-size});
17-
18-
height: $payload-chart-loading-size;
19-
width: $payload-chart-loading-size;
20-
}

tools/dashboard/src/app/payload-chart/payload-chart.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import {NgxChartItem, NgxChartResult} from '../ngx-definitions';
66
selector: 'payload-chart',
77
templateUrl: './payload-chart.html',
88
styleUrls: ['./payload-chart.scss'],
9-
changeDetection: ChangeDetectionStrategy.OnPush
9+
changeDetection: ChangeDetectionStrategy.OnPush,
10+
host: {
11+
'class': 'dashboard-panel'
12+
}
1013
})
1114
export class PayloadChart {
1215

tools/dashboard/src/styles.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1+
$panel-loading-indicator-diameter: 50px;
2+
13
body, html {
24
margin: 0;
35
font-family: Roboto, Arial, sans-serif;
46
min-height: 100vh;
57
}
8+
9+
.panel-loading-indicator {
10+
position: absolute;
11+
12+
top: calc(50% - #{$panel-loading-indicator-diameter});
13+
left: calc(50% - #{$panel-loading-indicator-diameter});
14+
15+
height: $panel-loading-indicator-diameter;
16+
width: $panel-loading-indicator-diameter;
17+
}
18+
19+
.dashboard-panel {
20+
display: block;
21+
position: relative;
22+
23+
height: 400px;
24+
width: 100%;
25+
max-width: 700px;
26+
}

0 commit comments

Comments
 (0)