From c7020f4283f5bd5b3196fe6d53d6504db0c65dbe Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 21 Dec 2017 17:27:14 +0000 Subject: [PATCH 1/6] changelog and versioning updated --- CHANGELOG.md | 5 +++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb614e..7923872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ # Next Release +# v0.1.1 + +* Redid layout on circle customer view +* Renamed customer dashboard headers + # v0.1.0 * Changed Story Trail choosing to modals diff --git a/package-lock.json b/package-lock.json index 4438a01..2e529ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "localloop-web", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2811a6..6b3ee33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "localloop-web", - "version": "0.1.0", + "version": "0.1.1", "description": "LocalLoop Web - Web interface for LocalLoop app", "author": "", "url": "http://www.peartrade.org", From e64b6057e8aeb14da17d0e940e3448452242479e Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 15 Jan 2018 14:19:16 +0000 Subject: [PATCH 2/6] added category list endpoint --- src/app/providers/api-service.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts index 131eee3..25e9ce1 100644 --- a/src/app/providers/api-service.ts +++ b/src/app/providers/api-service.ts @@ -116,6 +116,17 @@ export class ApiService { ); } + // Basic Customer User stats API + public categoryList() { + const key = this.sessionKey; + return this.http.post( + this.apiUrl + '/search/category', + { + session_key : key, + } + ); + } + // Searches organisations used for transaction submission public search(data) { From 59efe7a65055aa005e12cd1be0a007e0813224c8 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 15 Jan 2018 15:33:38 +0000 Subject: [PATCH 3/6] Retrieving categories from API --- src/app/dashboard/add-data.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index ffa4ef8..7ca6cd1 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -37,6 +37,8 @@ export class AddDataComponent implements OnInit { transactionFormInvalid = true; myDate: any; minDate: any; + categoryIds: number[] = []; + categoryNames: string[] = []; constructor( private formBuilder: FormBuilder, @@ -64,6 +66,16 @@ export class AddDataComponent implements OnInit { }); this.myDate = moment().format('YYYY-MM-DD[T]HH:mm'); // this.myDate = new Date().toISOString().slice(0, 16); + this.api.categoryList().subscribe( + result => { + this.categories = result; + console.log(this.categories); + }, + error => { + console.log('Retrieval Error'); + console.log( error._body ); + } + ); } ngOnInit(): void { From d17a686490571a57c498b255928f058e73dd8414 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 15 Jan 2018 16:20:51 +0000 Subject: [PATCH 4/6] functional receiving, choosing and upload of transaction category --- src/app/dashboard/add-data.component.html | 14 ++++++++++++++ src/app/dashboard/add-data.component.ts | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index 948f868..ebdea7a 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -24,6 +24,20 @@ Enter the amount spent, such as 5.35 for £5.35. +
+ +
+
+ +
+ Optional: Choose the relevant Category for the purchase. +
+
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 7ca6cd1..f970448 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -30,6 +30,7 @@ export class AddDataComponent implements OnInit { organisationTown: string; organisationPostcode: string; amount: number; + categoryId: number; transactionAdditionType = 1; storeList = []; showAddStore = false; @@ -37,8 +38,8 @@ export class AddDataComponent implements OnInit { transactionFormInvalid = true; myDate: any; minDate: any; - categoryIds: number[] = []; - categoryNames: string[] = []; + categoryIdList: number[] = []; + categoryNameList: string[] = []; constructor( private formBuilder: FormBuilder, @@ -70,6 +71,7 @@ export class AddDataComponent implements OnInit { result => { this.categories = result; console.log(this.categories); + this.setCategoryList(result.categories); }, error => { console.log('Retrieval Error'); @@ -83,6 +85,11 @@ export class AddDataComponent implements OnInit { this.accountType = localStorage.getItem('usertype'); } + private setCategoryList(data: any) { + this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]); + this.categoryNameList = Object.keys(data.names).map(key => data.names[key]); + } + getMinDate() { // gets the April 1st date of the current year const aprilDate = moment().month(3).date(1); @@ -182,6 +189,7 @@ export class AddDataComponent implements OnInit { transaction_value : this.amount, purchase_time : purchaseTime, organisation_id : this.organisationId, + category : this.categoryId, }; break; case 2: @@ -190,6 +198,7 @@ export class AddDataComponent implements OnInit { transaction_value : this.amount, purchase_time : purchaseTime, organisation_id : this.organisationId, + category : this.categoryId, }; break; case 3: @@ -201,6 +210,7 @@ export class AddDataComponent implements OnInit { street_name : this.submitOrg.street_name, town : this.submitOrg.town, postcode : this.submitOrg.postcode, + category : this.categoryId, }; break; } @@ -251,6 +261,7 @@ export class AddDataComponent implements OnInit { this.amount = null; this.transactionFormInvalid = true; this.showAddStore = false; + this.categoryId = null; } onSubmitPayroll() { From 511969656e6c74e4eac11657d8091d85b846c50e Mon Sep 17 00:00:00 2001 From: piratefinn Date: Tue, 16 Jan 2018 15:57:38 +0000 Subject: [PATCH 5/6] Fixed app, added ability for non category transaction changed reset form --- src/app/dashboard/add-data.component.html | 2 +- src/app/dashboard/add-data.component.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index ebdea7a..edcb5e2 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -29,7 +29,7 @@