From 0a9e80fc97076d9ecf40c80f56e6363acc9569ea Mon Sep 17 00:00:00 2001 From: piratefinn Date: Fri, 20 Oct 2017 13:21:49 +0100 Subject: [PATCH] Fixed transaction submission --- package-lock.json | 18 +++++++++--------- src/app/dashboard/add-data.component.html | 2 +- src/app/dashboard/add-data.component.ts | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3325ee..655bc51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "localloop-web", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7979,14 +7979,6 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -7997,6 +7989,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index 3a78b96..948f868 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -31,7 +31,7 @@ Enter the name of the organisation money was spent. Choose existing ones from below or if not found, enter the details below. - +
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 359c294..13589c7 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 { organisationPostcode: string; amount: number; transactionAdditionType = 1; - storeList; + storeList = []; showAddStore = false; submitReceipt = false; transactionFormInvalid = true; @@ -108,7 +108,7 @@ export class AddDataComponent implements OnInit { } // handle the case when the storelist is empty if (this.storeList.length < 1) { - this.storeList = null; + this.storeList = []; this.showAddStore = true; this.transactionAdditionType = 3; } @@ -135,7 +135,7 @@ export class AddDataComponent implements OnInit { const val = ev.target.value; // Filter the store list so search seems quicker - if (val && val.trim() !== '' && this.storeList !== null) { + if (val && val.trim() !== '' && this.storeList.length > 0) { this.storeList = this.storeList.filter( (item) => { return ( item.name.toLowerCase().indexOf( val.toLowerCase() ) > -1 );