From 16ef46972e084e64255afae22030969d6e2df436 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Wed, 29 Nov 2017 16:19:38 +0000 Subject: [PATCH 001/215] fixed typo --- src/app/dashboard/map.component.html | 2 +- src/app/dashboard/trail-map.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/map.component.html b/src/app/dashboard/map.component.html index ab9a97e..9cdf1be 100644 --- a/src/app/dashboard/map.component.html +++ b/src/app/dashboard/map.component.html @@ -3,7 +3,7 @@
- Lancaster Independent Story + Purchase Map Required Data marked in bold.
diff --git a/src/scss/_custom.scss b/src/scss/_custom.scss index 9efb502..fa409c6 100644 --- a/src/scss/_custom.scss +++ b/src/scss/_custom.scss @@ -34,10 +34,15 @@ agm-map { padding: 5rem 5%; line-height: 0; position: relative; - background: #20a8d8; + background: #4dbd74; color: white; font-size: 0.875rem; } + +.text-dark-green { + color: #10602c; +} + // white title font variant on type-2 as defined in _widgets.css .horizontal-bars { padding: 0; From c7020f4283f5bd5b3196fe6d53d6504db0c65dbe Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 21 Dec 2017 17:27:14 +0000 Subject: [PATCH 033/215] 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 034/215] 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 035/215] 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 036/215] 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 037/215] 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 @@
Week - -
-
-
Date: Wed, 17 Jan 2018 15:02:53 +0000 Subject: [PATCH 040/215] added just in case for font loading file attribute --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index bdb0cab..60dd516 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,3 +15,9 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + +# ensures font files are loaded as binary not text +*.ttf binary +*.eot binary +*.woff binary +*.woff2 binary From 45eb7cb7a11860aee7b3469ffc825ce634a67c11 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Wed, 17 Jan 2018 17:36:28 +0000 Subject: [PATCH 041/215] added new category transaction listing page --- .../dashboard/category-month.component.html | 33 +++++++++++++++ src/app/dashboard/category-month.component.ts | 40 +++++++++++++++++++ src/app/dashboard/dashboard.module.ts | 2 + src/app/dashboard/dashboard.routing.ts | 6 +++ src/app/layouts/full-layout.component.html | 8 ++++ src/app/providers/api-service.ts | 11 +++++ 6 files changed, 100 insertions(+) create mode 100644 src/app/dashboard/category-month.component.html create mode 100644 src/app/dashboard/category-month.component.ts diff --git a/src/app/dashboard/category-month.component.html b/src/app/dashboard/category-month.component.html new file mode 100644 index 0000000..a1f0b30 --- /dev/null +++ b/src/app/dashboard/category-month.component.html @@ -0,0 +1,33 @@ +
+
+
+
+
+
+
+

Purchases this week

+
+
+
+
    +
  • + Placeholder Category + {{ (weekPurchaseList.first || 0 ) }} + ({{ (weekPurchaseList.first || 0 ) / weekPurchaseList.max | percent:'1.0-0' }}) +
    +
    +
    +
    +
    +
  • +
  • + +
  • +
+
+
+
+
+
+
diff --git a/src/app/dashboard/category-month.component.ts b/src/app/dashboard/category-month.component.ts new file mode 100644 index 0000000..cf83e6d --- /dev/null +++ b/src/app/dashboard/category-month.component.ts @@ -0,0 +1,40 @@ +import { Directive, Component, OnInit } from '@angular/core'; +import { ApiService } from '../providers/api-service'; +import { DataType } from '../shared/data-types.enum'; + +@Component({ + templateUrl: 'category-month.component.html' +}) +export class CategoryMonthComponent implements OnInit { + + disableCategoryButtonFirst: boolean = false; + + weekPurchaseList = { + first: 0, + }; + + categoryList: number[] = []; + categoryLimitFirst: number = 10; + + constructor( + private api: ApiService, + ) { + this.api.categoryTransactionList().subscribe( + result => { + console.log(result); + }, + error => { + console.log('Retrieval Error'); + console.log( error._body ); + } + ); + } + + public loadMore () { + this.disableCategoryButtonFirst = true; + this.categoryLimitFirst = 100; + } + + ngOnInit(): void { + } +} diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts index d6fcfca..2e47f80 100644 --- a/src/app/dashboard/dashboard.module.ts +++ b/src/app/dashboard/dashboard.module.ts @@ -16,6 +16,7 @@ import { AccountEditComponent } from './account-edit.component'; import { AddDataComponent } from './add-data.component'; import { FeedbackComponent } from './feedback.component'; import { TransactionLogComponent } from './transaction-log.component'; +import { CategoryMonthComponent } from './category-month.component'; import { PayrollLogComponent } from './payroll-log.component'; import { LeaderboardComponent } from './leaderboard.component'; import { MapComponent } from './map.component'; @@ -61,6 +62,7 @@ import { environment } from '../../environments/environment'; OrgResultComponent, OrgTableComponent, TransactionLogComponent, + CategoryMonthComponent, TransactionResultComponent, PayrollLogComponent, PayrollResultComponent, diff --git a/src/app/dashboard/dashboard.routing.ts b/src/app/dashboard/dashboard.routing.ts index 46b9df3..90cb277 100644 --- a/src/app/dashboard/dashboard.routing.ts +++ b/src/app/dashboard/dashboard.routing.ts @@ -12,6 +12,7 @@ import { AccountEditComponent } from './account-edit.component'; import { AddDataComponent } from './add-data.component'; import { FeedbackComponent } from './feedback.component'; import { TransactionLogComponent } from './transaction-log.component'; +import { CategoryMonthComponent } from './category-month.component'; import { PayrollLogComponent } from './payroll-log.component'; import { LeaderboardComponent } from './leaderboard.component'; import { MapComponent } from './map.component'; @@ -58,6 +59,11 @@ const routes: Routes = [ component: TransactionLogComponent, data: { title: 'Transaction Log' }, }, + { + path: 'category-month', + component: CategoryMonthComponent, + data: { title: 'Month Category' }, + }, { path: 'map', component: MapComponent, diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html index 8a205f9..40d7c98 100644 --- a/src/app/layouts/full-layout.component.html +++ b/src/app/layouts/full-layout.component.html @@ -81,6 +81,14 @@
+
-
  • +
  • @@ -53,7 +53,7 @@
    -
  • +
  • @@ -84,7 +84,7 @@
    -
  • +
  • @@ -115,7 +115,7 @@
    -
  • +
  • diff --git a/src/app/dashboard/category-month.component.ts b/src/app/dashboard/category-month.component.ts index 40fbbdb..1e20a3e 100644 --- a/src/app/dashboard/category-month.component.ts +++ b/src/app/dashboard/category-month.component.ts @@ -18,10 +18,10 @@ export class CategoryMonthComponent implements OnInit { first: 0, }; - weekList1 = {}; - weekList2 = {}; - weekList3 = {}; - weekList4 = {}; + weekList1 = []; + weekList2 = []; + weekList3 = []; + weekList4 = []; categoryList: number[] = []; dayList: any[] = []; @@ -32,7 +32,7 @@ export class CategoryMonthComponent implements OnInit { myWeek4: any; categoryIdList: number[] = []; categoryNameList: string[] = []; - categoryLimit1: number = 6; + categoryLimit1: number = 2; categoryLimit2: number = 6; categoryLimit3: number = 6; categoryLimit4: number = 6; diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index 46310d0..e8019a4 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -94,7 +94,7 @@ {{ sectorPurchases[i] || 'N/A' }} -
  • +
  • From d674c5b59be18650300af9c4abae45a2ec098680 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Wed, 24 Jan 2018 13:18:51 +0000 Subject: [PATCH 053/215] list fully finished --- .../dashboard/category-month.component.html | 30 ++++++++--------- src/app/dashboard/category-month.component.ts | 33 ++++++++++++++----- src/app/dashboard/dashboard.routing.ts | 2 +- src/app/layouts/full-layout.component.html | 2 +- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/app/dashboard/category-month.component.html b/src/app/dashboard/category-month.component.html index ac5ba47..5b5434d 100644 --- a/src/app/dashboard/category-month.component.html +++ b/src/app/dashboard/category-month.component.html @@ -12,12 +12,12 @@
    diff --git a/src/app/layouts/full-layout.component.ts b/src/app/layouts/full-layout.component.ts index 453a8df..ff74ceb 100644 --- a/src/app/layouts/full-layout.component.ts +++ b/src/app/layouts/full-layout.component.ts @@ -39,7 +39,6 @@ export class FullLayoutComponent implements OnInit { .logout() .subscribe( result => { - console.log('Logged out!'); localStorage.clear(); this.router.navigate(['/login']); } diff --git a/src/app/panels/pie-panel.component.ts b/src/app/panels/pie-panel.component.ts index 3b8b39c..80f64e1 100644 --- a/src/app/panels/pie-panel.component.ts +++ b/src/app/panels/pie-panel.component.ts @@ -3,7 +3,6 @@ import { ApiService } from '../providers/api-service'; import { CustPiesService } from '../providers/cust-pies.service'; import { DataType } from '../shared/data-types.enum'; import { ChartData } from '../_interfaces/chart-data'; -import * as moment from 'moment'; import 'rxjs/add/operator/map'; @Component({ From 3d5d20e41964e94d178f917a5b7795b08b7ea77a Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 16 Apr 2018 14:52:19 +0100 Subject: [PATCH 099/215] Added hint for closing menu --- src/app/layouts/full-layout.component.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html index 13887c7..baf33dd 100644 --- a/src/app/layouts/full-layout.component.html +++ b/src/app/layouts/full-layout.component.html @@ -25,6 +25,13 @@ From daff33657f7d7be8620e93f217b3ad7157bdf95b Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 16 Apr 2018 15:08:23 +0100 Subject: [PATCH 100/215] Fixed instruction for close menu button --- src/app/layouts/full-layout.component.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html index baf33dd..58baf2c 100644 --- a/src/app/layouts/full-layout.component.html +++ b/src/app/layouts/full-layout.component.html @@ -26,10 +26,8 @@