Merge pull request #66 from JDonadio/fix/tabs-import

Fix/tabs import
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-07 11:02:44 -03:00 committed by GitHub
commit 7dae3c7034
10 changed files with 203 additions and 343 deletions

View file

@ -20,7 +20,7 @@
<i class="icon nav-item-arrow-right"></i>
</a>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.import.phrase">
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.import">
<h2 translate>Import wallet</h2>
<i class="icon nav-item-arrow-right"></i>
</a>

View file

@ -1,33 +1,26 @@
<ion-view ng-controller="tabsController" ng-init="importInit()">
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top">
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Import Wallet' | translate}}</ion-nav-title>
<ion-nav-back-button>
<i class="icon ion-ios-arrow-thin-left"></i>
</ion-nav-back-button>
</ion-nav-bar>
<div ng-if="!fromOnboarding">
<ion-tab title="Recovery Phrase" ui-sref="tabs.import.phrase">
<ion-nav-view name="tab-import-phrase"></ion-nav-view>
</ion-tab>
<ion-tab title="File/Text" ui-sref="tabs.import.file">
<ion-nav-view name="tab-import-file"></ion-nav-view>
</ion-tab>
<ion-tab title="Hardware Wallet" ui-sref="tabs.import.hardware">
<ion-nav-view name="tab-import-hardware"></ion-nav-view>
</ion-tab>
<ion-content ng-controller="importController" ng-init="phrase = true; init()">
<div class="row text-center">
<div class="col" ng-click="phrase = true; file = hardware = false" ng-style="phrase && {'border-bottom': '2px solid'}">
<span translate>Recovery phrase</span>
</div>
<div class="col" ng-click="file = true; phrase = hardware = false" ng-style="file && {'border-bottom': '2px solid'}">
<span translate>File/Text</span>
</div>
<div class="col" ng-click="hardware = true; phrase = file = false" ng-style="hardware && {'border-bottom': '2px solid'}">
<span translate>Hardware wallet</span>
</div>
</div>
<div ng-if="fromOnboarding">
<ion-tab title="Recovery Phrase" ui-sref="onboarding.import.phrase">
<ion-nav-view name="tab-import-phrase"></ion-nav-view>
</ion-tab>
<ion-tab title="File/Text" ui-sref="onboarding.import.file">
<ion-nav-view name="tab-import-file"></ion-nav-view>
</ion-tab>
<ion-tab title="Hardware Wallet" ui-sref="onboarding.import.hardware">
<ion-nav-view name="tab-import-hardware"></ion-nav-view>
</ion-tab>
</div>
</ion-tabs>
<div ng-include="'views/tab-import-phrase.html'" ng-if="phrase"></div>
<div ng-include="'views/tab-import-file.html'" ng-if="file"></div>
<div ng-include="'views/tab-import-hardware.html'" ng-if="hardware"></div>
</ion-content>
</ion-view>

View file

@ -14,7 +14,7 @@
<button class="button button-block get-started col col-75" href ui-sref="onboarding.tour" translate>Get started</button>
</div>
<div class="row">
<button class="button button-block restore col col-75" translate href ui-sref="onboarding.import.phrase({'fromOnboarding':true})">Restore</button>
<button class="button button-block restore col col-75" translate href ui-sref="onboarding.import({'fromOnboarding':true})">Restore</button>
</div>
</ion-content>
</ion-view>

View file

