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:
authorRené Gieling <github@dartcafe.de>2021-09-12 01:45:03 +0300
committerGitHub <noreply@github.com>2021-09-12 01:45:03 +0300
commitc84430559f77928ecdd0b50699f6da11514439d3 (patch)
tree43a56bac23f15ac23ba1192137746231a011d743 /src/js/components/SideBar
parent623e711cc5c09dfaf4d40eee180b8e6fdb5273f3 (diff)
configure mail address for public polls (#1948)
configure mail address in public polls
Diffstat (limited to 'src/js/components/SideBar')
-rw-r--r--src/js/components/SideBar/SideBarTabConfiguration.vue27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/js/components/SideBar/SideBarTabConfiguration.vue b/src/js/components/SideBar/SideBarTabConfiguration.vue
index d5934f45..14bb5f2b 100644
--- a/src/js/components/SideBar/SideBarTabConfiguration.vue
+++ b/src/js/components/SideBar/SideBarTabConfiguration.vue
@@ -72,9 +72,8 @@
</template>
<script>
-import debounce from 'lodash/debounce'
import { mapGetters, mapState } from 'vuex'
-import { showSuccess, showError } from '@nextcloud/dialogs'
+import { showError } from '@nextcloud/dialogs'
import moment from '@nextcloud/moment'
import ConfigBox from '../Base/ConfigBox'
import ConfigAccess from '../Configuration/ConfigAccess'
@@ -89,6 +88,7 @@ import ConfigShowResults from '../Configuration/ConfigShowResults'
import ConfigTitle from '../Configuration/ConfigTitle'
import ConfigUseNo from '../Configuration/ConfigUseNo'
import ConfigVoteLimit from '../Configuration/ConfigVoteLimit'
+import { writePoll } from '../../mixins/writePoll'
export default {
name: 'SideBarTabConfiguration',
@@ -109,6 +109,8 @@ export default {
ConfigVoteLimit,
},
+ mixins: [writePoll],
+
computed: {
...mapState({
poll: (state) => state.poll,
@@ -122,18 +124,13 @@ export default {
},
methods: {
-
- successDebounced: debounce(function(title) {
- showSuccess(t('polls', '"{pollTitle}" successfully saved', { pollTitle: this.poll.title }))
- }, 1500),
-
toggleArchive() {
if (this.poll.deleted) {
this.$store.commit('poll/setProperty', { deleted: 0 })
} else {
this.$store.commit('poll/setProperty', { deleted: moment.utc().unix() })
}
- this.writePoll()
+ this.writePoll() // from mixin
},
async deletePoll() {
@@ -145,20 +142,6 @@ export default {
showError(t('polls', 'Error deleting poll.'))
}
},
-
- async writePoll() {
- if (this.poll.title) {
- try {
- await this.$store.dispatch('poll/update')
- this.successDebounced(this.poll.title)
- } catch {
- showError(t('polls', 'Error writing poll'))
- }
- } else {
- showError(t('polls', 'Title must not be empty!'))
- }
- },
-
},
}
</script>