Move contributor-creation form for separate view

closes #74
This commit is contained in:
2019-05-23 14:17:33 +02:00
parent 4efd6f8f88
commit 16ee3b6b6b
7 changed files with 53 additions and 31 deletions
+5 -5
View File
@@ -3,6 +3,7 @@ import { and, notEmpty } from '@ember/object/computed';
import { inject as service } from '@ember/service';
export default Component.extend({
kredits: service(),
attributes: null,
@@ -36,10 +37,7 @@ export default Component.extend({
gitea_username: null,
wiki_username: null
});
},
didInsertElement() {
this._super(...arguments);
this.reset();
},
@@ -48,7 +46,8 @@ export default Component.extend({
},
actions: {
submit() {
submit () {
if (!this.isValid) {
alert('Invalid data. Please review and try again.');
return;
@@ -63,12 +62,13 @@ export default Component.extend({
this.reset();
window.scroll(0,0);
}).catch(err => {
console.log(err);
console.warn(err);
window.alert('Something went wrong. Please check the browser console.');
}).finally(() => {
this.set('inProgress', false);
});
}
}
});