Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(portfolio): add asset's attributes display
Fixed some bugs on loading assets balance
- Loading branch information
1 parent
a4fda81
commit fb04bb7
Showing
7 changed files
with
80 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
function AssetFilter(applicationContext, addressService) { | ||
function transformAddress (rawAddress) { | ||
var result = angular.isDefined(rawAddress) ? rawAddress : 'none'; | ||
|
||
if (result === applicationContext.account.address) | ||
result = 'You'; | ||
|
||
return result; | ||
} | ||
|
||
function formatAsset (transaction) { | ||
transaction.formatted = { | ||
sender: transformAddress(transaction.sender) | ||
}; | ||
|
||
transaction.formatted.isSenderCopiable = addressService.validateAddress(transaction.formatted.sender); | ||
|
||
return transaction; | ||
} | ||
|
||
return function filterInput (input) { | ||
return _.map(input, formatAsset); | ||
}; | ||
} | ||
|
||
AssetFilter.$inject = ['applicationContext', 'addressService']; | ||
|
||
angular | ||
.module('app.portfolio') | ||
.filter('asset', AssetFilter); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters