Skip to content

Commit

Permalink
Handle check-only records in the transaction details page
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavien committed Nov 12, 2015
1 parent b533482 commit dcdb215
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions www/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ module.controller("TransactionInfoController", function ($scope, $rootScope, $ro
var key = LedgerRecord.parse(record.key);
if (key.recordType == "ACC") {
return apiService.getAccount(endpoint, key.path.toString(), key.name, record.version).then(function (previousRecord) {
var newValue = encodingService.decodeInt64(record.value.data);
var newValue = record.value == null ? null : encodingService.decodeInt64(record.value.data);
parsedTransaction.acc_records.push({
key: key,
valueDelta: newValue.subtract(previousRecord.balance),
valueDelta: newValue == null ? null : newValue.subtract(previousRecord.balance),
value: newValue
});
});
} else if (key.recordType == "DATA") {
parsedTransaction.data_records.push({
key: key,
value: encodingService.decodeString(record.value.data)
value: record.value == null ? null : encodingService.decodeString(record.value.data)
});
}
})).then(function (result) {
Expand Down
4 changes: 4 additions & 0 deletions www/less/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,8 @@ footer {
white-space: nowrap;
overflow: hidden;
}
}

.data-record-block {
margin-bottom: 50px;
}
5 changes: 3 additions & 2 deletions www/views/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4>Accounts</h4>

<div ng-show="transaction.data_records.length > 0">
<h4>Data records</h4>
<div ng-repeat="record in transaction.data_records">
<div class="data-record-block" ng-repeat="record in transaction.data_records">
<table class="table table-condensed record-property-table">
<tr>
<th>Path</th>
Expand All @@ -66,7 +66,8 @@ <h4>Data records</h4>
<td>{{ record.key.name }}</td>
</tr>
</table>
<pre>{{ record.value }}</pre>
<pre ng-show="record.value">{{ record.value }}</pre>
<p ng-hide="record.value" class="text-center">The value was not modified</p>
</div>
</div>

Expand Down

0 comments on commit dcdb215

Please sign in to comment.