From 555675c31304699b45ee4d84144afb786c216224 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 7 Sep 2017 13:32:59 +0100 Subject: [PATCH] Add update to dashboard for widget graph types --- src/app/dashboard/dashboard.component.html | 6 +++++- src/app/dashboard/dashboard.component.ts | 5 +++++ src/app/dashboard/dashboard.module.ts | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 324e795..3e2cc46 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -23,7 +23,11 @@
- +
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 407d643..43ec8c1 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -3,6 +3,7 @@ import { Http, Response } from '@angular/http'; import { ApiService } from '../providers/api-service'; import { Router } from '@angular/router'; import { GraphWidget } from '../widgets/graph-widget.component'; +import { DataType } from '../shared/data-types.enum'; @Component({ templateUrl: 'dashboard.component.html' @@ -44,22 +45,26 @@ export class DashboardComponent implements OnInit { name: 'sales_last_7_days', icon: 'icon-diamond', title: 'Sales Last 7 Days', + dataType: DataType.currency, }, { type: 'graph', name: 'sales_last_30_days', icon: 'icon-diamond', title: 'Sales Last 30 Days', + dataType: DataType.currency, }, { type: 'graph', name: 'purchases_last_7_days', title: 'Purchases Last 7 Days', + dataType: DataType.currency, }, { type: 'graph', name: 'purchases_last_30_days', title: 'Purchases Last 30 Days', + dataType: DataType.currency, }, ]; diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts index 117f427..005e72b 100644 --- a/src/app/dashboard/dashboard.module.ts +++ b/src/app/dashboard/dashboard.module.ts @@ -4,6 +4,8 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ChartsModule } from 'ng2-charts/ng2-charts'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; +import { CurrencyPipe } from '@angular/common'; + import { DashboardComponent } from './dashboard.component'; import { DashboardCustomerComponent } from './dashboard-customer.component'; import { AccountEditComponent } from './account-edit.component'; @@ -35,6 +37,9 @@ import { OrgTableComponent } from '../shared/org-table.component'; OrgTableComponent, FeedbackComponent, GraphWidget, - ] + ], + providers: [ + CurrencyPipe + ], }) export class DashboardModule { }