show label and comment in view

This commit is contained in:
Ivan Socolsky 2014-10-23 12:33:55 -03:00 committed by Matias Alejo Garcia
commit ccb138f605
4 changed files with 9 additions and 8 deletions

View file

@ -3000,9 +3000,8 @@ Wallet.prototype.getTransactionHistory = function(cb) {
}); });
var proposal = _.findWhere(proposals, { var proposal = _.findWhere(proposals, {
ntxid: tx.txid sentTxid: tx.txid
}); });
tx.comment = proposal ? proposal.comment : undefined; tx.comment = proposal ? proposal.comment : undefined;
tx.labelTo = firstOut ? firstOut.label : undefined; tx.labelTo = firstOut ? firstOut.label : undefined;
tx.amountSat = Math.abs(amount); tx.amountSat = Math.abs(amount);
@ -3010,7 +3009,8 @@ Wallet.prototype.getTransactionHistory = function(cb) {
}; };
if (addresses.length > 0) { if (addresses.length > 0) {
self.blockchain.getTransactions(addresses, function(err, txs) { var addressesStr = _.pluck(addresses, 'addressStr');
self.blockchain.getTransactions(addressesStr, function(err, txs) {
if (err) return cb(err); if (err) return cb(err);
var history = _.map(txs, function(tx) { var history = _.map(txs, function(tx) {

View file

@ -2163,10 +2163,10 @@ describe('Wallet model', function() {
}]); }]);
w.getTxProposals = sinon.stub().returns([{ w.getTxProposals = sinon.stub().returns([{
ntxid: 'id0', sentTxid: 'id0',
comment: 'My comment', comment: 'My comment',
}, { }, {
ntxid: 'id1', sentTxid: 'id1',
comment: 'Another comment', comment: 'Another comment',
}]); }]);
w.getTransactionHistory(function(err, res) { w.getTransactionHistory(function(err, res) {

View file

@ -108,7 +108,7 @@
</div> </div>
</div> </div>
<div class="row collapse" ng-show="wallet.isShared()"> <div class="row collapse">
<div class="large-12 columns"> <div class="large-12 columns">
<div class="row collapse"> <div class="row collapse">
<label for="comment"><span translate>Note</span> <label for="comment"><span translate>Note</span>
@ -117,7 +117,7 @@
</label> </label>
<div class="large-12 columns"> <div class="large-12 columns">
<textarea id="comment" ng-disabled="loading" <textarea id="comment" ng-disabled="loading"
name="comment" placeholder="{{'Leave a private message to your copayers'|translate}}" ng-model="commentText" ng-maxlength="100"></textarea> name="comment" placeholder="{{(wallet.isShared() ? 'Leave a private message to your copayers' : 'Add a private comment to identify the transaction') |translate}}" ng-model="commentText" ng-maxlength="100"></textarea>
</div> </div>
</div> </div>
</div> </div>

View file

@ -52,7 +52,8 @@
</div> </div>
</div> </div>
<div class="last-transactions-content"> <div class="last-transactions-content">
{{btx.action}} {{btx.action}} <span ng-show="btx.labelTo">to {{btx.labelTo}}</span>
<span ng-show="btx.comment">{{btx.comment}}</span>
</div> </div>
<div class="last-transactions-footer"> <div class="last-transactions-footer">
<div class="row collapse"> <div class="row collapse">