Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f1ec4887e | |||
| fe16a605c1 | |||
| 9cf743b02a | |||
| d7294d9d7f | |||
| d8a9886442 | |||
| d83d671580 | |||
| 0bbca079c5 | |||
| 8bd7a77d44 | |||
| a73a4da575 | |||
| 8cc1b02d19 | |||
| 6b49ca26c0 | |||
| ffe555e2ee | |||
| aa98b35796 | |||
| b2bbbfd010 | |||
| edd7ffd3c5 | |||
| abb7d95804 | |||
| 0e0b1afe3a | |||
| 29a6d79d38 | |||
| 07c579850e | |||
| 091ebf4b6a |
@@ -1,9 +1,53 @@
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
import { sort } from '@ember/object/computed';
|
||||
import { isPresent } from '@ember/utils';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
|
||||
tagName: 'ul',
|
||||
classNames: ['contribution-list'],
|
||||
tagName: 'div',
|
||||
classNames: ['contributions'],
|
||||
|
||||
showQuickFilter: false,
|
||||
hideSmallContributions: false,
|
||||
contributorId: null,
|
||||
contributionKind: null,
|
||||
|
||||
kredits: service(),
|
||||
|
||||
contributorsSorting: Object.freeze(['name:asc']),
|
||||
contributors: sort('kredits.contributors', 'contributorsSorting'),
|
||||
|
||||
contributorsActive: computed('contributors.[]', 'contributions', function() {
|
||||
let activeIds = this.contributions.mapBy('contributorId')
|
||||
.map(id => id.toString())
|
||||
.uniq();
|
||||
return this.contributors.filter(c => {
|
||||
return activeIds.includes(c.id.toString());
|
||||
});
|
||||
}),
|
||||
|
||||
contributionKinds: computed('contributions.[]', function() {
|
||||
return this.contributions.mapBy('kind').uniq();
|
||||
}),
|
||||
|
||||
contributionsFiltered: computed('contributions.[]', 'hideSmallContributions', 'contributorId', 'contributionKind', function() {
|
||||
return this.contributions.filter(c => {
|
||||
let included = true;
|
||||
|
||||
if (this.hideSmallContributions &&
|
||||
c.amount <= 500) { included = false; }
|
||||
|
||||
if (isPresent(this.contributorId) &&
|
||||
c.contributorId.toString() !== this.contributorId.toString()) { included = false; }
|
||||
|
||||
if (isPresent(this.contributionKind) &&
|
||||
c.kind !== this.contributionKind) { included = false; }
|
||||
|
||||
return included;
|
||||
});
|
||||
}),
|
||||
|
||||
actions: {
|
||||
|
||||
|
||||
@@ -1,25 +1,58 @@
|
||||
{{#each contributions as |contribution|}}
|
||||
<li data-contribution-id={{contribution.id}} class="{{contribution-status contribution}} {{if contribution.vetoed "vetoed"}}">
|
||||
<p class="meta">
|
||||
<span class="recipient">{{user-avatar contributor=contribution.contributor}}</span>
|
||||
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
|
||||
<span class="title">
|
||||
{{#if contribution.url}}
|
||||
<a href={{contribution.url}} target="_blank" rel="noopener">{{contribution.description}}</a>
|
||||
{{else}}
|
||||
{{contribution.description}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{#if showQuickFilter}}
|
||||
<div class="quick-filter">
|
||||
<p>
|
||||
<label class="filter-contributor">
|
||||
Contributor:
|
||||
<select onchange={{action (mut contributorId) value="target.value"}}>
|
||||
<option value="" selected>all</option>
|
||||
{{#each contributorsActive as |contributor|}}
|
||||
<option value={{contributor.id}} selected={{eq contributorId contributor.id}}>{{contributor.name}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label class="filter-contribution-kind">
|
||||
Kind:
|
||||
<select onchange={{action (mut contributionKind) value="target.value"}}>
|
||||
<option value="" selected>all</option>
|
||||
{{#each contributionKinds as |kind|}}
|
||||
<option value={{kind}} selected={{eq contributionKind kind}}>{{capitalize-string kind}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label class="filter-contribution-size">
|
||||
{{input type="checkbox" checked=hideSmallContributions}}
|
||||
Hide small contributions
|
||||
</label>
|
||||
</p>
|
||||
<p class="kredits-amount">
|
||||
<span class="amount">{{contribution.amount}}</span><span class="symbol">₭S</span>
|
||||
</p>
|
||||
{{#unless contribution.vetoed}}
|
||||
{{#unless (is-confirmed-contribution contribution)}}
|
||||
<p class="voting">
|
||||
<button {{action "veto" contribution.id}} class="small danger">veto</button>
|
||||
</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<ul class="contribution-list">
|
||||
{{#each contributionsFiltered as |contribution|}}
|
||||
<li data-contribution-id={{contribution.id}} class="{{contribution-status contribution}} {{if contribution.vetoed "vetoed"}}">
|
||||
<p class="meta">
|
||||
<span class="recipient">{{user-avatar contributor=contribution.contributor}}</span>
|
||||
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
|
||||
<span class="title">
|
||||
{{#if contribution.url}}
|
||||
<a href={{contribution.url}} target="_blank" rel="noopener" title={{contribution.description}}>{{contribution.description}}</a>
|
||||
{{else}}
|
||||
{{contribution.description}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</p>
|
||||
<p class="kredits-amount">
|
||||
<span class="amount">{{contribution.amount}}</span><span class="symbol">₭S</span>
|
||||
</p>
|
||||
{{#unless contribution.vetoed}}
|
||||
{{#unless (is-confirmed-contribution contribution)}}
|
||||
<p class="voting">
|
||||
<button {{action "veto" contribution.id}} class="small danger">veto</button>
|
||||
</p>
|
||||
{{/unless}}
|
||||
{{/unless}}
|
||||
{{/unless}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
@@ -1,20 +1,18 @@
|
||||
import Component from '@ember/component';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
|
||||
router: service(),
|
||||
|
||||
tagName: 'table',
|
||||
classNames: 'contributor-list',
|
||||
selectedContributor: null,
|
||||
|
||||
actions: {
|
||||
|
||||
toggleContributorInfo(contributor) {
|
||||
if (contributor.showMetadata) {
|
||||
contributor.set('showMetadata', false);
|
||||
} else {
|
||||
this.contributorList.setEach('showMetadata', false);
|
||||
contributor.set('showMetadata', true);
|
||||
}
|
||||
openContributorDetails(contributor) {
|
||||
this.router.transitionTo('dashboard.contributors.show', contributor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tbody>
|
||||
{{#each contributorList as |c|}}
|
||||
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c}}>
|
||||
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "openContributorDetails" c.contributor}}>
|
||||
<td class="person">
|
||||
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
||||
</td>
|
||||
@@ -15,25 +15,5 @@
|
||||
<span class="symbol">₭S</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="metadata {{if (is-current-user c.contributor) "current-user"}} {{if c.showMetadata "visible"}}">
|
||||
<td colspan="2">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://rinkeby.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}}" target="_blank" rel="noopener">Inspect IPFS profile</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
{{link-to "Edit profile" "contributors.edit" c.contributor.id}}
|
||||
</li>
|
||||
</ul>
|
||||
{{#if c.showMetadata}}
|
||||
<pre>{{c.contributor.ipfsData}}</pre>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "",
|
||||
account: null,
|
||||
|
||||
iconComponentName: computed('account.site', function() {
|
||||
if (this.account.site.match(/github|gitea|wiki/)) {
|
||||
return 'icon-account-' + this.account.site.replace(/\./g, '-');
|
||||
} else {
|
||||
return 'icon-web-globe';
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
<a href={{account.url}} target="_blank" rel="noopener" title="{{account.username}} on {{account.site}}">
|
||||
<span class="site">{{account.site}}</span>
|
||||
{{component iconComponentName}}
|
||||
</a>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: ""
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.0 KiB |
@@ -0,0 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: ""
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<svg id="svg825" class="icon-github" width="260" height="260" enable-background="new 0 0 212.4575 186.23" version="1.1" viewBox="0 0 260 260" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<g transform="translate(23.766 36.885)">
|
||||
<path d="m151.79 86.234c-7.078 0.1229-14.154 0.5605-21.232 0.7069-12.318 0.248-24.64 0.5664-36.961 0.512-11.176-0.0472-22.358-0.9728-33.518-0.7052-7.3164 0.1776-14.373 2.2948-20.131 7.584-9.9472 9.1368-12.522 21-11.314 33.807 1.92 20.357 9.2716 31.449 29.115 37.064 15.793 4.4704 31.963 5.2088 48.199 4.9744 5.254 0 10.51 0.1367 15.758-0.0292 12.723-0.4064 25.264-2.2072 37.358-6.3596 10.846-3.7225 18.799-10.691 22.572-22.166 2.6736-8.1288 3.7148-16.388 2.5544-24.853-1.7772-12.959-13.275-30.86-32.4-30.535zm-81.576 59.996c-8.836 0-16-8.9551-16-20 0-11.045 7.164-20 16-20s16 8.9553 16 20c0 11.045-7.164 20-16 20zm76 0c-8.836 0-16-8.9551-16-20 0-11.045 7.164-20 16-20s16 8.9553 16 20c0 11.045-7.164 20-16 20z" fill="none"/>
|
||||
<path class="fg" d="m200.25 59.188c-2.5076-3.4493-4.3632-6.3888-3.8748-11.44 0.6796-7.0664-0.3536-14.396-1.3204-21.518-1.2188-8.9843-3.5236-17.74-7.1776-26.23-9.0332 1.9356-17.981 3.49-25.963 8.0976-8.4648 4.8908-16.695 10.215-25.08 15.25-0.9532 0.5704-2.3124 0.8848-3.3848 0.7032-17.967-3.1368-35.92-3.0196-53.898-0.086-1.3632 0.2244-3.0724-0.2345-4.2948-0.9608-4.4436-2.6604-8.6564-5.7344-13.123-8.3516-11.656-6.844-23.66-12.822-37.494-14.59-0.3928 0.8597-0.7188 1.4785-0.9612 2.1253-4.164 11.22-6.6424 22.844-7.4276 34.82-0.2872 4.3516-0.6092 8.8048 0 13.072 0.3456 2.4296-4e-3 3.8788-1.3924 5.6132-4.8516 6.0488-8.6368 12.717-11.102 20.219-4.6972 14.295-4.4004 28.861-2.2756 43.475 1.7268 11.974 4.7344 23.537 11.324 33.873 13.186 20.682 32.892 29.774 55.572 31.705 19.308 1.6464 38.8 1.1992 58.213 1.2364 13.855 0.0251 27.57-1.4924 40.715-6.6389 20.375-7.9727 33.859-22.604 40.275-44.166 3.7344-12.545 5.2324-25.396 4.8144-38.498-0.4412-13.81-4.0504-26.566-12.144-37.711zm-18.609 82.435c-3.7736 11.475-11.727 18.444-22.572 22.166-12.094 4.1524-24.635 5.9532-37.358 6.3596-5.248 0.1659-10.504 0.0292-15.758 0.0292-16.236 0.2344-32.406-0.504-48.199-4.9744-19.844-5.6152-27.195-16.707-29.115-37.064-1.2072-12.807 1.3672-24.67 11.314-33.807 5.7576-5.2892 12.814-7.4064 20.131-7.584 11.16-0.2676 22.342 0.658 33.518 0.7052 12.32 0.0544 24.642-0.264 36.961-0.512 7.0784-0.1464 14.154-0.584 21.232-0.7069 19.125-0.3243 30.623 17.576 32.4 30.535 1.1604 8.4647 0.1192 16.724-2.5544 24.853z"/>
|
||||
<ellipse class="fg" cx="70.214" cy="126.23" rx="16" ry="20"/>
|
||||
<ellipse class="fg" cx="146.21" cy="126.23" rx="16" ry="20"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: ""
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<svg class="icon-wiki" width="120" height="120" version="1.1" viewBox="0 0 120 120" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<g transform="translate(18.1,3)">
|
||||
<polygon class="fg" transform="translate(-6.2,9)" points="6.2 5 45.7 20.5 45.7 91 6.2 75.5"/>
|
||||
<polygon class="fg" transform="translate(-6.2,9)" points="90 5 50.5 20.5 50.5 91 90 75.5"/>
|
||||
<polygon class="fg" transform="translate(-6.2,9)" points="87 88 87 81.8 60.4 91"/>
|
||||
<polygon class="fg" transform="translate(-6.2,9)" points="9.2 88 9.2 81.8 34.9 91"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 703 B |
@@ -0,0 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: ""
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg class="icon-web-globe" width="60" height="60" enable-background="new 0 0 64 64" version="1.1" viewBox="0 0 60 60" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<path class="fg" d="m48.1 14.3c-0.4-0.5-0.9-1-1.4-1.5-4.3-4.2-10.2-6.8-16.7-6.8s-12.4 2.6-16.7 6.8c-0.5 0.5-1 1-1.4 1.5-3.7 4.2-5.9 9.7-5.9 15.7s2.2 11.5 5.8 15.7c0.4 0.5 0.9 1 1.4 1.5 4.3 4.2 10.3 6.8 16.8 6.8s12.5-2.6 16.8-6.9c0.5-0.5 0.9-0.9 1.4-1.5 3.6-4.1 5.8-9.6 5.8-15.6s-2.2-11.5-5.9-15.7zm3.9 14.7h-8.1c-0.1-3-1-7.3-2.4-10.5 1.8-0.8 3.5-1.8 5.1-3 3.1 3.6 5.1 8.5 5.4 13.5zm-21-20.1c3 2.3 5.8 5.2 7.6 8.5-2.4 0.9-4.6 1.3-7.6 1.4zm-2 9.9c-3-0.1-5.2-0.6-7.6-1.4 1.8-3.3 4.6-6.3 7.6-8.5zm0 2v8.2h-10.8c0.1-3 0.9-6.8 2.3-9.8 2.7 1 5.5 1.5 8.5 1.6zm0 10.2v8c-3 0.1-5.9 0.7-8.6 1.7-1.4-3-2.1-5.7-2.3-9.7zm0 10v10.1c-3-2.3-5.8-5.3-7.7-8.6 2.4-0.9 4.7-1.4 7.7-1.5zm2 0c3 0.1 5.3 0.6 7.7 1.5-1.9 3.4-4.7 6.3-7.7 8.6zm0-2v-8h10.8c-0.1 4-0.9 6.7-2.3 9.7-2.6-1-5.5-1.5-8.5-1.7zm0-10v-8.2c3-0.1 5.8-0.7 8.5-1.6 1.4 3 2.2 6.8 2.3 9.8zm9.5-12.3c-1.7-3.2-4.1-6-6.9-8.3 4.4 0.6 8.4 2.7 11.5 5.6-1.4 1.1-3 1.9-4.6 2.7zm-14.1-8.4c-2.9 2.3-5.2 5.2-6.9 8.3-1.6-0.7-3.2-1.6-4.6-2.6 3.1-2.9 7.1-5 11.5-5.7zm-12.9 7.2c1.6 1.2 3.3 2.2 5.1 3-1.5 3.3-2.3 7.5-2.4 10.5h-8.2c0.3-5 2.3-9.9 5.5-13.5zm-5.5 15.5h8.1c0.1 4 1 7.2 2.4 10.5-1.8 0.8-3.5 1.8-5.1 3-3.2-3.7-5.1-8.5-5.4-13.5zm11.4 12.2c1.7 3.2 4.1 6.1 7 8.4-4.5-0.7-8.5-2.8-11.6-5.8 1.5-1 3-1.8 4.6-2.6zm14.2 8.5c2.9-2.4 5.3-5.2 7-8.4 1.6 0.7 3.2 1.6 4.6 2.6-3.1 3-7.2 5-11.6 5.8zm13-7.3c-1.6-1.2-3.3-2.2-5.1-3 1.4-3.2 2.3-6.5 2.4-10.5h8.1c-0.3 5.1-2.2 9.9-5.4 13.5z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -1,11 +1,30 @@
|
||||
import Component from '@ember/component';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { computed } from '@ember/object';
|
||||
|
||||
const SIZES = {
|
||||
'small': '128', // pixels
|
||||
'medium': '256',
|
||||
'large': '512'
|
||||
}
|
||||
|
||||
export default Component.extend({
|
||||
contributor: null,
|
||||
tagName: 'img',
|
||||
classNames: ['avatar'],
|
||||
classNameBindings: ['size'],
|
||||
attributeBindings: ['src', 'title'],
|
||||
src: alias('contributor.avatarURL'),
|
||||
title: alias('contributor.name')
|
||||
size: 'small',
|
||||
|
||||
src: alias('avatarURL'),
|
||||
title: alias('contributor.name'),
|
||||
|
||||
avatarURL: computed('contributor.github_uid', 'size', function() {
|
||||
const github_uid = this.contributor.github_uid;
|
||||
|
||||
if (github_uid) {
|
||||
return `https://avatars2.githubusercontent.com/u/${github_uid}?v=3&s=${SIZES[this.size]}`;
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
@@ -5,6 +5,9 @@ import { inject as service } from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
kredits: service(),
|
||||
|
||||
showDetailsPane: false,
|
||||
|
||||
currentBlock: alias('kredits.currentBlock'),
|
||||
|
||||
contributions: alias('kredits.contributions'),
|
||||
@@ -25,6 +28,9 @@ export default Controller.extend({
|
||||
showUnconfirmedKredits: true,
|
||||
hideUnconfirmedKredits: not('showUnconfirmedKredits'),
|
||||
|
||||
showQuickFilterUnconfirmed: false,
|
||||
showQuickFilterConfirmed: false,
|
||||
|
||||
actions: {
|
||||
|
||||
vetoContribution (contributionId) {
|
||||
@@ -37,6 +43,14 @@ export default Controller.extend({
|
||||
this.kredits.vote(proposalId).then(transaction => {
|
||||
console.debug('[controllers:index] Vote submitted to Ethereum blockhain: '+transaction.hash);
|
||||
});
|
||||
},
|
||||
|
||||
toggleQuickFilterUnconfirmed () {
|
||||
this.toggleProperty('showQuickFilterUnconfirmed');
|
||||
},
|
||||
|
||||
toggleQuickFilterConfirmed () {
|
||||
this.toggleProperty('showQuickFilterConfirmed');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { computed } from '@ember/object';
|
||||
|
||||
export default Controller.extend({
|
||||
|
||||
roleName: computed('model.isCore', 'totalKreditsEarned', function() {
|
||||
if (this.model.isCore) return 'Core Contributor';
|
||||
if (this.model.totalKreditsEarned <= 5000) return 'Newcomer';
|
||||
return 'Contributor';
|
||||
})
|
||||
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import Helper from '@ember/component/helper';
|
||||
|
||||
export default Helper.extend({
|
||||
compute([string]) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,3 @@
|
||||
import { computed } from '@ember/object';
|
||||
import EmberObject from '@ember/object';
|
||||
import bignumber from 'kredits-web/utils/cps/bignumber';
|
||||
import kreditsValue from 'kredits-web/utils/cps/kredits';
|
||||
@@ -20,12 +19,6 @@ export default EmberObject.extend({
|
||||
github_username: null,
|
||||
github_uid: null,
|
||||
wiki_username: null,
|
||||
ipfsData: '',
|
||||
ipfsData: ''
|
||||
|
||||
avatarURL: computed('github_uid', function() {
|
||||
let github_uid = this.github_uid;
|
||||
if (github_uid) {
|
||||
return `https://avatars2.githubusercontent.com/u/${github_uid}?v=3&s=128`;
|
||||
}
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -7,6 +7,11 @@ const Router = EmberRouter.extend({
|
||||
});
|
||||
|
||||
Router.map(function() {
|
||||
this.route('dashboard', function() {
|
||||
this.route('contributors', function() {
|
||||
this.route('show', { path: ':id' });
|
||||
});
|
||||
});
|
||||
this.route('proposals', function() {
|
||||
this.route('new');
|
||||
});
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
import { alias } from '@ember/object/computed';
|
||||
|
||||
export default Route.extend({
|
||||
|
||||
kredits: service(),
|
||||
contributors: alias('kredits.contributors'),
|
||||
|
||||
model (params) {
|
||||
return this.contributors.findBy('id', params.id);
|
||||
},
|
||||
|
||||
activate () {
|
||||
this.controllerFor('dashboard')
|
||||
.set('showDetailsPane', true);
|
||||
},
|
||||
|
||||
deactivate () {
|
||||
this.controllerFor('dashboard')
|
||||
.set('showDetailsPane', false);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend({
|
||||
|
||||
redirect () {
|
||||
this.transitionTo('dashboard');
|
||||
}
|
||||
|
||||
});
|
||||
@@ -11,10 +11,18 @@ button, input[type=submit], .button {
|
||||
cursor: pointer;
|
||||
letter-spacing: 0.1em;
|
||||
|
||||
&+button, &+input[type=submit], &+.button {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(22, 21, 40, 0.8);
|
||||
}
|
||||
|
||||
&:active, &.active {
|
||||
border-color: $primary-color;
|
||||
}
|
||||
|
||||
&.small {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.2rem 0.8rem;
|
||||
@@ -28,6 +36,9 @@ button, input[type=submit], .button {
|
||||
&:hover {
|
||||
background-color: rgba(40, 21, 21, 0.8);
|
||||
}
|
||||
&:active, &.active {
|
||||
border-color: $red;
|
||||
}
|
||||
}
|
||||
|
||||
&.green {
|
||||
@@ -38,5 +49,8 @@ button, input[type=submit], .button {
|
||||
&:hover {
|
||||
background-color: rgba(21, 40, 21, 0.8);
|
||||
}
|
||||
&:active, &.active {
|
||||
border-color: $green;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ main {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
&#index {
|
||||
&#dashboard {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-row-gap: 2rem;
|
||||
@@ -32,12 +32,19 @@ main {
|
||||
|
||||
@media (min-width: 550px) {
|
||||
main {
|
||||
&#index {
|
||||
&#dashboard {
|
||||
grid-column-gap: 4rem;
|
||||
grid-row-gap: 2rem;
|
||||
grid-template-columns: 2fr 4fr;
|
||||
grid-template-areas:
|
||||
"stats contributions";
|
||||
|
||||
&.with-details {
|
||||
grid-column-gap: 3rem;
|
||||
grid-template-columns: 2fr 4fr 2fr;
|
||||
grid-template-areas:
|
||||
"stats contributions details";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-4
@@ -97,9 +97,12 @@ section {
|
||||
|
||||
@import "buttons";
|
||||
@import "forms";
|
||||
@import "components/topbar";
|
||||
@import "components/loading-spinner";
|
||||
@import "components/contributor-list";
|
||||
@import "components/proposal-list";
|
||||
|
||||
@import "components/contribution-list";
|
||||
@import "components/contributor-list";
|
||||
@import "components/contributor-profile";
|
||||
@import "components/external-account-link";
|
||||
@import "components/loading-spinner";
|
||||
@import "components/proposal-list";
|
||||
@import "components/topbar";
|
||||
@import "components/user-avatar";
|
||||
|
||||
@@ -6,6 +6,24 @@ main section {
|
||||
}
|
||||
}
|
||||
|
||||
.quick-filter {
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
p {
|
||||
font-size: inherit;
|
||||
padding: 0.2rem 0 0;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: inherit;
|
||||
|
||||
&+ label {
|
||||
margin-left: 3.6rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ul.contribution-list {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
@@ -39,6 +57,9 @@ ul.contribution-list {
|
||||
margin: 0;
|
||||
font-size: inherit;
|
||||
line-height: 2rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&.kredits-amount, &.voting {
|
||||
text-align: right;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
section#contributor-profile {
|
||||
text-align: center;
|
||||
|
||||
header {
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
margin: 0 auto;
|
||||
border: 3px solid rgba(255,255,255,0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin: -7.2rem 0 1.5rem;
|
||||
padding: 6rem 1.2rem 2rem;
|
||||
|
||||
border-top: 1px solid rgba(255,255,255,0.2);
|
||||
border-bottom: 1px solid rgba(255,255,255,0.2);
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
|
||||
p.role {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
ul.external-accounts {
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
|
||||
&+li {
|
||||
margin-left: 0.6rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions {
|
||||
.button {
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
.external-accounts a {
|
||||
display: inline-block;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
padding: 0.8rem;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
color: $body-text-color;
|
||||
border-radius: 2rem;
|
||||
|
||||
span.site {
|
||||
display: none;
|
||||
}
|
||||
|
||||
svg {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.fg {
|
||||
fill: $body-text-color;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover, &:active {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
|
||||
svg {
|
||||
.fg {
|
||||
fill: $primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,11 @@
|
||||
h1 {
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
section#user-account {
|
||||
|
||||
@@ -4,4 +4,18 @@ img.avatar {
|
||||
vertical-align: middle;
|
||||
margin-right: 0.2rem;
|
||||
border-radius: 1rem;
|
||||
|
||||
&.medium {
|
||||
margin: 0;
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
border-radius: 5rem;
|
||||
}
|
||||
|
||||
&.large {
|
||||
margin: 0;
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
border-radius: 128px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<header id="topbar">
|
||||
<h1>Kosmos Kredits</h1>
|
||||
<h1>{{link-to "Kosmos Kredits" "dashboard"}}</h1>
|
||||
|
||||
<section id="user-account">
|
||||
{{#if kredits.hasAccounts }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<main id="index">
|
||||
<main id="dashboard" class={{if showDetailsPane "with-details"}}>
|
||||
|
||||
<div id="stats">
|
||||
<section id="people">
|
||||
@@ -42,6 +42,7 @@
|
||||
<h2>Latest Contributions</h2>
|
||||
{{#if kredits.hasAccounts}}
|
||||
<nav>
|
||||
<button {{action "toggleQuickFilterUnconfirmed"}} class="small {{if showQuickFilterUnconfirmed "active"}}">filter</button>
|
||||
{{link-to "add" "contributions.new" title="Submit a contribution" class="button small green"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
@@ -50,20 +51,29 @@
|
||||
{{!-- TODO: We need a better naming for kredits.hasAccounts --}}
|
||||
{{contribution-list contributions=contributionsUnconfirmedSorted
|
||||
vetoContribution=(action "vetoContribution")
|
||||
contractInteractionEnabled=kredits.hasAccounts}}
|
||||
contractInteractionEnabled=kredits.hasAccounts
|
||||
showQuickFilter=showQuickFilterUnconfirmed}}
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
<section id="contributions-confirmed">
|
||||
<header>
|
||||
<header class="with-nav">
|
||||
<h2>Confirmed Contributions</h2>
|
||||
<nav>
|
||||
<button {{action "toggleQuickFilterConfirmed"}} class="small {{if showQuickFilterConfirmed "active"}}">filter</button>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{contribution-list contributions=contributionsConfirmedSorted
|
||||
vetoContribution=(action "vetoContribution")}}
|
||||
vetoContribution=(action "vetoContribution")
|
||||
showQuickFilter=showQuickFilterConfirmed}}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div id="details">
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
</main>
|
||||
@@ -0,0 +1,36 @@
|
||||
<section id="contributor-profile">
|
||||
<header>
|
||||
{{user-avatar contributor=model size="medium"}}
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
<h2>{{model.name}}</h2>
|
||||
<p class="role">{{roleName}}</p>
|
||||
|
||||
<ul class="external-accounts">
|
||||
{{#each model.accounts as |account|}}
|
||||
<li>
|
||||
{{external-account-link account=account}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{#if model.url}}
|
||||
<li>
|
||||
<a href={{model.url}} target="_blank" rel="noopener" title="Website">
|
||||
<span class="site">Web</span>
|
||||
{{icon-web-globe}}
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<p>
|
||||
<a href="https://rinkeby.etherscan.io/address/{{model.account}}" class="button small" target="_blank" rel="noopener">Inspect Ethereum transactions</a>
|
||||
{{#if model.ipfsHash}}
|
||||
<a href="https://ipfs.io/ipfs/{{model.ipfsHash}}" class="button small" target="_blank" rel="noopener">Inspect IPFS profile</a>
|
||||
{{/if}}
|
||||
{{link-to "Edit profile" "contributors.edit" model class="button small"}}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -40,7 +40,8 @@ module.exports = function(environment) {
|
||||
ipfs: {
|
||||
host: 'ipfs.kosmos.org',
|
||||
port: '5444',
|
||||
protocol: 'https'
|
||||
protocol: 'https',
|
||||
gatewayUrl: 'https://ipfs.kosmos.org/ipfs'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,7 +56,8 @@ module.exports = function(environment) {
|
||||
ENV.ipfs = {
|
||||
host: 'localhost',
|
||||
port: '5001',
|
||||
protocol: 'http'
|
||||
protocol: 'http',
|
||||
gatewayUrl: 'http://localhost:8080/ipfs'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Generated
+182
-69
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kredits-web",
|
||||
"version": "1.2.0",
|
||||
"version": "1.5.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -2682,9 +2682,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
@@ -9854,6 +9854,12 @@
|
||||
"heimdalljs": "^0.2.6"
|
||||
}
|
||||
},
|
||||
"hi-base32": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.0.tgz",
|
||||
"integrity": "sha512-DDRmxSyoYuvjUb9EnXdoiMChBZ7ZcUVJsK5Frd3kqMhuBxvmZdnBeynAVfj7/ECbn++CekcoprvC/rprHPAtow==",
|
||||
"dev": true
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
@@ -10212,19 +10218,33 @@
|
||||
"dev": true
|
||||
},
|
||||
"ipfs-block": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.8.0.tgz",
|
||||
"integrity": "sha512-znNtFRxXlJYP1/Q4u0tGFJUceH9pNww8WA+zair6T3y7d28m+vtUDJGn96M7ZlFFSkByQyQsAiq2ssNhKtMzxw==",
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.8.1.tgz",
|
||||
"integrity": "sha512-0FaCpmij+jZBoUYhjoB5ptjdl9QzvrdRIoBmUU5JiBnK2GA+4YM/ifklaB8ePRhA/rRzhd+KYBjvMFMAL4NrVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cids": "~0.5.5",
|
||||
"cids": "~0.7.0",
|
||||
"class-is": "^1.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"cids": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/cids/-/cids-0.7.1.tgz",
|
||||
"integrity": "sha512-qEM4j2GKE/BiT6WdUi6cfW8dairhSLTUE8tIdxJG6SvY33Mp/UPjw+xcO0n1zsllgo72BupzKF/44v+Bg8YPPg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"class-is": "^1.1.0",
|
||||
"multibase": "~0.6.0",
|
||||
"multicodec": "~0.5.1",
|
||||
"multihashes": "~0.4.14"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ipfs-http-client": {
|
||||
"version": "30.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-30.1.3.tgz",
|
||||
"integrity": "sha512-NQ7WTLKUZeoKaKXrTSLAtjASRYCR0bPdsolZf16Y7Gt7o3RfiPpFF+AqvP0xbekOV3/zhFj2Qyf6ShEV4CCtsQ==",
|
||||
"version": "30.1.4",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-30.1.4.tgz",
|
||||
"integrity": "sha512-ordvoPT3lAFL5qsvdYBeDGRP03gtbL6Jl+qJ9dztyhE7NJf2yhtnU3ZNqN1JMCcUK0qpGsDzX89t8dKQvI80Pw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async": "^2.6.1",
|
||||
@@ -10262,7 +10282,7 @@
|
||||
"promisify-es6": "^1.0.3",
|
||||
"pull-defer": "~0.2.3",
|
||||
"pull-stream": "^3.6.9",
|
||||
"pull-to-stream": "~0.1.0",
|
||||
"pull-to-stream": "~0.1.1",
|
||||
"pump": "^3.0.0",
|
||||
"qs": "^6.5.2",
|
||||
"readable-stream": "^3.1.1",
|
||||
@@ -10309,15 +10329,15 @@
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
@@ -10519,17 +10539,31 @@
|
||||
}
|
||||
},
|
||||
"is-ipfs": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/is-ipfs/-/is-ipfs-0.6.0.tgz",
|
||||
"integrity": "sha512-q/CO69rN+vbw9eGXGQOAa15zXq+pSyhdKvE7mqvuplDu67LyT3H9t3RyYQvKpueN7dL4f6fbyjEMPp9J3rJ4qA==",
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/is-ipfs/-/is-ipfs-0.6.1.tgz",
|
||||
"integrity": "sha512-WhqQylam6pODS2RyqT/u0PR5KWtBZNCgPjgargFOVQjzw/3+6d0midXenzU65klM4LH13IUiCC6ObhDUdXZ7Nw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bs58": "^4.0.1",
|
||||
"cids": "~0.5.6",
|
||||
"mafmt": "^v6.0.7",
|
||||
"cids": "~0.7.0",
|
||||
"mafmt": "^6.0.7",
|
||||
"multiaddr": "^6.0.4",
|
||||
"multibase": "~0.6.0",
|
||||
"multihashes": "~0.4.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"cids": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/cids/-/cids-0.7.1.tgz",
|
||||
"integrity": "sha512-qEM4j2GKE/BiT6WdUi6cfW8dairhSLTUE8tIdxJG6SvY33Mp/UPjw+xcO0n1zsllgo72BupzKF/44v+Bg8YPPg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"class-is": "^1.1.0",
|
||||
"multibase": "~0.6.0",
|
||||
"multicodec": "~0.5.1",
|
||||
"multihashes": "~0.4.14"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
@@ -10699,9 +10733,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
@@ -10962,15 +10996,79 @@
|
||||
}
|
||||
},
|
||||
"kredits-contracts": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/kredits-contracts/-/kredits-contracts-5.3.0.tgz",
|
||||
"integrity": "sha512-Wz4zuA6yo0Q4WbVEO61fvFin+6VTNjkBqHPhHCqq6dIoGdFSjUZ3BCKan1ei0axIAda7ZDP+eebe2vCr+eqcHg==",
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/kredits-contracts/-/kredits-contracts-5.4.0.tgz",
|
||||
"integrity": "sha512-Oz5c+wbuDhZ0uYKRWPxSpsNiUXdrZlJ6Vp/+IMMSjD/TmlHGwP2Pnmloyq4Xjim0JbA/bJSjyBdy62dCrqCLrw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ethers": "^4.0.27",
|
||||
"ipfs-http-client": "^30.1.1",
|
||||
"kosmos-schemas": "^2.0.0",
|
||||
"ethers": "^4.0.29",
|
||||
"ipfs-http-client": "^30.1.3",
|
||||
"kosmos-schemas": "^2.1.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"tv4": "^1.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "10.14.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.10.tgz",
|
||||
"integrity": "sha512-V8wj+w2YMNvGuhgl/MA5fmTxgjmVHVoasfIaxMMZJV6Y8Kk+Ydpi1z2whoShDCJ2BuNVoqH/h1hrygnBxkrw/Q==",
|
||||
"dev": true
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.3.3",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz",
|
||||
"integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.4.0",
|
||||
"brorand": "^1.0.1",
|
||||
"hash.js": "^1.0.0",
|
||||
"inherits": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"ethers": {
|
||||
"version": "4.0.32",
|
||||
"resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.32.tgz",
|
||||
"integrity": "sha512-r0k2tBNF6MYEsvwmINeP3VPppD/7eAZyiOk/ifDDawXGCKqr3iEQkPq6OZSDVD+4Jie38WPteS9thXzpn2+A5Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "^10.3.2",
|
||||
"aes-js": "3.0.0",
|
||||
"bn.js": "^4.4.0",
|
||||
"elliptic": "6.3.3",
|
||||
"hash.js": "1.1.3",
|
||||
"js-sha3": "0.5.7",
|
||||
"scrypt-js": "2.0.4",
|
||||
"setimmediate": "1.0.4",
|
||||
"uuid": "2.0.1",
|
||||
"xmlhttprequest": "1.8.0"
|
||||
}
|
||||
},
|
||||
"hash.js": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz",
|
||||
"integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"minimalistic-assert": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"kosmos-schemas": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/kosmos-schemas/-/kosmos-schemas-2.1.0.tgz",
|
||||
"integrity": "sha512-RT90o0ujAKoCUpcYHi5ijDxg9F9enY5aOIZXujidjkCQ/hgjJ2tyNi+x8rszutsAP/mx64yj307oWJWhNZTyTg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brfs-babel": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz",
|
||||
"integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"labeled-stream-splicer": {
|
||||
@@ -11047,9 +11145,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"asn1.js": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.0.1.tgz",
|
||||
"integrity": "sha512-aO8EaEgbgqq77IEw+1jfx5c9zTbzvkfuRBuZsSsPnTHMkmd5AI4J6OtITLZFa381jReeaQL67J0GBTUu0+ZTVw==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.2.0.tgz",
|
||||
"integrity": "sha512-Q7hnYGGNYbcmGrCPulXfkEw7oW7qjWeM4ZTALmgpuIcZLxyqqKYWxCZg2UBm8bklrnB4m2mGyJPWfoktdORD8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.0.0",
|
||||
@@ -12148,13 +12246,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"multiaddr": {
|
||||
"version": "6.0.6",
|
||||
"resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-6.0.6.tgz",
|
||||
"integrity": "sha512-nR4s91mi7IKed1jrqUj/4OhZ1VKdAjUG79IuVB5PS6b+qxOZLKPW8nsskHhrfGn4o1Rn1NJWl7znidF/NVQpEA==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-6.1.0.tgz",
|
||||
"integrity": "sha512-+XTP3OzG2m6JVcjxA9QBmGDr0Vk8WwnohC/fCC3puXb5qJqfJwLVJLEtdTc6vK7ri/hw+Nn4wyT4LkZaPnvGfQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bs58": "^4.0.1",
|
||||
"class-is": "^1.1.0",
|
||||
"hi-base32": "~0.5.0",
|
||||
"ip": "^1.1.5",
|
||||
"is-ip": "^2.0.0",
|
||||
"varint": "^5.0.0"
|
||||
@@ -12181,9 +12280,9 @@
|
||||
}
|
||||
},
|
||||
"multicodec": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.1.tgz",
|
||||
"integrity": "sha512-Q5glyZLdXVbbBxvRYHLQHpu8ydVf1422Z+v9fU47v2JCkiue7n+JcFS7uRv0cQW8hbVtgdtIDgYWPWaIKEXuXA==",
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.3.tgz",
|
||||
"integrity": "sha512-TUId9mavSh7q4ui5nUYiC0U10XVrMhsoMLPoG6nAAaFt2GKqZKK3aB2AeFk58aqEnLhmTSdRkmNrlty4jjOxzg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"varint": "^5.0.0"
|
||||
@@ -12347,6 +12446,12 @@
|
||||
"lower-case": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
|
||||
"dev": true
|
||||
},
|
||||
"node-forge": {
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz",
|
||||
@@ -16939,9 +17044,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"asn1.js": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.0.1.tgz",
|
||||
"integrity": "sha512-aO8EaEgbgqq77IEw+1jfx5c9zTbzvkfuRBuZsSsPnTHMkmd5AI4J6OtITLZFa381jReeaQL67J0GBTUu0+ZTVw==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.2.0.tgz",
|
||||
"integrity": "sha512-Q7hnYGGNYbcmGrCPulXfkEw7oW7qjWeM4ZTALmgpuIcZLxyqqKYWxCZg2UBm8bklrnB4m2mGyJPWfoktdORD8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.0.0",
|
||||
@@ -17184,9 +17289,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"pull-stream": {
|
||||
"version": "3.6.9",
|
||||
"resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.9.tgz",
|
||||
"integrity": "sha512-hJn4POeBrkttshdNl0AoSCVjMVSuBwuHocMerUdoZ2+oIUzrWHFTwJMlbHND7OiKLVgvz6TFj8ZUVywUMXccbw==",
|
||||
"version": "3.6.13",
|
||||
"resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.13.tgz",
|
||||
"integrity": "sha512-enbnbnO+czsPuCq9s9HTTzDzzVQD5TSe60aO3nBioeJ9mevh8RzE4Hxbujo9TReg1fJlmNEL8uyQTUgn8+rSHg==",
|
||||
"dev": true
|
||||
},
|
||||
"pull-to-stream": {
|
||||
@@ -17199,9 +17304,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
@@ -18084,19 +18189,27 @@
|
||||
}
|
||||
},
|
||||
"secp256k1": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.2.tgz",
|
||||
"integrity": "sha512-90nYt7yb0LmI4A2jJs1grglkTAXrBwxYAjP9bpeKjvJKOjG2fOeH/YI/lchDMIvjrOasd5QXwvV2jwN168xNng==",
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz",
|
||||
"integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bindings": "^1.2.1",
|
||||
"bip66": "^1.1.3",
|
||||
"bn.js": "^4.11.3",
|
||||
"create-hash": "^1.1.2",
|
||||
"bindings": "^1.5.0",
|
||||
"bip66": "^1.1.5",
|
||||
"bn.js": "^4.11.8",
|
||||
"create-hash": "^1.2.0",
|
||||
"drbg.js": "^1.0.1",
|
||||
"elliptic": "^6.2.3",
|
||||
"nan": "^2.2.1",
|
||||
"safe-buffer": "^5.1.0"
|
||||
"elliptic": "^6.4.1",
|
||||
"nan": "^2.14.0",
|
||||
"safe-buffer": "^5.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"nan": {
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
@@ -18684,9 +18797,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
@@ -19034,9 +19147,9 @@
|
||||
}
|
||||
},
|
||||
"tar-stream": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.0.1.tgz",
|
||||
"integrity": "sha512-I6OJF7wE62BC6zNPdHDtseK0D0187PBjbKSLYY4ffvVkBM6tyBn2O9plDvVM2229/mozfEL/X3++qSvYYQE2xw==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz",
|
||||
"integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bl": "^3.0.0",
|
||||
@@ -19047,9 +19160,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
|
||||
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kredits-web",
|
||||
"version": "1.2.0",
|
||||
"version": "1.5.0",
|
||||
"private": true,
|
||||
"description": "Contribution dashboard of the Kosmos project",
|
||||
"repository": "https://github.com/67P/kredits-web",
|
||||
@@ -59,7 +59,7 @@
|
||||
"eslint-plugin-ember": "^5.2.0",
|
||||
"ethers": "^4.0.27",
|
||||
"kosmos-schemas": "^2.0.0",
|
||||
"kredits-contracts": "^5.3.0",
|
||||
"kredits-contracts": "^5.4.0",
|
||||
"loader.js": "^4.7.0",
|
||||
"qunit-dom": "^0.8.0",
|
||||
"tv4": "^1.3.0"
|
||||
|
||||
File diff suppressed because one or more lines are too long
+101
-66
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4567
-2513
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+4
-4
@@ -8,10 +8,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
|
||||
|
||||
<meta name="kredits-web/config/environment" content="%7B%22modulePrefix%22%3A%22kredits-web%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22kredits-web%22%2C%22version%22%3A%221.2.0%2Bf5c89fd5%22%7D%2C%22browserify%22%3A%7B%22tests%22%3Atrue%2C%22transform%22%3A%5B%5B%22babelify%22%2C%7B%22presets%22%3A%5B%22es2015%22%5D%2C%22global%22%3Atrue%7D%5D%5D%7D%2C%22web3ProviderUrl%22%3A%22https%3A%2F%2Frinkeby.infura.io%2Fv3%2Fd4f788b7a6584f7db2fc3c268d4d09e9%22%2C%22ipfs%22%3A%7B%22host%22%3A%22ipfs.kosmos.org%22%2C%22port%22%3A%225444%22%2C%22protocol%22%3A%22https%22%7D%2C%22kreditsApmDomain%22%3A%22open.aragonpm.eth%22%2C%22exportApplicationGlobal%22%3Afalse%7D" />
|
||||
<meta name="kredits-web/config/environment" content="%7B%22modulePrefix%22%3A%22kredits-web%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22kredits-web%22%2C%22version%22%3A%221.5.0%2Bfe16a605%22%7D%2C%22browserify%22%3A%7B%22tests%22%3Atrue%2C%22transform%22%3A%5B%5B%22babelify%22%2C%7B%22presets%22%3A%5B%22es2015%22%5D%2C%22global%22%3Atrue%7D%5D%5D%7D%2C%22web3ProviderUrl%22%3A%22https%3A%2F%2Frinkeby.infura.io%2Fv3%2Fd4f788b7a6584f7db2fc3c268d4d09e9%22%2C%22ipfs%22%3A%7B%22host%22%3A%22ipfs.kosmos.org%22%2C%22port%22%3A%225444%22%2C%22protocol%22%3A%22https%22%2C%22gatewayUrl%22%3A%22https%3A%2F%2Fipfs.kosmos.org%2Fipfs%22%7D%2C%22kreditsApmDomain%22%3A%22open.aragonpm.eth%22%2C%22exportApplicationGlobal%22%3Afalse%7D" />
|
||||
|
||||
<link integrity="" rel="stylesheet" href="/assets/vendor-179cf27a97ea5bbb0ce72403a401cc8c.css">
|
||||
<link integrity="" rel="stylesheet" href="/assets/kredits-web-29d147f9bc6d79dbc7aff481f8ee5541.css">
|
||||
<link integrity="" rel="stylesheet" href="/assets/kredits-web-87a975d1ebfb073f8c85b3f709cd0bcd.css">
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
<body>
|
||||
|
||||
|
||||
<script src="/assets/vendor-801d0f45e82f8bef6ee0b28f728036e5.js" integrity="sha256-0rvoxLzxNRaodYFUkwv5D3zakixGtC+//xKSO9XtbKc= sha512-YNRAvmy8HT14rRH3MwaQciCOYPZwuuiDT5Bsi3aIXUWtADH2HNxR3K88BTGtNEbOXCCSewh0vpkiBt1o1eyTvg==" ></script>
|
||||
<script src="/assets/kredits-web-b12d883fdbeaf315e3cd3e3302904d30.js" integrity="sha256-VVMzBYeO6bs3raMutSy2L5hOW0sd7q8UMjd6G8gblto= sha512-yP5/L4EkuYjPSFMENaxdSB2q8EYXWJrrIEVw5X3Lsxf1+tvkg11hRnhcEDpGQLqDfIc7uSItsRXsH4oIyYJVTA==" ></script>
|
||||
<script src="/assets/vendor-80a68be62538fc452f619ea272efa683.js" integrity="sha256-1SzKk/ufxNyb/CdyXniFRUByZMpFGEz+hUTtfJVw7mw= sha512-ixkdWl+f7KrwA+YRsH92A8FSnK9ZG31nJa74FIskk2y40KHDpm6zOln2VVeApLpKdkj+FF7huYSGqJZwE7PRvA==" ></script>
|
||||
<script src="/assets/kredits-web-2de55b3ff6969b257370b5e81cc2ea84.js" integrity="sha256-1slvruOM4AQ4rAeDnRnq5GfJhdaCztEDuvxYwmlaaXc= sha512-EHAQKlPE/+z5GjJ07T3CyBkKNHy7TNW+ILAP6AeXfC91iYcaEebXJ8cGbZoeXweF4RWPTza2gkpWSlucye+tsA==" ></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
Vendored
+14
-10
@@ -1,19 +1,23 @@
|
||||
import Model from 'kredits-web/models/contribution';
|
||||
import contributors from '../../tests/fixtures/contributors';
|
||||
|
||||
const items = [];
|
||||
|
||||
const data = [
|
||||
{ id: 1, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
|
||||
{ id: 2, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 },
|
||||
{ id: 3, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
|
||||
{ id: 4, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
|
||||
{ id: 5, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 },
|
||||
{ id: 6, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: true, amount: 500 },
|
||||
{ id: 7, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 5000 },
|
||||
{ id: 8, contributorId: 1, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 1500 },
|
||||
{ id: 9, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: true, amount: 1500 },
|
||||
{ id: 1, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500, kind: 'dev' },
|
||||
{ id: 2, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000, kind: 'ops' },
|
||||
{ id: 3, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500, kind: 'ops' },
|
||||
{ id: 4, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500, kind: 'docs' },
|
||||
{ id: 5, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000, kind: 'design' },
|
||||
{ id: 6, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: true, amount: 500, kind: 'dev' },
|
||||
{ id: 7, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 5000, kind: 'dev' },
|
||||
{ id: 8, contributorId: 1, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 1500, kind: 'community' },
|
||||
{ id: 9, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: true, amount: 1500, kind: 'docs' },
|
||||
];
|
||||
|
||||
data.forEach(attrs => items.push(Model.create(attrs)));
|
||||
data.forEach(attrs => {
|
||||
attrs.contributor = contributors.findBy('id', attrs.contributorId.toString());
|
||||
items.push(Model.create(attrs))
|
||||
});
|
||||
|
||||
export default items;
|
||||
|
||||
Vendored
+3
-3
@@ -3,9 +3,9 @@ import Contributor from 'kredits-web/models/contributor';
|
||||
const contributors = [];
|
||||
|
||||
const data = [
|
||||
{ id: 1, name: 'Bumi', totalKreditsEarned: 11500 },
|
||||
{ id: 2, name: 'Râu Cao', totalKreditsEarned: 3000 },
|
||||
{ id: 3, name: 'Manuel', totalKreditsEarned: 0 }
|
||||
{ id: 1, name: 'Bumi', totalKreditsEarned: 11500, github_uid: 318 },
|
||||
{ id: 2, name: 'Râu Cao', totalKreditsEarned: 3000, github_uid: 842 },
|
||||
{ id: 3, name: 'Manuel', totalKreditsEarned: 0, github_uid: 54812 }
|
||||
];
|
||||
|
||||
data.forEach(attrs => contributors.push(Contributor.create(attrs)));
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { click, fillIn, render } from '@ember/test-helpers';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
import contributors from '../../../fixtures/contributors';
|
||||
import contributions from '../../../fixtures/contributions';
|
||||
|
||||
module('Integration | Component | contribution-list', function(hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
// Set any properties with this.set('myProperty', 'value');
|
||||
// Handle any actions with this.set('myAction', function(val) { ... });
|
||||
test('it renders all contributions', async function(assert) {
|
||||
this.set('fixtures', contributions);
|
||||
await render(hbs`{{contribution-list contributions=fixtures}}`);
|
||||
|
||||
await render(hbs`{{contribution-list}}`);
|
||||
assert.equal(this.element.querySelectorAll('li').length, 9);
|
||||
});
|
||||
|
||||
assert.equal(this.element.textContent.trim(), '');
|
||||
test('it renders filtered contributions', async function(assert) {
|
||||
let service = this.owner.lookup('service:kredits');
|
||||
service.set('contributors', contributors);
|
||||
|
||||
this.set('fixtures', contributions);
|
||||
await render(hbs`{{contribution-list contributions=fixtures showQuickFilter=true}}`);
|
||||
|
||||
await fillIn('.filter-contributor select', '1');
|
||||
assert.equal(this.element.querySelectorAll('li').length, 5, 'select contributor');
|
||||
|
||||
await click('.filter-contribution-size input');
|
||||
assert.equal(this.element.querySelectorAll('li').length, 4, 'hide small contributions');
|
||||
|
||||
await fillIn('.filter-contribution-kind select', 'dev');
|
||||
assert.equal(this.element.querySelectorAll('li').length, 1, 'select kind');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,13 +9,13 @@ module('Integration | Component | contributor list', function(hooks) {
|
||||
|
||||
const toplist = [
|
||||
{
|
||||
contributor: Contributor.create({ id: 1, name: 'Bumi' }),
|
||||
contributor: Contributor.create({ id: 1, name: 'Bumi', github_uid: 318 }),
|
||||
amountConfirmed: 5500,
|
||||
amountUnconfirmed: 1000,
|
||||
amountTotal: 6500
|
||||
},
|
||||
{
|
||||
contributor: Contributor.create({ id: 2, name: 'Râu Cao' }),
|
||||
contributor: Contributor.create({ id: 2, name: 'Râu Cao', github_uid: 842 }),
|
||||
amountConfirmed: 1500,
|
||||
amountUnconfirmed: 2000,
|
||||
amountTotal: 3500
|
||||
@@ -28,8 +28,8 @@ module('Integration | Component | contributor list', function(hooks) {
|
||||
|
||||
assert.dom('tr:nth-child(1) td.person').hasText('Bumi');
|
||||
assert.dom('tr:nth-child(1) span.amount').hasText('6500');
|
||||
assert.dom('tr:nth-child(3) td.person').hasText('Râu Cao');
|
||||
assert.dom('tr:nth-child(3) span.amount').hasText('3500');
|
||||
assert.dom('tr:nth-child(2) td.person').hasText('Râu Cao');
|
||||
assert.dom('tr:nth-child(2) span.amount').hasText('3500');
|
||||
});
|
||||
|
||||
test('it renders confirmed kredits earned', async function(assert) {
|
||||
@@ -38,7 +38,7 @@ module('Integration | Component | contributor list', function(hooks) {
|
||||
|
||||
assert.dom('tr:nth-child(1) td.person').hasText('Bumi');
|
||||
assert.dom('tr:nth-child(1) span.amount').hasText('5500');
|
||||
assert.dom('tr:nth-child(3) td.person').hasText('Râu Cao');
|
||||
assert.dom('tr:nth-child(3) span.amount').hasText('1500');
|
||||
assert.dom('tr:nth-child(2) td.person').hasText('Râu Cao');
|
||||
assert.dom('tr:nth-child(2) span.amount').hasText('1500');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,13 +2,39 @@ import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
import contributors from '../../../fixtures/contributors';
|
||||
|
||||
module('Integration | Component | user-avatar', function(hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
await render(hbs`{{user-avatar}}`);
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
await render(hbs`{{user-avatar contributor=bumi}}`);
|
||||
|
||||
assert.equal(this.element.textContent.trim(), '');
|
||||
});
|
||||
|
||||
test('default image source URL', async function(assert) {
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
await render(hbs`{{user-avatar contributor=bumi}}`);
|
||||
|
||||
assert.equal(this.element.querySelector('img').src,
|
||||
`https://avatars2.githubusercontent.com/u/318?v=3&s=128`);
|
||||
});
|
||||
|
||||
test('size-specific image source URLs', async function(assert) {
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
this.set('size', 'medium');
|
||||
|
||||
await render(hbs`{{user-avatar contributor=bumi size=size}}`);
|
||||
|
||||
assert.equal(this.element.querySelector('img').src,
|
||||
`https://avatars2.githubusercontent.com/u/318?v=3&s=256`);
|
||||
|
||||
this.set('size', 'large');
|
||||
|
||||
assert.equal(this.element.querySelector('img').src,
|
||||
`https://avatars2.githubusercontent.com/u/318?v=3&s=512`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import Contributor from 'kredits-web/models/contributor';
|
||||
|
||||
module('Unit | Model | contributor', function(hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('#avatarURL() returns correct URL', function(assert) {
|
||||
let model = Contributor.create();
|
||||
model.set('github_uid', '318');
|
||||
|
||||
assert.equal(model.get('avatarURL'), 'https://avatars2.githubusercontent.com/u/318?v=3&s=128');
|
||||
});
|
||||
});
|
||||
// import { module, test } from 'qunit';
|
||||
// import { setupTest } from 'ember-qunit';
|
||||
// import Contributor from 'kredits-web/models/contributor';
|
||||
//
|
||||
// module('Unit | Model | contributor', function(hooks) {
|
||||
// setupTest(hooks);
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user