Show unconfirmed balances in toplist #112

Merged
raucao merged 10 commits from feature/111-unconfirmed_balances into master 2019-05-01 19:30:36 +00:00
3 changed files with 13 additions and 8 deletions
Showing only changes of commit 109ffd2898 - Show all commits
+2 -2
View File
@@ -9,10 +9,10 @@ export default Component.extend({
actions: {
toggleContributorInfo(contributor) {
if (contributor.get('showMetadata')) {
if (contributor.showMetadata) {
contributor.set('showMetadata', false);
} else {
this.contributors.setEach('showMetadata', false);
this.contributorList.setEach('showMetadata', false);
contributor.set('showMetadata', true);
}
}
+8 -4
View File
@@ -1,6 +1,6 @@
<tbody>
{{#each contributorList as |c|}}
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c.contributor}}>
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c}}>
<td class="person">
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
</td>
@@ -18,12 +18,16 @@
<tr class="metadata {{if (is-current-user c.contributor) "current-user"}} {{if c.showMetadata "visible"}}">
<td colspan="2">
<ul>
<li><a href="https://testnet.etherscan.io/address/{{c.contributor.account}}">Inspect Ethereum transactions</a></li>
<li>
<a href="https://testnet.etherscan.io/address/{{c.contributor.account}}" target="_blank" rel="noopener">Inspect Ethereum transactions</a>
</li>
{{#if c.contributor.ipfsHash}}
<li><a href="https://ipfs.io/ipfs/{{c.contributor.ipfsHash}}">Inspect IPFS profile</a></li>
<li>
<a href="https://ipfs.io/ipfs/{{c.contributor.ipfsHash}}" target="_blank" rel="noopener">Inspect IPFS profile</a>
</li>
{{/if}}
</ul>
{{#if c.contributor.showMetadata}}
{{#if c.showMetadata}}
<pre>{{c.contributor.ipfsData}}</pre>
{{/if}}
</td>
+3 -2
View File
@@ -3,6 +3,7 @@ import Kredits from 'npm:kredits-contracts';
import RSVP from 'rsvp';
import Service from '@ember/service';
import EmberObject from '@ember/object';
import { computed } from '@ember/object';
import { alias, notEmpty } from '@ember/object/computed';
import { isEmpty } from '@ember/utils';
@@ -50,12 +51,12 @@ export default Service.extend({
return contributionsGrouped.map(c => {
const amountUnconfirmed = c.items.mapBy('amount').reduce((a, b) => a + b);
const contributor = this.contributors.findBy('id', c.value.toString());
return {
return EmberObject.create({
contributor: contributor,
amountUnconfirmed: amountUnconfirmed,
amountConfirmed: contributor.totalKreditsEarned,
amountTotal: contributor.totalKreditsEarned + amountUnconfirmed
}
})
})
}),