@ -1,61 +1,40 @@
<ion-view>
<ion-nav-bar class="bar-royal" ng-controller="backController">
<ion-nav-buttons side="primary">
<button class="button back-button" ng-click="importGoBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-title>{{'Import wallet' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content ng-controller="importController" ng-init="type='file'">
<form name="importForm" ng-submit="importBlob(importForm)" novalidate>
<div class="list card">
<label class="item item-input item-stacked-label no-border" ng-show="!isSafari && !isCordova">
<div class="input-label" translate>Choose a backup file from your computer</div>
<div>
<input type="file"
placeholder="{{'Select a backup file'|translate}}"
name="backupFile"
ng-model="backupFile" ng-file-select>
</div>
</label>
<label class="item item-input item-stacked-label" ng-show="isSafari || isCordova">
<span class="input-label" translate>Paste the backup plain text code</span>
<textarea name="backupText" ng-model="backupText" rows="5"></textarea>
</label>
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Password</span>
<input type="password"
placeholder="{{'Your password'|translate}}"
name="password"
ng-model="password">
</label>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
</label>
</div>
<form name="importForm" ng-submit="importBlob(importForm)" novalidate>
<div class="list card">
<label class="item item-input item-stacked-label no-border" ng-show="!isSafari && !isCordova">
<div class="input-label" translate>Choose a backup file from your computer</div>
<div>
<input type="file"
placeholder="{{'Select a backup file'|translate}}"
ng-model="formData.backupFile" ng-file-select>
</div>
</label>
<button type="submit" class="button button-block button-positive" ng-disabled="importForm.$invalid || !password " translate>
Import backup
</button>
</form>
<label class="item item-input item-stacked-label" ng-show="isSafari || isCordova">
<span class="input-label" translate>Paste the backup plain text code</span>
<textarea ng-model="formData.backupText" rows="5"></textarea>
</label>
</ion-content>
</ion-view>
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Password</span>
<input type="password"
placeholder="{{'Your password'|translate}}"
ng-model="formData.password">
</label>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" ng-model="formData.bwsurl">
</label>
</div>
</div>
<button type="submit" class="button button-block button-positive" ng-disabled="importForm.$invalid || !formData.password" translate>
Import backup
</button>
</form>

View file

@ -1,69 +1,44 @@
<ion-view>
<ion-nav-bar class="bar-royal" ng-controller="backController">
<ion-nav-buttons side="primary">
<button class="button back-button" ng-click="importGoBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-title>{{'Import wallet' | translate}}</ion-nav-title>
</ion-nav-bar>
<form name="importForm3" ng-submit="importHW(importForm3)" novalidate>
<div class="card" ng-show="!seedOptions[0]">
<div class="item item-text-wrap" translate>
No hardware wallets supported on this device
</div>
</div>
<ion-content ng-controller="importController" ng-init="type='hwWallet'">
<form name="importForm3" ng-submit="importHW(importForm3)" novalidate>
<div class="card" ng-show="!seedOptions[0]">
<div class="item item-text-wrap" translate>
No hardware wallets supported on this device
<div ng-show="seedOptions[0]">
<div class="card list">
<label class="item item-input item-select">
<div class="input-label" translate>
Wallet Type
</div>
<select ng-model="seedSource" ng-options="seed as seed.label for seed in seedOptions"></select>
</label>
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'trezor' || seedSource.id == 'ledger'">
<span class="input-label" translate>Account Number</span>
<input type="number" ng-model="formData.account" ignore-mouse-wheel>
</label>
<ion-toggle ng-show="seedSource.id == 'trezor'" ng-model="formData.isMultisig" toggle-class="toggle-positive">
<span translate>Shared Wallet</span>
</ion-toggle>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" ng-model="formData.bwsurl">
</label>
</div>
</div>
<div ng-show="seedOptions[0]">
<div class="card list">
<label class="item item-input item-select">
<div class="input-label" translate>
Wallet Type
</div>
<select ng-model="seedSource"
ng-options="seed as seed.label for seed in seedOptions"
ng-change="setSeedSource()">
</select>
</label>
<label class="item item-input item-stacked-label"
ng-show="seedSourceId == 'trezor' || seedSourceId == 'ledger'">
<span class="input-label" translate>Account Number</span>
<input type="number" id="account" ng-model="account" ignore-mouse-wheel>
</label>
<ion-toggle ng-show="seedSourceId == 'trezor'"
ng-model="isMultisig"
toggle-class="toggle-positive">
<span translate>Shared Wallet</span>
</ion-toggle>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
</label>
</div>
</div>
<button translate type="submit" class="button button-block button-positive">
Import
</button>
</div> <!-- seedoptions show -->
</form>
</ion-content>
</ion-view>
<button translate type="submit" class="button button-block button-positive">
Import
</button>
</div> <!-- seedoptions show -->
</form>

