From f3c6370394b90914ee70792b12c3c69b4f99b751 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Tue, 13 Mar 2018 12:49:30 +0000 Subject: [PATCH] Amended purchase validation and submission --- CHANGELOG.md | 3 ++ src/app/dashboard/add-data.component.html | 47 ++++++++----------- src/app/dashboard/add-data.component.ts | 15 +++--- .../dashboard/transaction-log.component.ts | 1 - 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f3c39a..636040e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ # v0.1.5 * Fixed category viewing on purchase +* Changed category view from radio buttons to full label buttons +* Amended local validation of submit +* Changed recurring purchase selection view # v0.1.4 diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index 6d57253..2f6ca73 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -46,29 +46,22 @@
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
+
+ + + + +
Please give the period of time the purchase will recur from "Time of Transaction". @@ -86,7 +79,7 @@ {{ leftCategoryNameList[i] }}
-
+
@@ -105,21 +98,21 @@
- +
Enter the street name where the organisation is located at.
- +
Enter the name of the town where the organisation is located at.
- +
Enter the postcode where the organisation is located at. diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 99a1df4..4b7b838 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -177,14 +177,15 @@ export class AddDataComponent implements OnInit { } transactionFormValidate() { - if (this.submitOrg.name.length === 0 || - this.submitOrg.town.length === 0 || - this.amount === 0 || - this.recurringPurchase && - !this.recurringType) { - this.transactionFormInvalid = true; - } else { + if (this.submitOrg.name.length && + this.amount && + (this.recurringPurchase && + this.recurringType || + !this.recurringPurchase && + !this.recurringType)) { this.transactionFormInvalid = false; + } else { + this.transactionFormInvalid = true; } } diff --git a/src/app/dashboard/transaction-log.component.ts b/src/app/dashboard/transaction-log.component.ts index 92f4822..03bcd9e 100644 --- a/src/app/dashboard/transaction-log.component.ts +++ b/src/app/dashboard/transaction-log.component.ts @@ -53,7 +53,6 @@ export class TransactionLogComponent implements OnInit { } loadTransactions(logPage: number) { - console.log(logPage); this.api.transList(logPage).subscribe( result => { if (result.transactions.length > 0) {