From d1d47785e584a2e4d9a29ff35815c227d1026363 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 25 Jan 2018 11:18:13 +0000 Subject: [PATCH 1/5] Changed to radio buttons on transaction category input --- src/app/dashboard/add-data.component.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index c778998..e5ee80f 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -27,13 +27,11 @@
-
- +
+
Optional: Choose the relevant Category for the purchase.
From 182679e9acaeecbdd3f721e260cda1bfad520493 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 25 Jan 2018 11:18:31 +0000 Subject: [PATCH 2/5] Changed percentages on budget view screen --- .../dashboard/category-month.component.html | 24 +++++++++---------- src/app/dashboard/category-month.component.ts | 16 ++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/app/dashboard/category-month.component.html b/src/app/dashboard/category-month.component.html index 5b5434d..0a7c91f 100644 --- a/src/app/dashboard/category-month.component.html +++ b/src/app/dashboard/category-month.component.html @@ -5,7 +5,7 @@
-

Purchases this week

+

Purchases Last Week

@@ -13,11 +13,11 @@
  • {{ categoryNameList[categoryEntry.category] || 'Uncategorised' }} {{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} - ({{ (categoryEntry.value || 0 ) / weekListValueMax1 | percent:'1.0-0' }}) + ({{ (categoryEntry.value || 0 ) / weekListValueSum1 | percent:'1.0-0' }})
    + [style.width]="(categoryEntry.value || 0 ) / weekListValueSum1 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • @@ -36,7 +36,7 @@
    -

    Purchases last week

    +

    Purchases 1 Week Ago

    @@ -44,11 +44,11 @@
  • {{ categoryNameList[categoryEntry.category] || 'Uncategorised' }} {{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} - ({{ (categoryEntry.value || 0 ) / weekListValueMax2 | percent:'1.0-0' }}) + ({{ (categoryEntry.value || 0 ) / weekListValueSum2 | percent:'1.0-0' }})
    + [style.width]="(categoryEntry.value || 0 ) / weekListValueSum2 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • @@ -67,7 +67,7 @@
    -

    Purchases 2 weeks ago

    +

    Purchases 2 Weeks Ago

    @@ -75,11 +75,11 @@
  • {{ categoryNameList[categoryEntry.category] || 'Uncategorised' }} {{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} - ({{ (categoryEntry.value || 0 ) / weekListValueMax3 | percent:'1.0-0' }}) + ({{ (categoryEntry.value || 0 ) / weekListValueSum3 | percent:'1.0-0' }})
    + [style.width]="(categoryEntry.value || 0 ) / weekListValueSum3 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • @@ -98,7 +98,7 @@
    -

    Purchases 3 weeks ago

    +

    Purchases 3 Weeks Ago

    @@ -106,11 +106,11 @@
  • {{ categoryNameList[categoryEntry.category] || 'Uncategorised' }} {{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} - ({{ (categoryEntry.value || 0 ) / weekListValueMax4 | percent:'1.0-0' }}) + ({{ (categoryEntry.value || 0 ) / weekListValueSum4 | percent:'1.0-0' }})
    + [style.width]="(categoryEntry.value || 0 ) / weekListValueSum4 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100">
  • diff --git a/src/app/dashboard/category-month.component.ts b/src/app/dashboard/category-month.component.ts index 6569a26..e8353cf 100644 --- a/src/app/dashboard/category-month.component.ts +++ b/src/app/dashboard/category-month.component.ts @@ -22,10 +22,10 @@ export class CategoryMonthComponent implements OnInit { weekList2 = []; weekList3 = []; weekList4 = []; - weekListValueMax1: number = 0; - weekListValueMax2: number = 0; - weekListValueMax3: number = 0; - weekListValueMax4: number = 0; + weekListValueSum1: number = 0; + weekListValueSum2: number = 0; + weekListValueSum3: number = 0; + weekListValueSum4: number = 0; categoryList: number[] = []; dayList: any[] = []; @@ -97,16 +97,16 @@ export class CategoryMonthComponent implements OnInit { data3: any, data4: any) { if (data1) { - this.weekListValueMax1 = Math.max.apply(Math,data1.map(function(o){return o.value;})); + this.weekListValueSum1 = data1.reduce(function (s, a) {return s + a.value;}, 0); } if (data2) { - this.weekListValueMax2 = Math.max.apply(Math,data2.map(function(o){return o.value;})); + this.weekListValueSum2 = data2.reduce(function (s, a) {return s + a.value;}, 0); } if (data3) { - this.weekListValueMax3 = Math.max.apply(Math,data3.map(function(o){return o.value;})); + this.weekListValueSum3 = data3.reduce(function (s, a) {return s + a.value;}, 0); } if (data4) { - this.weekListValueMax4 = Math.max.apply(Math,data4.map(function(o){return o.value;})); + this.weekListValueSum4 = data4.reduce(function (s, a) {return s + a.value;}, 0); } } From 6dd8aeaad992bedd48ee0efe57e4272dd8190ff9 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 25 Jan 2018 15:56:23 +0000 Subject: [PATCH 3/5] removed unnecessary console logging --- src/app/dashboard/category-month.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/dashboard/category-month.component.ts b/src/app/dashboard/category-month.component.ts index e8353cf..1356a3f 100644 --- a/src/app/dashboard/category-month.component.ts +++ b/src/app/dashboard/category-month.component.ts @@ -56,7 +56,6 @@ export class CategoryMonthComponent implements OnInit { ); this.api.categoryTransactionList().subscribe( result => { - console.log(result); this.setData(result); }, error => { From 24b39c06af6a38675686c89b64b5c2d571e941e8 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 25 Jan 2018 16:19:02 +0000 Subject: [PATCH 4/5] made input two columns if wide enough --- src/app/dashboard/add-data.component.html | 32 ++++++++++++++++++----- src/app/dashboard/add-data.component.ts | 11 ++++++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index e5ee80f..c413237 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -25,15 +25,33 @@
    - +
    -
    - +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    - Optional: Choose the relevant Category for the purchase. + Optional: Choose the Budget Type for the majority of the purchase.
    diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 6d64ca8..48622bf 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -39,7 +39,8 @@ export class AddDataComponent implements OnInit { transactionFormInvalid = true; myDate: any; minDate: any; - categoryIdList: number[] = []; + leftCategoryIdList: number[] = []; + rightCategoryIdList: number[] = []; categoryNameList: string[] = []; constructor( @@ -85,8 +86,14 @@ export class AddDataComponent implements OnInit { } private setCategoryList(data: any) { - this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]); + let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]); this.categoryNameList = Object.keys(data.names).map(key => data.names[key]); + console.log(categoryIdList); + let halfLength = Math.floor(categoryIdList.length / 2); + this.leftCategoryIdList = categoryIdList.splice(0, halfLength); + console.log(this.leftCategoryIdList); + this.rightCategoryIdList = categoryIdList; + console.log(this.rightCategoryIdList); } getMinDate() { From efcfaa72ab39237186c8a21cac67d63da30b3a2b Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 25 Jan 2018 16:21:52 +0000 Subject: [PATCH 5/5] updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f5d783..74408eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # Next Release +* Amended category list on transaction submission +* Added budget view for weekly breakdown of spend by category + # v0.1.3 * Made fix to Travis config