forked from lordvkrum/LETS-mobile-Application
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from lordvkrum/mocking-transactions
adding transactions home page and mocking all endpoints
- Loading branch information
Showing
22 changed files
with
468 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<ion-header> | ||
<ion-toolbar> | ||
<h2 class="ui header">New Transaction</h2> | ||
<ion-buttons start> | ||
<button ion-button (click)="dismiss()"> | ||
<span color="primary" showWhen="ios">Cancel</span> | ||
<ion-icon name="md-close" showWhen="android,windows"></ion-icon> | ||
</button> | ||
</ion-buttons> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content padding> | ||
<form-builder-component [fields]="fields" (created)="onCreated($event)"></form-builder-component> | ||
</ion-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
page-add-transaction { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ViewController } from 'ionic-angular'; | ||
import { TransactionService } from '../../services/TransactionService'; | ||
import { AlertService } from '../../services/AlertService'; | ||
import { Transaction } from '../../domain/Transaction'; | ||
|
||
@Component({ | ||
selector: 'page-add-transaction', | ||
templateUrl: 'addTransaction.html' | ||
}) | ||
export class AddTransactionPage implements OnInit { | ||
private definitionTransaction: any; | ||
private fields: Array<any>; | ||
private transaction: Transaction; | ||
|
||
constructor(private viewCtrl: ViewController, | ||
private transactionService: TransactionService, | ||
private alertService: AlertService) { } | ||
|
||
ngOnInit(): void { | ||
this.transactionService.describe() | ||
.subscribe( | ||
response => { | ||
this.definitionTransaction = response; | ||
this.fields = this.definitionTransaction.POST; | ||
}, | ||
error => this.alertService.showError('Connection problem!') | ||
); | ||
} | ||
|
||
onCreated(transaction: Transaction) { | ||
this.transaction = transaction; | ||
this.transactionService.post(this.transaction) | ||
.subscribe( | ||
response => this.viewCtrl.dismiss({ | ||
success: true | ||
}), | ||
error => this.alertService.showError(error) | ||
); | ||
} | ||
|
||
dismiss() { | ||
this.viewCtrl.dismiss(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.