diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index 5be3628..697c23c 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -19,85 +19,52 @@
-

Purchases Per Week

+

Purchases by Week

  • Last Week - {{ weekPurchaseList.week_1 || 0 }} ({{ (weekPurchaseList.week_1 || 0 ) / maxPurchase | percent:'1.0-0' }}) + {{ weekPurchaseList.second || 0 }} + ({{ (weekPurchaseList.second || 0 ) / weekPurchaseList.max | percent:'1.0-0' }})
    + [style.width]="(weekPurchaseList.second || 0 ) / weekPurchaseList.max | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • - 2 Weeks Ago - {{ weekPurchaseList.week_2 || 0 }} ({{ (weekPurchaseList.week_2 || 0 ) / maxPurchase | percent:'1.0-0' }}) + Week Maximum + {{ weekPurchaseList.max || 0 }} + (100%)
    + style="width: 100%" aria-valuemin="0" aria-valuemax="100">
  • - 3 Weeks Ago - {{ weekPurchaseList.week_3 || 0 }} ({{ (weekPurchaseList.week_3 || 0 ) / maxPurchase | percent:'1.0-0' }}) + Weekly Average + {{ (weekPurchaseList.sum / weekPurchaseList.count) || 0 | number:'1.0-0'}} + ({{ ((weekPurchaseList.sum / weekPurchaseList.count) || 0) / weekPurchaseList.max | percent:'1.0-0' }})
    -
    -
    -
  • -
  • - 4 Weeks Ago - {{ weekPurchaseList.week_4 || 0 }} ({{ (weekPurchaseList.week_4 || 0 ) / maxPurchase | percent:'1.0-0' }}) -
    -
    -
    -
    -
    -
  • -
  • - 5 Weeks Ago - {{ weekPurchaseList.week_5 || 0 }} ({{ (weekPurchaseList.week_5 || 0 ) / maxPurchase | percent:'1.0-0' }}) -
    -
    -
    -
    -
    -
  • -
  • - 6 Weeks Ago - {{ weekPurchaseList.week_6 || 0 }} ({{ (weekPurchaseList.week_6 || 0 ) / maxPurchase | percent:'1.0-0' }}) -
    -
    -
    + [style.width]="((weekPurchaseList.sum / weekPurchaseList.count) || 0) / weekPurchaseList.max | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • @@ -116,82 +83,19 @@
    diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index 832fbac..1d9b145 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -20,14 +20,14 @@ export class DashboardCustomerComponent implements OnInit { username: any; maxPurchase: number = 0; + disableSectorButton: boolean = false; + weekPurchaseList = { - week_0: 0, - week_1: 0, - week_2: 0, - week_3: 0, - week_4: 0, - week_5: 0, - week_6: 0, + first: 0, + second: 0, + max: 0, + sum: 0, + count: 0, }; sectorNames = { @@ -75,11 +75,12 @@ export class DashboardCustomerComponent implements OnInit { R: 'icon-film', S: 'icon-calendar', T: 'icon-home', - U: 'cion-globe', + U: 'icon-globe', } sectorLetters: string[] = []; sectorPurchases: number[] = []; + sectorLimit: number = 10; sectorList: any; @@ -130,19 +131,12 @@ export class DashboardCustomerComponent implements OnInit { public setWeekPurchaseList (data: any) { this.weekPurchaseList = { - week_0: data.purchases[0], - week_1: data.purchases[1], - week_2: data.purchases[2], - week_3: data.purchases[3], - week_4: data.purchases[4], - week_5: data.purchases[5], - week_6: data.purchases[6], + first: data.first, + second: data.second, + max: data.max, + sum: data.sum, + count: data.count, }; - this.maxPurchase = Object.keys(this.weekPurchaseList).map(key => this.weekPurchaseList[key]).reduce((a,b) => { - if (! a) { a = 0 } - if (! b) { b = 0 } - return Math.max(a,b); - }); } public setSectorList (data: any) { @@ -150,6 +144,11 @@ export class DashboardCustomerComponent implements OnInit { this.sectorPurchases = Object.keys(data.purchases).map(key => data.purchases[key]); } + public loadMore () { + this.disableSectorButton = true; + this.sectorLimit = 22; + } + ngOnInit(): void { } } diff --git a/src/app/snippets/cust-snippet-bar.component.html b/src/app/snippets/cust-snippet-bar.component.html index 80a44ef..9c9647f 100644 --- a/src/app/snippets/cust-snippet-bar.component.html +++ b/src/app/snippets/cust-snippet-bar.component.html @@ -2,25 +2,25 @@ diff --git a/src/scss/_custom.scss b/src/scss/_custom.scss index 269a40a..c9858d6 100644 --- a/src/scss/_custom.scss +++ b/src/scss/_custom.scss @@ -24,6 +24,18 @@ agm-map { width: 15%; } +// circle for text +// TODO: Make these resize based on inside content +.number-circle { + width:24%; + border-radius:50%; + text-align:center; + padding:12% 0; + line-height:0; + position:relative; + background: #20a8d8; + color: white; +} // white title font variant on type-2 as defined in _widgets.css .horizontal-bars { padding: 0;