From f6dd18bfc80fe412f5a4dbb17e7369a445b0367d Mon Sep 17 00:00:00 2001 From: piratefinn Date: Wed, 28 Feb 2018 12:02:01 +0000 Subject: [PATCH 1/3] added initial essential branch checkbox --- src/app/dashboard/add-data.component.html | 9 +++++++++ src/app/dashboard/add-data.component.ts | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index c413237..2f079f5 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -24,6 +24,15 @@ Enter the amount spent, such as 5.35 for £5.35. +
+ +
+
+ +
+ Choose if the purchase is deemed essential for budgeting purposes. +
+
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 48622bf..1f0f569 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -32,6 +32,7 @@ export class AddDataComponent implements OnInit { amount: number; // Assumes Groceries is 1st category categoryId: number = 1; + essentialPurchase: any; transactionAdditionType = 1; storeList = []; showAddStore = false; @@ -196,6 +197,7 @@ export class AddDataComponent implements OnInit { purchase_time : purchaseTime, organisation_id : this.organisationId, category : this.categoryId, + essential : this.essentialPurchase, }; break; case 2: @@ -204,7 +206,7 @@ export class AddDataComponent implements OnInit { transaction_value : this.amount, purchase_time : purchaseTime, organisation_id : this.organisationId, - category : this.categoryId, + essential : this.essentialPurchase, }; break; case 3: @@ -216,7 +218,7 @@ export class AddDataComponent implements OnInit { street_name : this.submitOrg.street_name, town : this.submitOrg.town, postcode : this.submitOrg.postcode, - category : this.categoryId, + essential : this.essentialPurchase, }; break; } From 5762b35fbe86a5c83759ca71edd8dbd793fbb80b Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 1 Mar 2018 17:07:25 +0000 Subject: [PATCH 2/3] removed unnecessary console logs and cleaned essential input --- src/app/dashboard/add-data.component.html | 6 +++--- src/app/dashboard/add-data.component.ts | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index 2f079f5..dea50d2 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -25,12 +25,12 @@
- +
- +
- Choose if the purchase is deemed essential for budgeting purposes. + Tick if the purchase is deemed an essential purchase for budgeting purposes.
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 1f0f569..94a0274 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -32,7 +32,7 @@ export class AddDataComponent implements OnInit { amount: number; // Assumes Groceries is 1st category categoryId: number = 1; - essentialPurchase: any; + essentialPurchase = false; transactionAdditionType = 1; storeList = []; showAddStore = false; @@ -89,12 +89,9 @@ export class AddDataComponent implements OnInit { private setCategoryList(data: any) { 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 8b7b5e50be8bb797efe5364bf62bb7a8c8a117b6 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Fri, 2 Mar 2018 16:31:14 +0000 Subject: [PATCH 3/3] fixed display with essential and categories --- .../dashboard/category-month.component.html | 52 +++++++++++++++++-- src/app/dashboard/category-month.component.ts | 17 ++++-- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/category-month.component.html b/src/app/dashboard/category-month.component.html index 0a7c91f..42a3d7a 100644 --- a/src/app/dashboard/category-month.component.html +++ b/src/app/dashboard/category-month.component.html @@ -10,8 +10,19 @@