Fixed transaction submission

This commit is contained in:
piratefinn 2017-10-20 13:21:49 +01:00
parent 1ce755d2d3
commit 0a9e80fc97
3 changed files with 13 additions and 13 deletions

18
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "localloop-web", "name": "localloop-web",
"version": "0.0.1", "version": "0.0.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -7979,14 +7979,6 @@
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
"dev": true "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": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -7997,6 +7989,14 @@
"strip-ansi": "3.0.1" "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": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",

View file

@ -31,7 +31,7 @@
<span class="help-block">Enter the name of the organisation money was spent. Choose existing ones from below or if not found, enter the details below.</span> <span class="help-block">Enter the name of the organisation money was spent. Choose existing ones from below or if not found, enter the details below.</span>
</div> </div>
</div> </div>
<org-table *ngIf="storeList != null" [orgList]="storeList" (onClick)="addStore($event)"></org-table> <org-table *ngIf="storeList.length > 0" [orgList]="storeList" (onClick)="addStore($event)"></org-table>
<div *ngIf="showAddStore"> <div *ngIf="showAddStore">
<div class="form-group row"> <div class="form-group row">
<label class="col-md-3 form-control-label" for="text-input"><strong>Organisation Street Name</strong></label> <label class="col-md-3 form-control-label" for="text-input"><strong>Organisation Street Name</strong></label>

View file

@ -32,7 +32,7 @@ export class AddDataComponent implements OnInit {
organisationPostcode: string; organisationPostcode: string;
amount: number; amount: number;
transactionAdditionType = 1; transactionAdditionType = 1;
storeList; storeList = [];
showAddStore = false; showAddStore = false;
submitReceipt = false; submitReceipt = false;
transactionFormInvalid = true; transactionFormInvalid = true;
@ -108,7 +108,7 @@ export class AddDataComponent implements OnInit {
} }
// handle the case when the storelist is empty // handle the case when the storelist is empty
if (this.storeList.length < 1) { if (this.storeList.length < 1) {
this.storeList = null; this.storeList = [];
this.showAddStore = true; this.showAddStore = true;
this.transactionAdditionType = 3; this.transactionAdditionType = 3;
} }
@ -135,7 +135,7 @@ export class AddDataComponent implements OnInit {
const val = ev.target.value; const val = ev.target.value;
// Filter the store list so search seems quicker // 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( this.storeList = this.storeList.filter(
(item) => { (item) => {
return ( item.name.toLowerCase().indexOf( val.toLowerCase() ) > -1 ); return ( item.name.toLowerCase().indexOf( val.toLowerCase() ) > -1 );