From e9b659a4bb8f5b00a0f1cb2b7cc602255bffaa68 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Tue, 22 May 2018 12:57:25 +0100 Subject: [PATCH] Removed sector stuff on dashboard To be moved to organisation dashboard at later time --- .../dashboard-customer.component.html | 29 ------------------- .../dashboard/dashboard-customer.component.ts | 19 ++---------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index 133719e..7f650f0 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -164,34 +164,5 @@ -
-
-
-
-
-

All Purchases by Sector

-
-
-
-
    - -
  • - -
    -
    {{ sectorNames [sector] || 'N/A' }}
    -
    -
    -
    Bought
    - {{ sectorPurchases[i] || 'N/A' }} -
    -
  • -
  • - -
  • -
-
-
-
-
diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index f6abd47..ab40f2b 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -23,7 +23,6 @@ export class DashboardCustomerComponent implements OnInit { username: any; maxPurchase: number = 0; - disableSectorButton: boolean = false; disableCategoryButton: boolean = false; public chartType = 'doughnut'; @@ -173,12 +172,9 @@ export class DashboardCustomerComponent implements OnInit { U: 'bg-primary', } - sectorLetters: string[] = []; - sectorPurchases: number[] = []; - sectorLimit: number = 10; + showTotalCategoryList: boolean = false; totalCategoryLimit: number = 10; totalCategoryList: any; - sectorList: any; // Graph widgets public widgetList = [ @@ -218,11 +214,10 @@ export class DashboardCustomerComponent implements OnInit { this.api.customerStats().subscribe( result => { this.setWeekPurchaseList(result.weeks); - this.setSectorList(result.sectors); this.setWeekData(result); this.setChartData(result.data.cat_total); this.totalCategoryList = result.data.cat_list; - console.log(this.totalCategoryList); + this.showTotalCategoryList = true; this.purchaseEssential = result.data.essentials.purchase_no_essential_total; this.purchaseNotEssential = result.data.essentials.purchase_no_total - this.purchaseEssential; this.barChartDataEssential = [ @@ -277,16 +272,6 @@ export class DashboardCustomerComponent implements OnInit { }; } - public setSectorList (data: any) { - this.sectorLetters = Object.keys(data.sectors).map(key => data.sectors[key]); - this.sectorPurchases = Object.keys(data.purchases).map(key => data.purchases[key]); - } - - private sectorLoadMore () { - this.disableSectorButton = true; - this.sectorLimit = 22; - } - private categoryLoadMore () { this.disableCategoryButton = true; this.totalCategoryLimit = 30;