diff options
Diffstat (limited to 'src/js/components/Base/ParticipantsList.vue')
-rw-r--r-- | src/js/components/Base/ParticipantsList.vue | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/js/components/Base/ParticipantsList.vue b/src/js/components/Base/ParticipantsList.vue index 35f8f342..e8542d17 100644 --- a/src/js/components/Base/ParticipantsList.vue +++ b/src/js/components/Base/ParticipantsList.vue @@ -33,20 +33,51 @@ v-bind="participant" :hide-names="true" type="user" /> + <Actions> + <ActionButton v-if="poll.acl.allowEdit" icon="icon-clippy" @click="getAddresses()"> + {{ t('polls', 'Copy list of email addresses to clipboard') }} + </ActionButton> + </Actions> </div> </div> </template> <script> -import { mapGetters } from 'vuex' +import { mapGetters, mapState } from 'vuex' +import { showSuccess, showError } from '@nextcloud/dialogs' +import { Actions, ActionButton } from '@nextcloud/vue' export default { name: 'ParticipantsList', + components: { + Actions, + ActionButton, + }, + computed: { + ...mapState({ + poll: state => state.poll, + }), + ...mapGetters({ participantsVoted: 'poll/participantsVoted', }), }, + + methods: { + getAddresses() { + this.$store.dispatch('poll/getParticipantsEmailAddresses', { pollId: this.poll.id }) + .then((response) => { + this.$copyText(response.data) + .then(() => { + showSuccess(t('polls', 'Link copied to clipboard')) + }) + }) + .catch(() => { + showError(t('polls', 'Error while copying link to clipboard')) + }) + }, + }, } </script> |