diff --git a/.DS_Store b/.DS_Store index 4bd866e..7a908ba 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/config.xml b/config.xml index 7e23e16..edb88e2 100644 --- a/config.xml +++ b/config.xml @@ -3,7 +3,7 @@ Northbricks http://www.northbricks.com Northbricks Team - + @@ -99,8 +99,9 @@ + - + diff --git a/src/assets/.DS_Store b/src/assets/.DS_Store new file mode 100644 index 0000000..cd3a2cf Binary files /dev/null and b/src/assets/.DS_Store differ diff --git a/src/assets/banks/.DS_Store b/src/assets/banks/.DS_Store new file mode 100644 index 0000000..8d21a1c Binary files /dev/null and b/src/assets/banks/.DS_Store differ diff --git a/src/assets/banks/danskebank/danske.png b/src/assets/banks/danskebank/danske.png new file mode 100755 index 0000000..d9dda4c Binary files /dev/null and b/src/assets/banks/danskebank/danske.png differ diff --git a/src/assets/banks/ica/ica.png b/src/assets/banks/ica/ica.png new file mode 100755 index 0000000..07e71cd Binary files /dev/null and b/src/assets/banks/ica/ica.png differ diff --git a/src/assets/banks/nordea/nordea.png b/src/assets/banks/nordea/nordea.png new file mode 100755 index 0000000..46962e0 Binary files /dev/null and b/src/assets/banks/nordea/nordea.png differ diff --git a/src/assets/banks/paypal/paypal.png b/src/assets/banks/paypal/paypal.png new file mode 100755 index 0000000..7d7a5f1 Binary files /dev/null and b/src/assets/banks/paypal/paypal.png differ diff --git a/src/assets/banks/seb/seb.png b/src/assets/banks/seb/seb.png new file mode 100755 index 0000000..e0a933e Binary files /dev/null and b/src/assets/banks/seb/seb.png differ diff --git a/src/assets/banks/skandia/skandia.png b/src/assets/banks/skandia/skandia.png new file mode 100755 index 0000000..3bd21c9 Binary files /dev/null and b/src/assets/banks/skandia/skandia.png differ diff --git a/src/assets/banks/swedbank/swedbank.png b/src/assets/banks/swedbank/swedbank.png new file mode 100755 index 0000000..d0e39c2 Binary files /dev/null and b/src/assets/banks/swedbank/swedbank.png differ diff --git a/src/assets/images/Disclosure Indicator.svg b/src/assets/images/disclosureindicator.svg similarity index 100% rename from src/assets/images/Disclosure Indicator.svg rename to src/assets/images/disclosureindicator.svg diff --git a/src/pages/home/home.html b/src/pages/home/home.html index 97e4309..782aeb7 100644 --- a/src/pages/home/home.html +++ b/src/pages/home/home.html @@ -2,8 +2,8 @@ MY BANKS - @@ -16,11 +16,11 @@ - +
-
+
-
+
{{bank.fullName}}
@@ -32,12 +32,18 @@
diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss index a613bd7..a73351e 100644 --- a/src/pages/home/home.scss +++ b/src/pages/home/home.scss @@ -17,13 +17,29 @@ margin: 5px auto 0 auto; } +.arrowDisclosure { + + background: url(../assets/images/disclosureindicator.svg) no-repeat top left; + background-size: contain; + width: 22px; + height: 22px; + padding-right: 12px; + // margin: 0px auto 0 auto; + + +} +.iconAdd{ + width: 16px; + height: 16px; +} .cards { - background: url(../assets/images/cards.svg) no-repeat top left; + // background: url(../assets/banks/nordea/nordea.png) no-repeat top left; background-size: contain; - width: 20px; - height: 20px; - margin:7px; + width: 36px; + height: 36px; + margin-left: 18px; + margin-top: 13px; // margin: 20px auto 0 auto; } @@ -63,7 +79,7 @@ margin-top: 2px; margin-left: 2px; line-height: 30px; - img{ + img { height: 20px; } @@ -71,9 +87,10 @@ div.headerTitle{ float: left; margin-left: 10px; + margin-top:13px; height: 40px; line-height: 30px; - font-size: 15px; + font-size: 14px; } } diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts index dd93644..ec58a87 100644 --- a/src/pages/home/home.ts +++ b/src/pages/home/home.ts @@ -1,6 +1,6 @@ import { BankAuthPage } from '../bank/bank-auth/bank-auth'; import { Component } from '@angular/core'; -import { LoadingController, ModalController, NavController } from 'ionic-angular'; +import { LoadingController, ModalController, NavController, ActionSheetController, ActionSheetButton, ActionSheet } from 'ionic-angular'; import { Banks, Bank } from '../../interface/iBanks'; import { Transaction } from '../../interface/iTransaction'; @@ -29,25 +29,56 @@ export class HomePage { user: User; accounts: Account[] = []; countTransactions: number = 0; - + actionSheet: ActionSheet; constructor(public modalCtrl: ModalController, + private actionSheetCtrl: ActionSheetController, public loadingCtrl: LoadingController, public northbricksApi: NorthbricksApi, public navCtrl: NavController, public toastCtrl: ToastService, private storage: NorthbricksStorage) { + + } - public onItemSelection(selection) { + onItemSelection(selection) { console.log(JSON.stringify(selection)); if (selection) { // console.log("item selected: " + selection.iban); + this.selectedAccount = selection; this.fetchAccountsTransactions(selection); } else { console.log("no item selected"); } } + + loadActionSheet() { + // if (this.actionSheet) { + // console.log('Action sheet exists'); + // this.actionSheet.present(); + + // } else { + // console.log('Action does not exists'); + + // if (this.selectedBank) { + // this.fetchAccounts(this.selectedBank); + // } else { + // this.fetchBanks(); + // } + // } + this.actionSheet = this.actionSheetCtrl.create({ + title: 'Accounts' + }); + console.log(JSON.stringify(this.accounts)); + this.accounts.forEach(element => { + this.actionSheet.addButton({ text: element.iban, handler: () => { this.onItemSelection(element) } }); + }); + this.actionSheet.present(); + + } + + getColor(value: string) { // console.log('Value is ' + value); if (value.toString().startsWith("-")) { @@ -73,6 +104,8 @@ export class HomePage { }, error => { alert(error); }); + + // this.loadActionSheet(); } showTransaction(transactionId: string) { let transactionModal = this.modalCtrl.create(TransactionPage, { bankId: this.selectedBank.id, transactionId: transactionId, accountId: this.selectedAccount.id }); @@ -90,14 +123,22 @@ export class HomePage { // alert(bank.id); this.navCtrl.push(BankPage, { bank: bank, user: this.user }); + } + showActionsSheetAccounts() { + this.loadActionSheet(); + } fetchAccounts(bank: Bank) { + this.northbricksApi.fetchAccounts(bank.id).subscribe(account => { console.log(JSON.stringify(account.accounts)); this.accounts = account.accounts; this.selectedAccount = this.accounts[0]; + console.log('Fetching accounts'); + + if (this.selectedAccount != null) { this.fetchAccountsTransactions(this.selectedAccount); } @@ -106,18 +147,12 @@ export class HomePage { }); } - ionViewCanEnter() { - - } - - - AddBank(bankId: string, name: string) { // alert(bankId); let authModal = this.modalCtrl.create(BankAuthPage, { bankId: bankId, name: name }); authModal.present(); authModal.onDidDismiss(dismissed => { - this.fetchAccounts(this.selectedBank); + this.fetchBanks(); }); } diff --git a/src/providers/auth-service-northbricks/auth-service-northbricks.ts b/src/providers/auth-service-northbricks/auth-service-northbricks.ts index c15c121..df4b59b 100644 --- a/src/providers/auth-service-northbricks/auth-service-northbricks.ts +++ b/src/providers/auth-service-northbricks/auth-service-northbricks.ts @@ -11,7 +11,7 @@ export class AuthServiceNorthbricksProvider { private oAuthUrl = `https://api.northbricks.io/oauth/authorize?client_id=sampleClientId&redirect_uri=https://localhost/oauth/token&scope=read&response_type=token`; public static accessToken: string = ''; - public static devAccessToken: string = '22b3531c-04b5-476c-838c-f801ac5fb218'; + public static devAccessToken: string = 'd11af3aa-e05e-4c5a-aada-1d1265045fc3'; public tokenType: string = ''; options: InAppBrowserOptions = { diff --git a/src/theme/variables.scss b/src/theme/variables.scss index 102113a..f044c18 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -30,7 +30,8 @@ $colors: ( light: #f4f4f4, dark: #222, navbarColor: #fff, - northbricksorange: #f05f40 + northbricksorange: #f05f40, + toolbarTitleTextColor:#000 ); $toolbar-backgroud:#fff; $tabs-background:#3B3B3B; @@ -55,7 +56,7 @@ $text-color:#000; // iOS only Sass variables can go here .toolbar-title.toolbar-title-md, .toolbar-title.toolbar-title-ios, -.toolbar-title.toolbar-title-wp { color: map-get($colors, northbricksorange); } +.toolbar-title.toolbar-title-wp { color: map-get($colors, toolbarTitleTextColor); }