Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-02-26 23:26:05 +0300
committerdartcafe <github@dartcafe.de>2021-02-26 23:26:05 +0300
commit03a6eb5f5e2c7f5f38e1de01c25a9d39496371ff (patch)
tree6ebead24cec0310e4b8924430fff8437edb67f54 /src/js/views
parent2602297ebd25bbdaca595d99daaa98b980596577 (diff)
optimizations, fixes and tidy
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/views')
-rw-r--r--src/js/views/Vote.vue20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue
index 3ba2c949..4aabcb51 100644
--- a/src/js/views/Vote.vue
+++ b/src/js/views/Vote.vue
@@ -84,7 +84,7 @@
</div>
<div class="area__footer">
- <PublicEmail />
+ <PublicEmail v-if="showEmailEdit" :value="share.emailAddress" @update="submitEmailAddress" />
<Subscription v-if="acl.allowSubscribe" />
<ParticipantsList v-if="acl.allowSeeUsernames" />
</div>
@@ -97,6 +97,7 @@
<script>
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
+import { showError, showSuccess } from '@nextcloud/dialogs'
import linkifyUrls from 'linkify-urls'
import { mapState, mapGetters } from 'vuex'
import { Actions, ActionButton, AppContent, EmptyContent } from '@nextcloud/vue'
@@ -158,6 +159,10 @@ export default {
closed: 'poll/closed',
}),
+ showEmailEdit() {
+ return ['email', 'contact', 'external'].includes(this.share.type)
+ },
+
viewTextPoll() {
if (this.manualViewTextPoll) {
return this.manualViewTextPoll
@@ -247,9 +252,7 @@ export default {
showRegisterModal() {
return (this.$route.name === 'publicVote'
- && (this.share.type === 'public'
- || this.share.type === 'email'
- || this.share.type === 'contact')
+ && ['public', 'email', 'contact'].includes(this.share.type)
&& !this.closed
&& this.poll.id
)
@@ -342,6 +345,15 @@ export default {
}
},
+ async submitEmailAddress(emailAddress) {
+ try {
+ await this.$store.dispatch('share/updateEmailAddress', { emailAddress: emailAddress })
+ showSuccess(t('polls', 'Email address {emailAddress} saved.', { emailAddress: emailAddress }))
+ } catch (e) {
+ showError(t('polls', 'Error saving email address {emailAddress}', { emailAddress: emailAddress }))
+ }
+ },
+
async watchPoll() {
console.debug('polls', 'Watch for updates')