diff --git a/src/components/announcements_page/announcements_page.js b/src/components/announcements_page/announcements_page.js index ec03836106..3075953355 100644 --- a/src/components/announcements_page/announcements_page.js +++ b/src/components/announcements_page/announcements_page.js @@ -1,14 +1,19 @@ import { mapState } from 'vuex' import Announcement from '../announcement/announcement.vue' +import Checkbox from '../checkbox/checkbox.vue' const AnnouncementsPage = { components: { - Announcement + Announcement, + Checkbox }, data () { return { newAnnouncement: { - content: '' + content: '', + startsAt: undefined, + endsAt: undefined, + allDay: false }, posting: false, error: undefined @@ -29,6 +34,11 @@ const AnnouncementsPage = { postAnnouncement () { this.posting = true this.$store.dispatch('postAnnouncement', this.newAnnouncement) + .then(() => { + this.newAnnouncement.content = '' + this.startsAt = undefined + this.endsAt = undefined + }) .catch(error => { this.error = error.error }) diff --git a/src/components/announcements_page/announcements_page.vue b/src/components/announcements_page/announcements_page.vue index 1b3bd578bd..e81edee12b 100644 --- a/src/components/announcements_page/announcements_page.vue +++ b/src/components/announcements_page/announcements_page.vue @@ -23,6 +23,29 @@ :placeholder="$t('announcements.post_placeholder')" :disabled="posting" /> + + + + + + + + + + + +