Add chart item component, StateType and getStateType to determine state from Folder

This commit is contained in:
Jesse Lucas
2020-03-29 16:51:12 -04:00
parent 32c849e18c
commit 02d14c7e9b
4 changed files with 105 additions and 29 deletions
@@ -2,8 +2,6 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import Folder from '../../folder'
import { cardElevation } from '../../style'
import { FolderService } from 'src/app/folder.service';
import { SystemConfigService } from 'src/app/system-config.service';
import { DbStatusService } from 'src/app/db-status.service';
import { DonutChartComponent } from '../donut-chart/donut-chart.component';
@Component({
@@ -15,16 +13,13 @@ export class FolderChartComponent implements OnInit {
@ViewChild(DonutChartComponent) donutChart: DonutChartComponent;
chartID: string = 'foldersChart';
elevation: string = cardElevation;
folderStates: Folder.stateType[];
constructor(
private systemConfigService: SystemConfigService,
private folderService: FolderService,
private dbStatusService: DbStatusService
) { }
constructor(private folderService: FolderService) { }
ngOnInit(): void {
//
for (let state in Folder.StateType) {
console.log(state);
}
}
ngAfterViewInit() {
@@ -34,8 +29,9 @@ export class FolderChartComponent implements OnInit {
// TODO: Clear existing data
this.donutChart.data([40]);
// state?
const state: string = Folder.statusToString(folder);
// Get StateType and convert to string
const stateType: Folder.StateType = Folder.getStateType(folder);
const state: string = Folder.stateTypeToString(stateType);
console.log("folder state?", state, folder);
}
);