Remove Name field and copayer list on 1-of-1 wallets

This commit is contained in:
Yemel Jardi 2014-08-04 16:27:58 -03:00
parent 698bd3f616
commit 523a48b056
7 changed files with 21 additions and 9 deletions

View File

@ -50,7 +50,7 @@ angular.module('copayApp.controllers').controller('SendController',
var w = $rootScope.wallet;
w.createTx(address, amount, commentText, function(ntxid) {
if (w.totalCopayers > 1) {
if (w.isShared()) {
$scope.loading = false;
var message = 'The transaction proposal has been created';
notification.success('Success!', message);

View File

@ -913,6 +913,10 @@ Wallet.prototype.toggleAddressBookEntry = function(key) {
this.store();
};
Wallet.prototype.isShared = function() {
return this.totalCopayers > 1;
}
Wallet.prototype.isReady = function() {
var ret = this.publicKeyRing.isComplete() && this.publicKeyRing.isFullyBackup();
return ret;

View File

@ -363,6 +363,14 @@ describe('Wallet model', function() {
}, w.reconnectDelay * callCount * (callCount + 1) / 2);
});
it('#isSingleUser', function() {
var w = createW();
w.isShared().should.equal(true);
w.totalCopayers = 1;
w.isShared().should.equal(false);
});
it('#isReady', function() {
var w = createW();
w.publicKeyRing.isComplete().should.equal(false);

View File

@ -64,7 +64,7 @@
</li>
</ul>
<div ng-include="'views/includes/peer-list.html'"></div>
<div ng-show="$root.wallet.isShared()" ng-include="'views/includes/peer-list.html'"></div>
</div>

View File

@ -77,7 +77,7 @@
</div>
</div>
<div class="row" ng-show="wallet.totalCopayers > 1">
<div class="row" ng-show="wallet.isShared()">
<div class="large-12 columns">
<div class="row collapse">
<label for="comment">Note
@ -116,7 +116,7 @@
Including fee of {{defaultFee|noFractionNumber}} {{$root.unitName}}
</small>
</p>
<div ng-show="wallet.totalCopayers > 1">
<div ng-show="wallet.isShared()">
<h6>Note</h6>
<p ng-class="{'hidden': !commentText}">{{commentText}}</p>
</div>

View File

@ -16,7 +16,7 @@
<input type="text" placeholder="Family vacation funds" class="form-control" ng-model="walletName">
</label>
<div class="row" ng-show="isSetupWalletPage">
<div>
<div ng-if="totalCopayers > 1">
<label for="Name">Your name</label>
<input id="Name" type="text" placeholder="Name" class="form-control" ng-model="myNickname">
</div>

View File

@ -1,7 +1,7 @@
<div class="transactions" data-ng-controller="TransactionsController">
<div ng-show='$root.wallet.isReady()'>
<h1 ng-show="wallet.totalCopayers > 1"> Transaction proposals <small>({{txs.length}})</small></h1>
<div class="large-12" ng-show="wallet.totalCopayers > 1">
<h1 ng-show="wallet.isShared()"> Transaction proposals <small>({{txs.length}})</small></h1>
<div class="large-12" ng-show="wallet.isShared()">
<ul class="inline-list">
<li> <a class="text-gray size-12" ng-click="show(true)" ng-disabled="loading || onlyPending" loading="Updating" ng-class="{'active' : onlyPending}"> [ Pending ] </a> </li>
<li> <a class="text-gray size-12" ng-click="show()" ng-disabled="loading || !onlyPending" loading="Updating" ng-class="{'active' : !onlyPending}"> [ All ] </a> </li>
@ -135,9 +135,9 @@
<pagination ng-show="!onlyPending && txs.length > txpItemsPerPage" total-items="txs.length" items-per-page="txpItemsPerPage" page="txpCurrentPage" on-select-page="show()" class="pagination-small primary"></pagination>
</div>
<h1 ng-class="{'line-dashed': wallet.totalCopayers > 1}">
<h1 ng-class="{'line-dashed': wallet.isShared()}">
Last transactions
<small ng-hide="wallet.totalCopayers > 1 || !loading">
<small ng-hide="wallet.isShared() || !loading">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</small>
</h1>