From f250425ef1a541953a899d83201085a1336b4bbe Mon Sep 17 00:00:00 2001 From: Jesse Lucas Date: Mon, 16 Mar 2020 15:13:49 -0400 Subject: [PATCH] clean up mock data and update device interface --- .../folder-chart/folder-chart.component.ts | 2 ++ src/app/device.ts | 2 +- .../list/device-list/device-list-datasource.ts | 2 +- .../list/device-list/device-list.component.html | 2 +- src/app/mock-config-data.ts | 17 ----------------- src/app/system-config.service.ts | 1 - 6 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 src/app/mock-config-data.ts diff --git a/src/app/chart/folder-chart/folder-chart.component.ts b/src/app/chart/folder-chart/folder-chart.component.ts index 11bd0beb6..2ba7730bf 100644 --- a/src/app/chart/folder-chart/folder-chart.component.ts +++ b/src/app/chart/folder-chart/folder-chart.component.ts @@ -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) { } diff --git a/src/app/device.ts b/src/app/device.ts index 152e73d8a..a2a8cc078 100644 --- a/src/app/device.ts +++ b/src/app/device.ts @@ -1,5 +1,5 @@ export interface Device { - id: string; + deviceID: string; name: string; // TODO add additional properties diff --git a/src/app/list/device-list/device-list-datasource.ts b/src/app/list/device-list/device-list-datasource.ts index d2cbc6724..616ec89f2 100644 --- a/src/app/list/device-list/device-list-datasource.ts +++ b/src/app/list/device-list/device-list-datasource.ts @@ -68,7 +68,7 @@ export class DeviceListDataSource extends DataSource { 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; } }); diff --git a/src/app/list/device-list/device-list.component.html b/src/app/list/device-list/device-list.component.html index 495143a32..86d7bcfef 100644 --- a/src/app/list/device-list/device-list.component.html +++ b/src/app/list/device-list/device-list.component.html @@ -3,7 +3,7 @@ Id - {{row.id}} + {{row.deviceID}} diff --git a/src/app/mock-config-data.ts b/src/app/mock-config-data.ts deleted file mode 100644 index 2976df5b4..000000000 --- a/src/app/mock-config-data.ts +++ /dev/null @@ -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' }, -]; \ No newline at end of file diff --git a/src/app/system-config.service.ts b/src/app/system-config.service.ts index 98bcd4175..1869184a2 100644 --- a/src/app/system-config.service.ts +++ b/src/app/system-config.service.ts @@ -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'