Update Ember to 3.1

This commit is contained in:
2018-04-16 13:42:08 +02:00
parent e009caaf25
commit b09f19f399
156 changed files with 10149 additions and 16972 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({
isValidAddress: computed('kredits.ethProvider', 'address', function() {
// TODO: add proper address validation
return this.get('address') !== '';
return this.address !== '';
}),
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(
'isValidAddress',
'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);