From b6bcc57cfdbc5cd715dab288b801abfa2a1d57e1 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 6 Sep 2016 11:22:10 -0300 Subject: [PATCH 01/11] fix incomplete wallet process --- public/views/copayers.html | 19 +++-- public/views/includes/copayers.html | 14 ++-- public/views/tab-home.html | 2 +- public/views/walletDetails.html | 17 +---- src/js/controllers/copayers.js | 30 +++----- src/js/controllers/tab-home.js | 48 ++++++------- src/js/controllers/walletDetails.js | 103 ++++++++++++---------------- src/js/routes.js | 4 +- 8 files changed, 96 insertions(+), 141 deletions(-) diff --git a/public/views/copayers.html b/public/views/copayers.html index aa5b8f626..0e8a0f7de 100644 --- a/public/views/copayers.html +++ b/public/views/copayers.html @@ -1,15 +1,12 @@ - + - {{wallet.name}} - - - + + + - +

Share this invitation with your copayers

@@ -43,14 +40,14 @@ [ {{wallet.m}}-of-{{wallet.n}} ] -
+
- + Waiting...
-
diff --git a/public/views/includes/copayers.html b/public/views/includes/copayers.html index ae519e35a..2ab3e5f49 100644 --- a/public/views/includes/copayers.html +++ b/public/views/includes/copayers.html @@ -1,10 +1,8 @@ -
    -
  • - - {{'Me'|translate}} +
    + + {{'Me'|translate}} - - {{copayer.name}} + + {{copayer.name}} -
  • -
