Merge branch 'master' into naming-conventions

This commit is contained in:
2018-04-17 12:55:20 +02:00
committed by GitHub
159 changed files with 14593 additions and 16991 deletions
+13 -13
View File
@@ -1,7 +1,7 @@
import Component from 'ember-component';
import computed, { and } from 'ember-computed';
import injectService from 'ember-service/inject';
import isPresent from 'kredits-web/utils/cps/is-present';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { and, notEmpty } from '@ember/object/computed';
import { inject as injectService } from '@ember/service';
export default Component.extend({
@@ -26,13 +26,13 @@ export default Component.extend({
isValidAccount: computed('kredits.ethProvider', 'account', function() {
// TODO: add proper address validation
return this.get('account') !== '';
return this.account !== '';
}),
isValidName: isPresent('name'),
isValidURL: isPresent('url'),
isValidGithubUID: isPresent('github_uid'),
isValidGithubUsername: isPresent('github_username'),
isValidWikiUsername: isPresent('wiki_username'),
isValidName: notEmpty('name'),
isValidURL: notEmpty('url'),
isValidGithubUID: notEmpty('github_uid'),
isValidGithubUsername: notEmpty('github_username'),
isValidWikiUsername: notEmpty('wiki_username'),
isValid: and(
'isValidAccount',
'isValidName',
@@ -40,17 +40,17 @@ export default Component.extend({
),
reset: function() {
this.setProperties(this.get('attributes'));
this.setProperties(this.attributes);
},
actions: {
submit() {
if (!this.get('isValid')) {
if (!this.isValid) {
alert('Invalid data. Please review and try again.');
return;
}
let attributes = Object.keys(this.get('attributes'));
let attributes = Object.keys(this.attributes);
let contributor = this.getProperties(attributes);
let saved = this.save(contributor);
+10 -13
View File
@@ -1,11 +1,8 @@
import Component from 'ember-component';
import computed, { and } from 'ember-computed';
import injectService from 'ember-service/inject';
import isPresent from 'kredits-web/utils/cps/is-present';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { and, notEmpty } from '@ember/object/computed';
export default Component.extend({
kredits: injectService(),
// Default attributes used by reset
attributes: {
contributorId: null,
@@ -22,28 +19,28 @@ export default Component.extend({
contributors: [],
isValidRecipient: isPresent('contributorId'),
isValidRecipient: notEmpty('contributorId'),
isValidAmount: computed('amount', function() {
return parseInt(this.get('amount'), 10) > 0;
return parseInt(this.amount, 10) > 0;
}),
isValidDescription: isPresent('description'),
isValidUrl: isPresent('url'),
isValidDescription: notEmpty('description'),
isValidUrl: notEmpty('url'),
isValid: and('isValidRecipient',
'isValidAmount',
'isValidDescription'),
reset: function() {
this.setProperties(this.get('attributes'));
this.setProperties(this.attributes);
},
actions: {
submit() {
if (!this.get('isValid')) {
if (!this.isValid) {
alert('Invalid data. Please review and try again.');
return;
}
let attributes = Object.keys(this.get('attributes'));
let attributes = Object.keys(this.attributes);
let proposal = this.getProperties(attributes);
let saved = this.save(proposal);
+3 -3
View File
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Component from '@ember/component';
export default Ember.Component.extend({
export default Component.extend({
tagName: 'table',
classNames: 'contributor-list',
@@ -12,7 +12,7 @@ export default Ember.Component.extend({
if (contributor.get('showMetadata')) {
contributor.set('showMetadata', false);
} else {
this.get('contributors').setEach('showMetadata', false);
this.contributors.setEach('showMetadata', false);
contributor.set('showMetadata', true);
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Component from '@ember/component';
export default Ember.Component.extend({
export default Component.extend({
classNames: ['loading-spinner']
+4 -4
View File
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Component from '@ember/component';
export default Ember.Component.extend({
export default Component.extend({
tagName: 'ul',
classNames: ['proposal-list'],
@@ -8,8 +8,8 @@ export default Ember.Component.extend({
actions: {
confirm(proposalId) {
if (this.get('contractInteractionEnabled')) {
this.sendAction('confirmAction', proposalId);
if (this.contractInteractionEnabled) {
this.confirmProposal(proposalId);
} else {
window.alert('Only members can vote on proposals. Please ask someone to set you up.');
}