Fix actions, etc.
This commit is contained in:
@@ -45,7 +45,9 @@ export default Component.extend({
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
submit () {
|
submit (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
|
||||||
if (!this.isValid) {
|
if (!this.isValid) {
|
||||||
alert('Invalid data. Please review and try again.');
|
alert('Invalid data. Please review and try again.');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form {{on "submit" this.submit}}>
|
<form onsubmit={{action "submit"}}>
|
||||||
<label>
|
<label>
|
||||||
<p class="label">Contributor:</p>
|
<p class="label">Contributor:</p>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { isAddress } from 'web3-utils';
|
|||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
|
||||||
kredits: service(),
|
|
||||||
router: service(),
|
router: service(),
|
||||||
|
kredits: service(),
|
||||||
|
|
||||||
attributes: null,
|
attributes: null,
|
||||||
|
|
||||||
@@ -60,9 +60,15 @@ export default Component.extend({
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
submit () {
|
submit (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
|
||||||
|
if (!this.kredits.currentUserIsCore) {
|
||||||
|
window.alert('Only core team members can edit profiles. Please ask someone to set you up.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this.isValid) {
|
if (!this.isValid) {
|
||||||
alert('Invalid data. Please review and try again.');
|
window.alert('Invalid data. Please review and try again.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form {{on "submit" this.submit}}>
|
<form onsubmit={{action "submit"}}>
|
||||||
<p>
|
<p>
|
||||||
<label for="c-account">Ethereum account</label>
|
<label for="c-account">Ethereum account</label>
|
||||||
<Input @name="account" @id="c-account"
|
<Input @name="account" @id="c-account"
|
||||||
|
|||||||
@@ -24,12 +24,10 @@ export default Component.extend({
|
|||||||
contributors: sort('kredits.contributors', 'contributorsSorting'),
|
contributors: sort('kredits.contributors', 'contributorsSorting'),
|
||||||
|
|
||||||
contributorsActive: computed('contributors.[]', 'contributions', function() {
|
contributorsActive: computed('contributors.[]', 'contributions', function() {
|
||||||
let activeIds = this.contributions.mapBy('contributorId')
|
const activeIds = new Set(this.contributions.mapBy('contributorId')
|
||||||
.map(id => id.toString())
|
.map(id => id.toString()));
|
||||||
.uniq();
|
|
||||||
return this.contributors.filter(c => {
|
return this.contributors.filter(c => activeIds.has(c.id.toString()));
|
||||||
return activeIds.includes(c.id.toString());
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
contributionKinds: computed('contributions.[]', function() {
|
contributionKinds: computed('contributions.[]', function() {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="filter-contribution-size">
|
<label class="filter-contribution-size">
|
||||||
<Input type="checkbox" @checked={{this.hideSmallContributions}} />
|
<Input @type="checkbox" @checked={{this.hideSmallContributions}} />
|
||||||
Hide small contributions
|
Hide small contributions
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
<ul class="contribution-list">
|
<ul class="contribution-list">
|
||||||
{{#each this.contributionsFiltered as |contribution|}}
|
{{#each this.contributionsFiltered as |contribution|}}
|
||||||
<li role="button" data-contribution-id={{contribution.id}}
|
<li role="button" data-contribution-id={{contribution.id}}
|
||||||
{{on "click" (fn this.openContributionDetails contribution)}}
|
{{action "openContributionDetails" contribution}}
|
||||||
class="{{contribution-status contribution}}{{if (eq contribution.id @selectedContributionId) " selected"}}">
|
class="{{if (eq contribution.id @selectedContributionId) " selected"}}">
|
||||||
<p class="meta">
|
<p class="meta">
|
||||||
<span class="recipient"><UserAvatar @contributor={{contribution.contributor}} /></span>
|
<span class="recipient"><UserAvatar @contributor={{contribution.contributor}} /></span>
|
||||||
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
|
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
|
||||||
@@ -45,9 +45,9 @@
|
|||||||
{{#unless contribution.vetoed}}
|
{{#unless contribution.vetoed}}
|
||||||
{{#unless (is-confirmed-contribution contribution)}}
|
{{#unless (is-confirmed-contribution contribution)}}
|
||||||
<p class="voting">
|
<p class="voting">
|
||||||
<Input @type="button" @class="button small danger" @value="veto"
|
{{input type="button" class="button small danger" value="veto"
|
||||||
@click={{fn this.veto contribution.id}}
|
click=(action "veto" contribution.id)
|
||||||
@disabled={{contribution.hasPendingChanges}} />
|
disabled=contribution.hasPendingChanges}}
|
||||||
</p>
|
</p>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#each @contributorList as |c|}}
|
{{#each @contributorList as |c|}}
|
||||||
<tr role="button"
|
<tr role="button"
|
||||||
{{on "click" (fn this.openContributorDetails c.contributor)}}
|
onclick={{action "openContributorDetails" c.contributor}}
|
||||||
class="{{if (is-current-user c.contributor) "current-user"}} {{if (eq c.contributor.id @selectedContributorId) "selected"}}">
|
class="{{if (is-current-user c.contributor) "current-user"}} {{if (eq c.contributor.id @selectedContributorId) "selected"}}">
|
||||||
<td class="person">
|
<td class="person">
|
||||||
<UserAvatar @contributor={{c.contributor}} /> {{c.contributor.name}}
|
<UserAvatar @contributor={{c.contributor}} /> {{c.contributor.name}}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="anonymous">Anonymous</span>
|
<span class="anonymous">Anonymous</span>
|
||||||
<button {{on "click" this.signup}} class="small" type="button">Sign up</button>
|
<button onclick={{action "signup"}} class="small" type="button">Sign up</button>
|
||||||
{{#if this.showConnectButton}}
|
{{#if this.showConnectButton}}
|
||||||
<button {{on "click" this.connectAccount}} class="small green" type="button">Connect account</button>
|
<button onclick={{action "connectAccount"}} class="small green" type="button">Connect account</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<ul class="external-accounts">
|
<ul class="external-accounts">
|
||||||
{{#each this.model.accounts as |account|}}
|
{{#each this.model.accounts as |account|}}
|
||||||
<li>
|
<li>
|
||||||
<ExternalAccountLink @account={{this.account}} />
|
<ExternalAccountLink @account={{account}} />
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#if this.model.url}}
|
{{#if this.model.url}}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<p class="actions">
|
<p class="actions">
|
||||||
<button disabled={{this.signupButtonDisabled}}
|
<button disabled={{this.signupButtonDisabled}}
|
||||||
{{on "click" this.completeSignup}}
|
onclick={{action "completeSignup"}}
|
||||||
type="button">
|
type="button">
|
||||||
Complete my profile
|
Complete my profile
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
connecting one of the following accounts:
|
connecting one of the following accounts:
|
||||||
</p>
|
</p>
|
||||||
<p class="actions">
|
<p class="actions">
|
||||||
<button {{on "click" this.connectGithub}} class="icon" type="button">
|
<button onclick={{action "connectGithub"}} class="icon" type="button">
|
||||||
<IconAccountGithubCom />
|
<IconAccountGithubCom />
|
||||||
Connect GitHub
|
Connect GitHub
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user