+
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index c323373cf..501b2880b 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -40,7 +40,7 @@ + ng-click="openWallet(wallet)"> diff --git a/public/views/walletDetails.html b/public/views/walletDetails.html index 78cd5ce10..0bef1c79b 100644 --- a/public/views/walletDetails.html +++ b/public/views/walletDetails.html @@ -10,22 +10,7 @@ - - - - - - -
+
diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index 9e52e635a..b95a22121 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -1,13 +1,15 @@ 'use strict'; angular.module('copayApp.controllers').controller('copayersController', - function($scope, $log, $ionicPopup, profileService, platformInfo, gettextCatalog, $stateParams, ongoingProcess, $state) { + function($scope, $log, $ionicNavBarDelegate, $stateParams, $state, profileService, popupService, platformInfo, gettextCatalog, ongoingProcess) { if (!$stateParams.walletId) { $log.debug('No wallet provided...back to home'); - return $state.transitionTo('tabs.home'); + return $state.go('tabs.home'); } var wallet = profileService.getWallet($stateParams.walletId); + $ionicNavBarDelegate.title(wallet.name); + var secret; try { secret = wallet.status.wallet.secret; @@ -15,28 +17,12 @@ angular.module('copayApp.controllers').controller('copayersController', $scope.wallet = wallet; $scope.secret = secret; + $scope.copayers = wallet.status.wallet.copayers; $scope.isCordova = platformInfo.isCordova; $scope.showDeletePopup = function() { - var popup = $ionicPopup.show({ - template: '' + gettextCatalog.getString('Are you sure you want to delete this wallet?') + '', - title: gettextCatalog.getString('Confirm'), - buttons: [ - { - text: gettextCatalog.getString('Cancel'), - onTap: function(e) { - popup.close(); - } - }, - { - text: gettextCatalog.getString('Accept'), - type: 'button-positive', - onTap: function(e) { - deleteWallet(); - popup.close(); - } - } - ] + popupService.showConfirm(gettextCatalog.getString('Confirm'), gettextCatalog.getString('Are you sure you want to delete this wallet?'), function(res) { + if (res) deleteWallet(); }); }; @@ -47,7 +33,7 @@ angular.module('copayApp.controllers').controller('copayersController', if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err.message || err); } else { - $state.transitionTo('tabs.home'); + $state.go('tabs.home'); } }); }; diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 3abf9f157..24899dd56 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,19 +1,37 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService, txpModalService, $window) { - + function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window) { $scope.externalServices = {}; $scope.bitpayCardEnabled = true; // TODO + $scope.openTxpModal = txpModalService.open; + $scope.version = $window.version; + $scope.name = $window.appConfig.nameCase; + configService.whenAvailable(function() { + var config = configService.getSync(); + var isWindowsPhoneApp = platformInfo.isWP && isCordova; + $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; + $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; + }); + + $scope.openWallet = function(wallet) { + if (!wallet.isComplete()) { + return $state.go('tabs.copayers', { + walletId: wallet.credentials.walletId + }); + } + + $state.go('tabs.details', { + walletId: wallet.credentials.walletId + }); + }; function updateTxps() { profileService.getTxps({ limit: 3 }, function(err, txps, n) { - if (err) { - console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO - } + if (err) $log.error(err); $scope.txps = txps; $scope.txpsN = n; $ionicScrollDelegate.resize(); @@ -24,7 +42,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', }) }; - $scope.updateAllWallets = function() { $scope.wallets = profileService.getWallets(); if (lodash.isEmpty($scope.wallets)) return; @@ -41,7 +58,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', } else { wallet.status = status; } - if (++j==i) { + if (++j == i) { updateTxps(); } }); @@ -106,7 +123,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.updateWallet(wallet); }), $rootScope.$on('Local/TxAction', function(e, walletId) { - $log.debug('Got action for wallet '+ walletId); + $log.debug('Got action for wallet ' + walletId); var wallet = profileService.getWallet(walletId); $scope.updateWallet(wallet); }), @@ -117,19 +134,4 @@ angular.module('copayApp.controllers').controller('tabHomeController', x(); }); }); - - configService.whenAvailable(function() { - var config = configService.getSync(); - var isWindowsPhoneApp = platformInfo.isWP && isCordova; - $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; - $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; - }); - - $scope.openTxpModal = txpModalService.open; - - $scope.version = $window.version; - $scope.name = $window.appConfig.nameCase; - - - }); diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 6e8f7b078..fa6ea0d47 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,21 +1,58 @@ 'use strict'; angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup, txpModalService, externalLinkService) { - - var isCordova = platformInfo.isCordova; - var isWP = platformInfo.isWP; - var isAndroid = platformInfo.isAndroid; - var isChromeApp = platformInfo.isChromeApp; - - var errorPopup; - var HISTORY_SHOW_LIMIT = 10; + var currentTxHistoryPage; + var wallet; $scope.txps = []; $scope.openExternalLink = function(url, target) { externalLinkService.open(url, target); }; + $scope.init = function() { + currentTxHistoryPage = 0; + $scope.completeTxHistory = []; + + wallet = profileService.getWallet($stateParams.walletId); + + /* Set color for header bar */ + $rootScope.walletDetailsColor = wallet.color; + $rootScope.walletDetailsName = wallet.name; + $scope.wallet = wallet; + + $scope.requiresMultipleSignatures = wallet.credentials.m > 1; + $scope.newTx = false; + + $ionicNavBarDelegate.title(wallet.name); + + $scope.updateAll(function() { + if ($stateParams.txid) { + var tx = lodash.find($scope.completeTxHistory, { + txid: $stateParams.txid + }); + if (tx) { + $scope.openTxModal(tx); + } else { + $ionicPopup.alert({ + title: gettext('TX not available'), + }); + } + } else if ($stateParams.txpId) { + var txp = lodash.find($scope.txps, { + id: $stateParams.txpId + }); + if (txp) { + $scope.openTxpModal(txp); + } else { + $ionicPopup.alert({ + title: gettext('Proposal not longer available'), + }); + } + } + }); + } + var setPendingTxps = function(txps) { if (!txps) { $scope.txps = []; @@ -169,54 +206,4 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun if (err) $log.error(err); }); } - - var currentTxHistoryPage; - var wallet; - - $scope.init = function() { - currentTxHistoryPage = 0; - $scope.completeTxHistory = []; - - wallet = profileService.getWallet($stateParams.walletId); - - if (!wallet.isComplete()) { - return $state.go('wallet.copayers'); - }; - - /* Set color for header bar */ - $rootScope.walletDetailsColor = wallet.color; - $rootScope.walletDetailsName = wallet.name; - - $scope.wallet = wallet; - $scope.requiresMultipleSignatures = wallet.credentials.m > 1; - $scope.newTx = false; - - $ionicNavBarDelegate.title(wallet.name); - - $scope.updateAll(function() { - if ($stateParams.txid) { - var tx = lodash.find($scope.completeTxHistory, { - txid: $stateParams.txid - }); - if (tx) { - $scope.openTxModal(tx); - } else { - $ionicPopup.alert({ - title: gettext('TX not available'), - }); - } - } else if ($stateParams.txpId) { - var txp = lodash.find($scope.txps, { - id: $stateParams.txpId - }); - if (txp) { - $scope.openTxpModal(txp); - } else { - $ionicPopup.alert({ - title: gettext('Proposal not longer available'), - }); - } - } - }); - } }); diff --git a/src/js/routes.js b/src/js/routes.js index bde25a606..1b8f754d0 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -533,9 +533,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr */ .state('tabs.copayers', { - url: '/copayers', + url: '/copayers/:walletId', views: { - 'wallet': { + 'tab-home': { templateUrl: 'views/copayers.html' } } From 241213ca4fd9805a44cb056ece38c4d75e15d011 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 6 Sep 2016 11:59:05 -0300 Subject: [PATCH 02/11] Fix glidera issues (tx proposals and ui) --- public/views/buyGlidera.html | 12 +++++----- public/views/glidera.html | 20 ++++++++-------- public/views/includes/txp.html | 8 +++---- public/views/modals/glidera-tx-details.html | 2 +- public/views/preferencesGlidera.html | 26 +++++++++------------ public/views/sellGlidera.html | 10 ++++---- public/views/tab-home.html | 3 +-- src/js/controllers/modals/txpDetails.js | 1 + src/js/controllers/preferencesGlidera.js | 2 +- src/sass/main.scss | 2 +- src/sass/views/includes/walletActivity.scss | 3 ++- 11 files changed, 42 insertions(+), 47 deletions(-) diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index ff7d0bd54..bdbdd6cf0 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -24,7 +24,7 @@ (remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
-
+
This operation was disabled because you have a pending first transaction @@ -35,7 +35,7 @@
-
+
diff --git a/public/views/glidera.html b/public/views/glidera.html index 10cfcc304..038a5d5f0 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -1,8 +1,8 @@ - Glidera @@ -39,7 +39,7 @@

Connect your Glidera account to get started

- @@ -51,7 +51,7 @@
-
+
-
-
+
+
Activity
+
+ {{tx.amountStr}} +
{{addressbook[tx.toAddress]}} @@ -18,11 +21,6 @@ -
- {{tx.amountStr}} -
- -

{{tx.wallet.name}} diff --git a/public/views/modals/glidera-tx-details.html b/public/views/modals/glidera-tx-details.html index 34e3992d5..1e2dd1261 100644 --- a/public/views/modals/glidera-tx-details.html +++ b/public/views/modals/glidera-tx-details.html @@ -1,6 +1,6 @@ - diff --git a/public/views/preferencesGlidera.html b/public/views/preferencesGlidera.html index d34ef5ff1..6adc813d2 100644 --- a/public/views/preferencesGlidera.html +++ b/public/views/preferencesGlidera.html @@ -10,7 +10,8 @@ -

    +
      +
      Permissions
      @@ -38,10 +39,9 @@ {{permissions.transaction_history}} -
    +
-
    +
    Email
    @@ -57,10 +57,9 @@ {{email.userEmailIsSetup}} -
+
-
    +
    Personal Information
    @@ -137,10 +136,9 @@ {{personalInfo.basicInfoState}} -
+
-
    +
    Status
    @@ -200,10 +198,9 @@ {{status.country}} -
+
-
    +
    Limits
    @@ -262,9 +259,8 @@ {{limits.transactDisabledPendingFirstTransaction}} -
+
-
    Account
    diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index e6aa011a0..8d18628b5 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -34,7 +34,7 @@ -
    +
    diff --git a/public/views/tab-home.html b/public/views/tab-home.html index c323373cf..774bef887 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -73,9 +73,8 @@
    Buy & Sell Bitcoin
    - + - diff --git a/public/views/tab-import-file.html b/public/views/tab-import-file.html index 07cae197b..76946086d 100644 --- a/public/views/tab-import-file.html +++ b/public/views/tab-import-file.html @@ -1,61 +1,40 @@ - - - - - - {{'Import wallet' | translate}} - - - - - - -
    - - - - - - - - - Show advanced options - Hide advanced options - - -
    - - - -
    + +
    + - - + - - + + + + Show advanced options + Hide advanced options + + +
    + +
    +
    + + + diff --git a/public/views/tab-import-hardware.html b/public/views/tab-import-hardware.html index 835a46328..5f0b7c1b6 100644 --- a/public/views/tab-import-hardware.html +++ b/public/views/tab-import-hardware.html @@ -1,69 +1,50 @@ - - - - - - {{'Import wallet' | translate}} - +
    +
    +
    + No hardware wallets supported on this device +
    +
    - - - - -
    -
    - No hardware wallets supported on this device +
    +
    + + + + + + Shared Wallet + + + + Show advanced options + Hide advanced options + + +
    + +
    +
    -
    -
    - - - - - - - Shared Wallet - - - - Show advanced options - Hide advanced options - - -
    - - - -
    -
    - - -
    - - - - - + +
    + diff --git a/public/views/tab-import-phrase.html b/public/views/tab-import-phrase.html index 0473f6944..91447b758 100644 --- a/public/views/tab-import-phrase.html +++ b/public/views/tab-import-phrase.html @@ -1,84 +1,66 @@ - - - - - - Import wallet - +
    +
    Could not access the wallet at the server. Please check:
    +
      +
    • The password of the recovery phrase (if set)
    • +
    • The derivation path
    • +
    • The wallet service URL
    • +
    +
    + NOTE: To import a wallet from a 3rd party software, please go to Add Wallet > Create Wallet, and specify the Recovery Phrase there. +
    +
    - - -
    -
    Could not access the wallet at the server. Please check:
    -
      -
    • The password of the recovery phrase (if set)
    • -
    • The derivation path
    • -
    • The wallet service URL
    • -
    -
    - NOTE: To import a wallet from a 3rd party software, please go to Add Wallet > Create Wallet, and specify the Recovery Phrase there. +
    +
    +
    +
    + +
    +
    +
    - -
    + + Show advanced options + Hide advanced options + -
    -
    - -
    -
    - -
    -
    +
    + - - Show advanced options - Hide advanced options - + -
    + - + + Testnet + +
    +
    - - - - - - Testnet - -
    -
    - - -
    - - + + diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index 4ba74e011..8206ed56b 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -8,11 +8,13 @@ angular.module('copayApp.controllers').controller('importController', var reader = new FileReader(); var defaults = configService.getDefaults(); var errors = bwcService.getErrors(); + var derivationPath = 'livenet'; $scope.isSafari = platformInfo.isSafari; $scope.isCordova = platformInfo.isCordova; - $scope.bwsurl = defaults.bws.url; - $scope.derivationPath = derivationPathHelper.default; - $scope.account = 1; + $scope.formData = {}; + $scope.formData.bwsurl = defaults.bws.url; + $scope.formData.derivationPath = derivationPathHelper.default; + $scope.formData.account = 1; $scope.importErr = false; var updateSeedSourceSelect = function() { @@ -75,7 +77,7 @@ angular.module('copayApp.controllers').controller('importController', var _importBlob = function(str, opts) { var str2, err; try { - str2 = sjcl.decrypt($scope.password, str); + str2 = sjcl.decrypt($scope.formData.password, str); } catch (e) { err = gettextCatalog.getString('Could not decrypt file, check your password'); $log.warn(e); @@ -147,7 +149,7 @@ angular.module('copayApp.controllers').controller('importController', if (err) $log.error(err); }); } - + $state.go('tabs.home'); }); }, 100); @@ -176,11 +178,8 @@ angular.module('copayApp.controllers').controller('importController', }, 100); }; - $scope.setDerivationPath = function(testnetEnabled) { - if (testnetEnabled) - $scope.derivationPath = derivationPathHelper.defaultTestnet; - else - $scope.derivationPath = derivationPathHelper.default; + $scope.setDerivationPath = function() { + derivationPath = $scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default; }; $scope.getFile = function() { @@ -188,7 +187,7 @@ angular.module('copayApp.controllers').controller('importController', reader.onloadend = function(evt) { if (evt.target.readyState == FileReader.DONE) { // DONE == 2 var opts = {}; - opts.bwsurl = $scope.bwsurl; + opts.bwsurl = $scope.formData.bwsurl; _importBlob(evt.target.result, opts); } } @@ -200,9 +199,9 @@ angular.module('copayApp.controllers').controller('importController', return; } - var backupFile = $scope.file; - var backupText = form.backupText.$modelValue; - var password = form.password.$modelValue; + var backupFile = $scope.formData.file; + var backupText = $scope.formData.backupText; + var password = $scope.formData.password; if (!backupFile && !backupText) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Please, select your backup file')); @@ -213,7 +212,7 @@ angular.module('copayApp.controllers').controller('importController', reader.readAsBinaryString(backupFile); } else { var opts = {}; - opts.bwsurl = $scope.bwsurl; + opts.bwsurl = $scope.formData.bwsurl; _importBlob(backupText, opts); } }; @@ -225,19 +224,21 @@ angular.module('copayApp.controllers').controller('importController', } var opts = {}; - if ($scope.bwsurl) - opts.bwsurl = $scope.bwsurl; - var pathData = derivationPathHelper.parse($scope.derivationPath); + if ($scope.formData.bwsurl) + opts.bwsurl = $scope.formData.bwsurl; + + var pathData = derivationPathHelper.parse(derivationPath); if (!pathData) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid derivation path')); return; } + opts.account = pathData.account; opts.networkName = pathData.networkName; opts.derivationStrategy = pathData.derivationStrategy; - var words = form.words.$modelValue || null; + var words = $scope.formData.words || null; if (!words) { popupService.showAlert(gettextCatalog.getString('Please enter the recovery phrase')); @@ -254,9 +255,7 @@ angular.module('copayApp.controllers').controller('importController', } } - var passphrase = form.passphrase.$modelValue; - opts.passphrase = form.passphrase.$modelValue || null; - + opts.passphrase = $scope.formData.passphrase || null; _importMnemonic(words, opts); }; diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js index 88458c146..d9bee9bf3 100644 --- a/src/js/directives/directives.js +++ b/src/js/directives/directives.js @@ -107,7 +107,7 @@ angular.module('copayApp.directives') return { link: function($scope, el) { el.bind('change', function(e) { - $scope.file = (e.srcElement || e.target).files[0]; + $scope.formData.file = (e.srcElement || e.target).files[0]; $scope.getFile(); }); } diff --git a/src/js/routes.js b/src/js/routes.js index bde25a606..e5899e480 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -276,37 +276,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }) .state('tabs.import', { url: '/import', - // abstract: true, views: { 'tab-home': { templateUrl: 'views/import.html' }, }, }) - .state('tabs.import.phrase', { - url: '/tab-import-phrase', - views: { - 'tab-import-phrase': { - templateUrl: 'views/tab-import-phrase.html', - }, - } - }) - .state('tabs.import.file', { - url: '/tab-import-file', - views: { - 'tab-import-file': { - templateUrl: 'views/tab-import-file.html', - }, - } - }) - .state('tabs.import.hardware', { - url: '/tab-import-hardware', - views: { - 'tab-import-hardware': { - templateUrl: 'views/tab-import-hardware.html', - }, - } - }) .state('tabs.create', { url: '/create', views: { @@ -626,7 +601,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }) .state('onboarding.import', { url: '/import', - abstract: true, views: { 'onboarding': { templateUrl: 'views/import.html' @@ -637,30 +611,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr fromOnboarding: null }, }) - .state('onboarding.import.phrase', { - url: '/tab-import-phrase', - views: { - 'tab-import-phrase': { - templateUrl: 'views/tab-import-phrase.html', - }, - } - }) - .state('onboarding.import.file', { - url: '/tab-import-file', - views: { - 'tab-import-file': { - templateUrl: 'views/tab-import-file.html', - }, - } - }) - .state('onboarding.import.hardware', { - url: '/tab-import-hardware', - views: { - 'tab-import-hardware': { - templateUrl: 'views/tab-import-hardware.html', - }, - } - }) /* * From 9632fe8b64672cce6a6c763a37c928c77eb8272d Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 6 Sep 2016 16:40:57 -0300 Subject: [PATCH 05/11] complete import process --- public/views/import.html | 19 +---- public/views/onboarding/welcome.html | 2 +- public/views/tab-import-hardware.html | 18 ++--- src/js/controllers/import.js | 78 +++++++------------ .../onboarding/welcomeController.js | 2 +- 5 files changed, 40 insertions(+), 79 deletions(-) diff --git a/public/views/import.html b/public/views/import.html index 8f1eb7261..aa6d916a2 100644 --- a/public/views/import.html +++ b/public/views/import.html @@ -1,4 +1,4 @@ - + {{'Import Wallet' | translate}} @@ -6,7 +6,7 @@ - +
    Recovery phrase @@ -24,18 +24,3 @@
    - - - diff --git a/public/views/onboarding/welcome.html b/public/views/onboarding/welcome.html index 1c97d5274..f71e8a053 100644 --- a/public/views/onboarding/welcome.html +++ b/public/views/onboarding/welcome.html @@ -14,7 +14,7 @@
    - +
    diff --git a/public/views/tab-import-hardware.html b/public/views/tab-import-hardware.html index 5f0b7c1b6..18996d0da 100644 --- a/public/views/tab-import-hardware.html +++ b/public/views/tab-import-hardware.html @@ -11,21 +11,16 @@
    Wallet Type
    - + + -
    diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index 8206ed56b..01d452c6b 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -1,23 +1,26 @@ 'use strict'; angular.module('copayApp.controllers').controller('importController', - function($scope, $rootScope, $timeout, $log, $state, $stateParams, $ionicHistory, profileService, configService, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { + function($scope, $timeout, $log, $state, $stateParams, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) { var isChromeApp = platformInfo.isChromeApp; var isDevel = platformInfo.isDevel; var reader = new FileReader(); var defaults = configService.getDefaults(); var errors = bwcService.getErrors(); - var derivationPath = 'livenet'; - $scope.isSafari = platformInfo.isSafari; - $scope.isCordova = platformInfo.isCordova; - $scope.formData = {}; - $scope.formData.bwsurl = defaults.bws.url; - $scope.formData.derivationPath = derivationPathHelper.default; - $scope.formData.account = 1; - $scope.importErr = false; - var updateSeedSourceSelect = function() { + $scope.init = function() { + $scope.isSafari = platformInfo.isSafari; + $scope.isCordova = platformInfo.isCordova; + $scope.formData = {}; + $scope.formData.bwsurl = defaults.bws.url; + $scope.formData.derivationPath = derivationPathHelper.default; + $scope.formData.account = 1; + $scope.importErr = false; + + if ($stateParams.code) + $scope.processWalletInfo($stateParams.code); + $scope.seedOptions = []; if (isChromeApp) { @@ -38,6 +41,7 @@ angular.module('copayApp.controllers').controller('importController', $scope.processWalletInfo = function(code) { if (!code) return; + $scope.importErr = false; var parsedCode = code.split('|'); @@ -58,19 +62,12 @@ angular.module('copayApp.controllers').controller('importController', if (info.type == 1 && info.hasPassphrase) popupService.showAlert(gettextCatalog.getString('Password required. Make sure to enter your password in advanced options')); - $scope.derivationPath = info.derivationPath; - $scope.testnetEnabled = info.network == 'testnet' ? true : false; + $scope.formData.derivationPath = info.derivationPath; + $scope.formData.testnetEnabled = info.network == 'testnet' ? true : false; $timeout(function() { - $scope.words = info.data; - $rootScope.$apply(); - }, 1); - }; - - $scope.setType = function(type) { - $scope.type = type; - $timeout(function() { - $rootScope.$apply(); + $scope.formData.words = info.data; + $scope.$apply(); }, 1); }; @@ -85,9 +82,6 @@ angular.module('copayApp.controllers').controller('importController', if (err) { popupService.showAlert(gettextCatalog.getString('Error'), err); - $timeout(function() { - $rootScope.$apply(); - }); return; } @@ -179,7 +173,7 @@ angular.module('copayApp.controllers').controller('importController', }; $scope.setDerivationPath = function() { - derivationPath = $scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default; + $scope.formData.derivationPath = $scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default; }; $scope.getFile = function() { @@ -228,7 +222,8 @@ angular.module('copayApp.controllers').controller('importController', if ($scope.formData.bwsurl) opts.bwsurl = $scope.formData.bwsurl; - var pathData = derivationPathHelper.parse(derivationPath); + var pathData = derivationPathHelper.parse($scope.formData.derivationPath); + if (!pathData) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid derivation path')); return; @@ -268,7 +263,7 @@ angular.module('copayApp.controllers').controller('importController', } lopts.externalSource = 'trezor'; - lopts.bwsurl = $scope.bwsurl; + lopts.bwsurl = $scope.formData.bwsurl; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); @@ -284,45 +279,37 @@ angular.module('copayApp.controllers').controller('importController', }; $scope.importHW = function(form) { - if (form.$invalid || $scope.account < 0) { + if (form.$invalid || $scope.formData.ccount < 0) { popupService.showAlert(gettextCatalog.getString('There is an error in the form')); return; } + $scope.importErr = false; - var account = +$scope.account; + var account = $scope.formData.ccount; - if ($scope.seedSourceId == 'trezor') { + if ($scope.seedSource.id == 'trezor') { if (account < 1) { - $scope.error = gettext('Invalid account number'); + popupService.showAlert(gettextCatalog.getString('Invalid account number')); return; } account = account - 1; } - switch ($scope.seedSourceId) { + switch ($scope.seedSource.id) { case ('ledger'): ongoingProcess.set('connectingledger', true); $scope.importLedger(account); break; case ('trezor'): ongoingProcess.set('connectingtrezor', true); - $scope.importTrezor(account, $scope.isMultisig); + $scope.importTrezor(account, $scope.formData.isMultisig); break; default: throw ('Error: bad source id'); }; }; - $scope.setSeedSource = function() { - - if (!$scope.seedSource) return; - $scope.seedSourceId = $scope.seedSource.id; - $timeout(function() { - $rootScope.$apply(); - }); - }; - $scope.importLedger = function(account) { ledger.getInfoForNewWallet(true, account, function(err, lopts) { ongoingProcess.clear(); @@ -332,7 +319,7 @@ angular.module('copayApp.controllers').controller('importController', } lopts.externalSource = 'ledger'; - lopts.bwsurl = $scope.bwsurl; + lopts.bwsurl = $scope.formData.bwsurl; ongoingProcess.set('importingWallet', true); $log.debug('Import opts', lopts); @@ -348,7 +335,6 @@ angular.module('copayApp.controllers').controller('importController', }; var finish = function(wallet) { - walletService.updateRemotePreferences(wallet, {}, function() { $log.debug('Remote preferences saved for:' + wallet.credentials.walletId) }); @@ -361,8 +347,4 @@ angular.module('copayApp.controllers').controller('importController', } $state.go('tabs.home'); }; - - updateSeedSourceSelect(); - $scope.setSeedSource(); - if ($stateParams.code) $scope.processWalletInfo($stateParams.code); }); diff --git a/src/js/controllers/onboarding/welcomeController.js b/src/js/controllers/onboarding/welcomeController.js index f08a5b5eb..bb74b9206 100644 --- a/src/js/controllers/onboarding/welcomeController.js +++ b/src/js/controllers/onboarding/welcomeController.js @@ -3,7 +3,7 @@ angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $log, $ionicPopup, profileService) { $scope.goImport = function(code) { - $state.go('onboarding.import.phrase', { + $state.go('onboarding.import', { fromOnboarding: true, code: code }); From dfe8dea8bc6a27de4a6d6fb942cab28a602e5c5e Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 6 Sep 2016 17:24:49 -0300 Subject: [PATCH 06/11] fix variable --- src/js/controllers/tab-home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 24899dd56..18f0b236a 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -10,7 +10,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', configService.whenAvailable(function() { var config = configService.getSync(); - var isWindowsPhoneApp = platformInfo.isWP && isCordova; + var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; }); From 32bab4ff3ec616a4b1582cdd31c5fc82d2ddd57f Mon Sep 17 00:00:00 2001 From: Gabriel Bazan Date: Tue, 6 Sep 2016 17:44:07 -0300 Subject: [PATCH 07/11] make wp8 cordova project --- app-template/Makefile | 27 +++++++++++++++++---------- app-template/ProjectMakefile | 6 +++--- app-template/package.json | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app-template/Makefile b/app-template/Makefile index 058cbce10..f18321402 100644 --- a/app-template/Makefile +++ b/app-template/Makefile @@ -8,7 +8,7 @@ clean: rm -Rf $(WORKDIR)* -$(WORKDIR)android $(WORKDIR)ios $(WORKDIR)wp: config.xml +$(WORKDIR)android $(WORKDIR)ios: config.xml cordova create $@ com.bitpay.*NAMENOSPACE* *NAMECASENOSPACE* || echo "Project Path Existed" cp ProjectMakefile $@/Makefile rm -r $@/www && ln -sF ../../public $@/www @@ -27,16 +27,23 @@ android: project-android cp -R android/res/* $(WORKDIR)android/platforms/android/res make -C $(WORKDIR)android build-android +wp-init: config.xml + cordova create $(WORKDIR)$@ com.bitpay.*NAMENOSPACE* *NAMECASENOSPACE* || echo "Project Path Existed" + cp ProjectMakefile $(WORKDIR)$@/Makefile + mkdir -p $(WORKDIR)$@/www + cp -Rf ../public/* $(WORKDIR)$@/www + cp config.xml $(WORKDIR)$@/config.xml + make -C $(WORKDIR)$@ $(subst $(WORKDIR),, $(WORKDIR)$@) -wp: build-wp - cp -vf wp/Properties/* $ Date: Tue, 6 Sep 2016 17:47:21 -0300 Subject: [PATCH 08/11] fix grunt file --- Gruntfile.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1ef8ef2cf..05df4524b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,8 +28,11 @@ module.exports = function(grunt) { chrome: { command: 'make -C chrome-app ' }, - wp: { - command: 'make -C cordova wp', + wpinit: { + command: 'make -C cordova wp-init', + }, + wpcopy: { + command: 'make -C cordova wp-copy', }, ios: { command: 'make -C cordova ios', @@ -254,7 +257,8 @@ module.exports = function(grunt) { grunt.registerTask('osx', ['prod', 'nwjs', 'exec:osx']); grunt.registerTask('chrome', ['exec:chrome']); grunt.registerTask('wp', ['prod', 'exec:wp']); - grunt.registerTask('wp-debug', ['default', 'exec:wp']); + grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']); + grunt.registerTask('wp-init', ['default', 'exec:wpinit']); grunt.registerTask('ios', ['prod', 'exec:ios']); grunt.registerTask('ios-debug', ['default', 'exec:ios']); grunt.registerTask('ios-run', ['exec:xcode']); From cab4534797c57474c2c58e32540d6eebc5913462 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 6 Sep 2016 17:53:20 -0400 Subject: [PATCH 09/11] update link items --- public/views/preferences.html | 26 ++++++++++++------------ public/views/preferencesAbout.html | 12 +++++------ public/views/preferencesAdvanced.html | 24 +++++++++++----------- public/views/tab-export-file.html | 18 +++++++++-------- public/views/tab-settings.html | 29 ++++++++++++++------------- 5 files changed, 56 insertions(+), 53 deletions(-) diff --git a/public/views/preferences.html b/public/views/preferences.html index 27f1c2bc5..446951fcc 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -7,41 +7,41 @@
    diff --git a/public/views/preferencesAbout.html b/public/views/preferencesAbout.html index 1604fe98e..8857bf1b1 100644 --- a/public/views/preferencesAbout.html +++ b/public/views/preferencesAbout.html @@ -27,21 +27,21 @@
    - - - +
    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 2c821f634..2471f9a17 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -9,30 +9,30 @@ diff --git a/public/views/tab-export-file.html b/public/views/tab-export-file.html index 6e64f2fce..a0b9a9aee 100644 --- a/public/views/tab-export-file.html +++ b/public/views/tab-export-file.html @@ -17,14 +17,16 @@
    - - +
    + + +
    diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index 1b8220bb6..c462d950d 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -6,48 +6,49 @@
    - + +
    Preferences
    - + - + - + - +
    Notifications
    @@ -84,7 +85,7 @@
    Wallets Preferences
    -
    @@ -96,14 +97,14 @@ Incomplete -
    +
    - +
    From 6b19189caad2f18db8ad38bb91b2de23d753587c Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 6 Sep 2016 17:56:22 -0400 Subject: [PATCH 10/11] update nav link css --- public/views/add.html | 6 +++--- public/views/amazon.html | 2 +- public/views/glidera.html | 6 +++--- public/views/preferences.html | 12 ++++++------ public/views/preferencesAbout.html | 6 +++--- public/views/preferencesAdvanced.html | 12 ++++++------ public/views/tab-export-file.html | 18 ++++++++---------- public/views/tab-home.html | 14 +++++++------- public/views/tab-settings.html | 14 +++++++------- src/sass/common.scss | 1 + 10 files changed, 45 insertions(+), 46 deletions(-) diff --git a/public/views/add.html b/public/views/add.html index 4b24c8da7..491830b33 100644 --- a/public/views/add.html +++ b/public/views/add.html @@ -12,17 +12,17 @@

    Create new wallet

    - +

    Join shared wallet

    - +

    Import wallet

    - +
    diff --git a/public/views/amazon.html b/public/views/amazon.html index d32c8cca9..49edf5f46 100644 --- a/public/views/amazon.html +++ b/public/views/amazon.html @@ -36,7 +36,7 @@ Buy Gift Card - +
    diff --git a/public/views/glidera.html b/public/views/glidera.html index 038a5d5f0..4933fa584 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -90,7 +90,7 @@ {{email}} - +
    @@ -115,14 +115,14 @@ href ui-sref="glidera.buy"> buy bitcoin Buy Bitcoin - + buy bitcoin Sell Bitcoin - +
    diff --git a/public/views/preferences.html b/public/views/preferences.html index 446951fcc..fa1b74027 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -12,7 +12,7 @@ {{wallet.name}} - + Hardware Wallet @@ -25,7 +25,7 @@ - + Email Notifications @@ -33,14 +33,14 @@ Disabled {{wallet.email}} - +
    Security
    Backup - +
    @@ -54,12 +54,12 @@
    Delete recovery phrase - +
    Advanced - +
    diff --git a/public/views/preferencesAbout.html b/public/views/preferencesAbout.html index 8857bf1b1..ce5d07776 100644 --- a/public/views/preferencesAbout.html +++ b/public/views/preferencesAbout.html @@ -30,17 +30,17 @@ Terms of Use - + Translators - + Session log - +
    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 2471f9a17..e2a87c140 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -11,27 +11,27 @@
Wallet Information - + Sweep paper wallet - + Export Wallet - + Wallet Service URL - + Transaction History - + Delete Wallet - +
diff --git a/public/views/tab-export-file.html b/public/views/tab-export-file.html index a0b9a9aee..6e64f2fce 100644 --- a/public/views/tab-export-file.html +++ b/public/views/tab-export-file.html @@ -17,16 +17,14 @@
-
- - -
+ +
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 2d825d7d2..a31f00002 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -9,7 +9,7 @@
Payment Proposals - + {{txpsN}} @@ -22,7 +22,7 @@ diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index c462d950d..f7d2942a1 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -9,7 +9,7 @@ Address Book - +
Preferences
@@ -20,7 +20,7 @@ {{currentLanguageName|translate}} - + @@ -29,7 +29,7 @@ {{unitName}} - + @@ -38,7 +38,7 @@ {{selectedAlternative.name}} - + @@ -47,7 +47,7 @@ {{feeOpts[currentFeeLevel]|translate}} - +
@@ -96,14 +96,14 @@ Incomplete - +
About {{appName}} - +
diff --git a/src/sass/common.scss b/src/sass/common.scss index 9350009f1..34ab2e428 100644 --- a/src/sass/common.scss +++ b/src/sass/common.scss @@ -1,6 +1,7 @@ .icon.nav-item-arrow-right { color: #666; font-size: 26px; + @extend .ion-ios-arrow-right; } .item.item-heading { From 1d6fe3d59eff1eeffcb08e175cf138495c5eec68 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 7 Sep 2016 10:25:27 -0300 Subject: [PATCH 11/11] Fix openExtenalLink --- public/views/onboarding/terms.html | 2 +- src/js/controllers/onboarding/terms.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/views/onboarding/terms.html b/public/views/onboarding/terms.html index 1977b6a6e..61767e604 100644 --- a/public/views/onboarding/terms.html +++ b/public/views/onboarding/terms.html @@ -10,7 +10,7 @@
diff --git a/src/js/controllers/onboarding/terms.js b/src/js/controllers/onboarding/terms.js index a76d52b96..ac9473933 100644 --- a/src/js/controllers/onboarding/terms.js +++ b/src/js/controllers/onboarding/terms.js @@ -2,6 +2,7 @@ angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, uxLanguage, profileService, externalLinkService) { $scope.lang = uxLanguage.currentLanguage; + $scope.disclaimerUrl = $window.appConfig.disclaimerUrl; $scope.confirm = function() { profileService.setDisclaimerAccepted(function(err) {