Fix flow for bitpay card

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-28 11:08:08 -03:00
parent 046fd92522
commit 11a7e96c08
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
6 changed files with 42 additions and 48 deletions

View File

@ -1,19 +1,16 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button button-clear" ui-sref="tabs.home"> </ion-nav-back-button>
Close
</button>
</ion-nav-buttons>
<ion-nav-title>BitPay Card</ion-nav-title> <ion-nav-title>BitPay Card</ion-nav-title>
<ion-nav-buttons side="secondary"> <ion-nav-buttons side="secondary">
<button class="button button-clear" ui-sref="bitpayCard.preferences"> <button class="button back-button">
<i class="icon ion-gear-b"></i> <i class="icon ion-ios-search-strong"></i>
</button> </button>
</ion-nav-buttons> </ion-nav-buttons>
</ion-nav-bar> </ion-nav-bar>
<ion-content ng-controller="bitpayCardController as bitpayCard" ng-init="bitpayCard.init()"> <ion-content>
<div class="box-notification warning" ng-show="network == 'testnet'"> <div class="box-notification warning" ng-show="network == 'testnet'">
Sandbox version. Only for testing purpose Sandbox version. Only for testing purpose

View File

@ -76,7 +76,7 @@
</p> </p>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a ui-sref="bitpayCard.main" <a ui-sref="tabs.bitpayCard"
ng-if="externalServices.BitpayCard" ng-if="externalServices.BitpayCard"
class="item item-icon-left item-big-icon-left item-icon-right"> class="item item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg"> <i class="icon big-icon-svg">

View File

@ -98,23 +98,6 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
}); });
}; };
this.init = function() {
$scope.dateRange = 'last30Days';
$scope.network = bitpayCardService.getEnvironment();
$scope.wallets = profileService.getWallets({
network: $scope.network,
onlyComplete: true
});
self.update();
wallet = $scope.wallets[0];
if (wallet && wallet.credentials.n > 1)
self.isMultisigWallet = true;
};
this.sendFunds = function() { this.sendFunds = function() {
if (lodash.isEmpty(wallet)) return; if (lodash.isEmpty(wallet)) return;
@ -258,5 +241,22 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
return tx.description; return tx.description;
}; };
$scope.$on("$ionicView.beforeEnter", function(event, data){
$scope.dateRange = 'last30Days';
$scope.network = bitpayCardService.getEnvironment();
$scope.wallets = profileService.getWallets({
network: $scope.network,
onlyComplete: true
});
self.update();
wallet = $scope.wallets[0];
if (wallet && wallet.credentials.n > 1)
self.isMultisigWallet = true;
});
}); });

View File

@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}); });
} }
$state.go('tabs.details', { $state.go('tabs.wallet', {
walletId: wallet.credentials.walletId walletId: wallet.credentials.walletId
}); });
}; };

View File

@ -150,10 +150,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
* *
*/ */
.state('tabs.details', { .state('tabs.wallet', {
url: '/details/{walletId}/{fromOnboarding}', url: '/wallet/{walletId}/{fromOnboarding}',
views: { views: {
'tab-home': { 'tab-home@tabs': {
controller: 'walletDetailsController', controller: 'walletDetailsController',
templateUrl: 'views/walletDetails.html' templateUrl: 'views/walletDetails.html'
} }
@ -166,7 +166,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.activity', { .state('tabs.activity', {
url: '/activity', url: '/activity',
views: { views: {
'tab-home': { 'tab-home@tabs': {
controller: 'activityController', controller: 'activityController',
templateUrl: 'views/activity.html', templateUrl: 'views/activity.html',
} }
@ -175,7 +175,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.proposals', { .state('tabs.proposals', {
url: '/proposals', url: '/proposals',
views: { views: {
'tab-home': { 'tab-home@tabs': {
controller: 'proposalsController', controller: 'proposalsController',
templateUrl: 'views/proposals.html', templateUrl: 'views/proposals.html',
} }
@ -836,29 +836,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
/* /*
* *
* BitPay Card * BitPay Card
* *
*/ */
.state('bitpayCard', { .state('tabs.bitpayCard', {
url: '/bitpayCard', url: '/bitpay-card',
abstract: true,
template: '<ion-nav-view name="bitpayCard"></ion-nav-view>'
})
.state('bitpayCard.main', {
url: '/main',
views: { views: {
'bitpayCard': { 'tab-home@tabs': {
controller: 'bitpayCardController',
controllerAs: 'bitpayCard',
templateUrl: 'views/bitpayCard.html' templateUrl: 'views/bitpayCard.html'
} }
} }
}) })
.state('bitpayCard.preferences', { .state('tabs.bitpayCard.preferences', {
url: '/preferences', url: '/preferences',
views: { views: {
'bitpayCard': { 'tab-home@tabs': {
templateUrl: 'views/preferencesBitpayCard.html' templateUrl: 'views/preferencesBitpayCard.html'
} }
} }

View File

@ -833,7 +833,7 @@ angular.module('copayApp.services')
x.action = function() { x.action = function() {
// TODO? // TODO?
// $state.go('tabs.details', { // $state.go('tabs.wallet', {
// walletId: x.walletId, // walletId: x.walletId,
// txpId: x.txpId, // txpId: x.txpId,
// txid: x.txid, // txid: x.txid,