create style.ts to set elevation for all dashboard components

This commit is contained in:
Jesse Lucas 2020-03-16 13:53:07 -04:00
parent eaffbc0f92
commit aebcc495f9
11 changed files with 37 additions and 20 deletions

View File

@ -1 +1,7 @@
<p>device-chart works!</p>
<mat-card class="{{elevation}}">
<mat-card-title>Devices</mat-card-title>
<mat-card-content>
<app-donut-chart [elementID]=" chartID">
</app-donut-chart>
</mat-card-content>
</mat-card>

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { cardElevation } from '../../style';
@Component({
selector: 'app-device-chart',
@ -6,6 +7,8 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./device-chart.component.scss']
})
export class DeviceChartComponent implements OnInit {
chartID: string = 'devicesChart';
elevation: string = cardElevation;
constructor() { }

View File

@ -1 +1,6 @@
<p>folder-chart works!</p>
<mat-card class="{{elevation}}">
<mat-card-title>Folders</mat-card-title>
<mat-card-content>
<app-donut-chart [elementID]="chartID"></app-donut-chart>
</mat-card-content>
</mat-card>

View File

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { SystemConfigService } from 'src/app/system-config.service';
import { cardElevation } from '../../style'
@Component({
selector: 'app-folder-chart',
@ -6,10 +8,17 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./folder-chart.component.scss']
})
export class FolderChartComponent implements OnInit {
chartID: string = 'foldersChart';
elevation: string = cardElevation;
constructor() { }
constructor(private systemConfigService: SystemConfigService) { }
ngOnInit(): void {
this.systemConfigService.getFolders().subscribe(
data => {
console.log("char folder data", data)
}
);
}
}

View File

@ -4,20 +4,10 @@
<h1>Tech UI</h1>
</div>
<div gdArea="folders">
<mat-card>
<mat-card-title>Folders</mat-card-title>
<mat-card-content>
<app-donut-chart [elementID]="foldersChart"></app-donut-chart>
</mat-card-content>
</mat-card>
<app-folder-chart></app-folder-chart>
</div>
<div gdArea="devices">
<mat-card>
<mat-card-title>Devices</mat-card-title>
<mat-card-content>
<app-donut-chart [elementID]="devicesChart"></app-donut-chart>
</mat-card-content>
</mat-card>
<app-device-chart></app-device-chart>
</div>
<app-status-list gdArea="status-list"></app-status-list>
<div gdArea="footer">

View File

@ -7,8 +7,7 @@ import { SystemConfigService } from '../system-config.service';
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent {
foldersChart = 'foldersChart';
devicesChart = 'devicesChart';
constructor(private systemConfigService: SystemConfigService) { }

View File

@ -1,4 +1,4 @@
<div class="mat-elevation-z8">
<div class="{{elevation}}">
<table mat-table class="full-width-table" matSort aria-label="Elements">
<!-- Id Column -->
<ng-container matColumnDef="id">

View File

@ -6,6 +6,7 @@ import { MatTable } from '@angular/material/table';
import { DeviceListDataSource } from './device-list-datasource';
import { Device } from '../../device';
import { SystemConfigService } from '../../system-config.service';
import { cardElevation } from '../../style';
@Component({
@ -18,6 +19,7 @@ export class DeviceListComponent implements AfterViewInit, OnInit {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatTable) table: MatTable<Device>;
dataSource: DeviceListDataSource;
elevation: string = cardElevation;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['id', 'name'];

View File

@ -1,4 +1,4 @@
<div class="mat-elevation-z8">
<div class="{{elevation}}">
<table mat-table class="full-width-table" matSort aria-label="Elements">
<!-- Id Column -->
<ng-container matColumnDef="id">

View File

@ -6,7 +6,7 @@ import { MatTable } from '@angular/material/table';
import { FolderListDataSource } from './folder-list-datasource';
import { Folder } from '../../folder';
import { SystemConfigService } from '../../system-config.service';
import { cardElevation } from '../../style';
@Component({
selector: 'app-folder-list',
@ -18,6 +18,7 @@ export class FolderListComponent implements AfterViewInit, OnInit {
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatTable) table: MatTable<Folder>;
dataSource: FolderListDataSource;
elevation: string = cardElevation;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['id', 'label'];

2
src/app/style.ts Normal file
View File

@ -0,0 +1,2 @@
// material design elevation for all dashboard components
export const cardElevation: string = "mat-elevation-z2";