View file

@ -1,84 +1,66 @@
<ion-view>
<ion-nav-bar class="bar-royal" ng-controller="backController">
<ion-nav-buttons side="primary">
<button class="button back-button" ng-click="importGoBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-title>Import wallet</ion-nav-title>
</ion-nav-bar>
<div ng-show="importErr" class="padding assertive" ng-click="importErr = null">
<div translate>Could not access the wallet at the server. Please check:</div>
<ul>
<li translate>The password of the recovery phrase (if set)</li>
<li translate>The derivation path</li>
<li translate>The wallet service URL</li>
</ul>
<div translate>
NOTE: To import a wallet from a 3rd party software, please go to Add Wallet &gt; Create Wallet, and specify the Recovery Phrase there.
</div>
</div>
<ion-content ng-controller="importController" ng-init="type='12'">
<div ng-show="importErr" class="padding assertive" ng-click="importErr = null">
<div translate>Could not access the wallet at the server. Please check:</div>
<ul>
<li translate>The password of the recovery phrase (if set)</li>
<li translate>The derivation path</li>
<li translate>The wallet service URL</li>
</ul>
<div translate>
NOTE: To import a wallet from a 3rd party software, please go to Add Wallet &gt; Create Wallet, and specify the Recovery Phrase there.
<form name="importForm12" ng-submit="importMnemonic(importForm12)" novalidate>
<div class="list card">
<div class="row">
<div class="col col-90">
<label class="item item-input item-stacked-label no-border">
<span class="input-label" translate>Type the Recovery Phrase (usually 12 words)</span>
<textarea ng-model="formData.words"
rows="3"
autocapitalize="off"
spellcheck="false"></textarea>
</label>
</div>
<div class="col text-center">
<qr-scanner class="qr-icon size-24" on-scan="processWalletInfo(data)"></qr-scanner>
</div>
</div>
<form name="importForm12" ng-submit="importMnemonic(importForm12)" novalidate>
<div class="list card">
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<div class="row">
<div class="col col-90">
<label class="item item-input item-stacked-label no-border">
<span class="input-label" translate>Type the Recovery Phrase (usually 12 words)</span>
<textarea name="words"
ng-model="words"
rows="3"
autocapitalize="off"
spellcheck="false"></textarea>
</label>
</div>
<div class="col text-center">
<qr-scanner class="qr-icon size-24" on-scan="processWalletInfo(data)"></qr-scanner>
</div>
</div>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Password</span>
<input type="text"
placeholder="{{'The recovery phrase could require a password to be imported'|translate}}"
autocapitalize="off"
ng-model="formData.passphrase">
</label>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span>
<span translate ng-show="showAdv">Hide advanced options</span>
</ion-toggle>
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Derivation Path</span>
<input type="text"
placeholder="{{'BIP32 path for address derivation'|translate}}"
ng-model="formData.derivationPath">
</label>
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" ng-model="formData.bwsurl">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
</label>
<ion-toggle ng-model="formData.testnetEnabled" ng-change="setDerivationPath()" toggle-class="toggle-positive">
Testnet
</ion-toggle>
</div>
</div>
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Password</span>
<input type="text"
placeholder="{{'The recovery phrase could require a password to be imported'|translate}}"
autocapitalize="off"
name="passphrase"
ng-model="passphrase">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Derivation Path</span>
<input type="text"
placeholder="{{'BIP32 path for address derivation'|translate}}"
name="derivationPath"
ng-model="derivationPath">
</label>
<ion-toggle ng-model="testnetEnabled" ng-change="setDerivationPath(testnetEnabled)" toggle-class="toggle-positive">
Testnet
</ion-toggle>
</div>
</div>
<button type="submit"
class="button button-block button-positive"
ng-disabled="importForm12.$invalid" translate>Import</button>
</form>
</ion-content>
</ion-view>
<button type="submit"
class="button button-block button-positive"
ng-disabled="importForm12.$invalid" translate>Import
</button>
</form>