diff --git a/src/components/NewMessage/NewMessagePollEditor.vue b/src/components/NewMessage/NewMessagePollEditor.vue index 008c912b9367..2181d4f29747 100644 --- a/src/components/NewMessage/NewMessagePollEditor.vue +++ b/src/components/NewMessage/NewMessagePollEditor.vue @@ -82,6 +82,12 @@ {{ t('spreed', 'Save as draft') }} + + + + + {{ t('spreed', 'Export draft to file') }} + {{ t('spreed', 'Create poll') }} @@ -95,12 +101,14 @@ import { computed, nextTick, reactive, ref } from 'vue' import IconArrowLeft from 'vue-material-design-icons/ArrowLeft.vue' import Close from 'vue-material-design-icons/Close.vue' +import IconFileDownload from 'vue-material-design-icons/FileDownload.vue' import IconFileEdit from 'vue-material-design-icons/FileEdit.vue' import Plus from 'vue-material-design-icons/Plus.vue' import { t } from '@nextcloud/l10n' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' +import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js' import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' @@ -160,6 +168,15 @@ const isMultipleAnswer = computed({ }) const isModerator = computed(() => (store.getters as unknown).isModerator) + +const exportPollBlob = () => { + const jsonString = JSON.stringify(pollForm, null, 2) + const blob = new Blob([jsonString], { type: 'application/json' }) + + return URL.createObjectURL(blob) +} +const exportPollFileName = `Talk Poll ${new Date().toISOString().slice(0, 10)}` + /** * Remove a previously added option * @param index option index diff --git a/src/components/PollViewer/PollViewer.vue b/src/components/PollViewer/PollViewer.vue index a9db98079e7a..179284201f91 100644 --- a/src/components/PollViewer/PollViewer.vue +++ b/src/components/PollViewer/PollViewer.vue @@ -78,6 +78,12 @@ {{ t('spreed', 'Save as draft') }} + + + + + {{ t('spreed', 'Export draft to file') }} + {{ t('spreed', 'End poll') }} @@ -86,13 +92,21 @@ - - - - - - {{ t('spreed', 'Save as draft') }} - + + + + + + + {{ t('spreed', 'Save as draft') }} + + + + + + {{ t('spreed', 'Export draft to file') }} + + @@ -102,14 +116,15 @@