clean up mock data and update device interface

This commit is contained in:
Jesse Lucas 2020-03-16 15:13:49 -04:00
parent aebcc495f9
commit f250425ef1
6 changed files with 5 additions and 21 deletions

View File

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { SystemConfigService } from 'src/app/system-config.service';
import { Folder } from '../../folder'
import { cardElevation } from '../../style'
@Component({
@ -10,6 +11,7 @@ import { cardElevation } from '../../style'
export class FolderChartComponent implements OnInit {
chartID: string = 'foldersChart';
elevation: string = cardElevation;
data: Folder[];
constructor(private systemConfigService: SystemConfigService) { }

View File

@ -1,5 +1,5 @@
export interface Device {
id: string;
deviceID: string;
name: string;
// TODO add additional properties

View File

@ -68,7 +68,7 @@ export class DeviceListDataSource extends DataSource<Device> {
const isAsc = this.sort.direction === 'asc';
switch (this.sort.active) {
case 'name': return compare(a.name, b.name, isAsc);
case 'id': return compare(+a.id, +b.id, isAsc);
case 'id': return compare(+a.deviceID, +b.deviceID, isAsc);
default: return 0;
}
});

View File

@ -3,7 +3,7 @@
<!-- Id Column -->
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Id</th>
<td mat-cell *matCellDef="let row">{{row.id}}</td>
<td mat-cell *matCellDef="let row">{{row.deviceID}}</td>
</ng-container>
<!-- Name Column -->

View File

@ -1,17 +0,0 @@
import { Folder } from './folder';
import { Device } from './device';
export const FOLDERS: Folder[] = [
{ id: 'GXWxf-3zgnU', label: 'Downloads' },
{ id: 'PXWxf-3zgnU', label: 'Music' },
{ id: 'QXWxf-3zgnU', label: 'Photos' },
{ id: 'RXWxf-3zgnU', label: 'Movies' },
{ id: 'SXWxf-3zgnU', label: 'Folder 5' },
];
export const DEVICES: Device[] = [
{ id: '001', name: 'macbook' },
{ id: '002', name: 'bedroom computer' },
{ id: '003', name: 'server in closet' },
{ id: '004', name: 'random' },
];

View File

@ -6,7 +6,6 @@ import { map } from 'rxjs/operators';
import { Folder } from './folder';
import { Device } from './device';
import { FOLDERS, DEVICES } from './mock-config-data';
import { CookieService } from './cookie.service';
import { environment } from '../environments/environment'
import { apiURL } from './api-utils'