Skip to content

Commit 39c79f2

Browse files
authored
fix: save wizard as draft on each step (#4722)
1 parent de72fd5 commit 39c79f2

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

app/components/forms/wizard/sessions-speakers-step.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,23 @@ export default Component.extend(EventWizardMixin, FormMixin, {
164164
},
165165

166166
actions: {
167+
saveDraft() {
168+
this.onValid(() => {
169+
this.set('data.event.state', 'draft');
170+
this.sendAction('save');
171+
});
172+
},
167173
move(direction) {
168174
this.onValid(() => {
169175
this.sendAction('move', direction);
170176
});
171177
},
178+
publish() {
179+
this.onValid(() => {
180+
this.set('data.event.state', 'published');
181+
this.sendAction('save');
182+
});
183+
},
172184
addItem(type) {
173185
switch (type) {
174186
case 'sessionType':

app/components/forms/wizard/sponsors-step.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,8 @@ export default Component.extend(FormMixin, {
5454
},
5555
saveDraft() {
5656
this.onValid(() => {
57-
let { sponsors } = this.data;
58-
let incorrect_sponsors = sponsors.filter(function(sponsor) {
59-
return (!sponsor.get('name'));
60-
});
61-
if (incorrect_sponsors.length > 0) {
62-
this.notify.error(this.l10n.t('Please fill the required fields.'), {
63-
id: 'req_field_spon'
64-
});
65-
this.set('isLoading', false);
66-
} else {
67-
this.set('data.event.state', 'draft');
68-
this.sendAction('save');
69-
}
57+
this.set('data.event.state', 'draft');
58+
this.sendAction('save');
7059
});
7160
},
7261
move(direction) {

0 commit comments

Comments
 (0)