From ddf98bda1c0c50c5924743a00ebe6d91161e2804 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Fri, 31 May 2024 11:25:50 +0200 Subject: [PATCH 001/178] remove vue.prototype Signed-off-by: dartcafe --- src/js/App.vue | 2 +- src/js/adminSettings.js | 5 -- .../Actions/modules/ActionChangeView.vue | 1 + .../Actions/modules/ActionDelete.vue | 1 + .../modules/ActionDeleteOrphanedVotes.vue | 2 +- .../modules/ActionOpenOptionsSidebar.vue | 1 + .../modules/ActionOpenSharesSidebar.vue | 1 + .../Actions/modules/ActionRegister.vue | 2 +- .../Actions/modules/ActionSendConfirmed.vue | 3 + .../Actions/modules/ActionSortOptions.vue | 1 + .../Actions/modules/ActionSwitchSafeTable.vue | 1 + .../Actions/modules/ActionToggleSidebar.vue | 1 + src/js/components/Calendar/CalendarPeek.vue | 2 + .../Cards/modules/CardAddProposals.vue | 5 ++ .../Cards/modules/CardAnonymousPollHint.vue | 5 ++ .../Cards/modules/CardClosedPoll.vue | 5 ++ .../Cards/modules/CardHiddenParticipants.vue | 5 ++ .../Cards/modules/CardLimitedVotes.vue | 5 ++ .../components/Cards/modules/CardLocked.vue | 1 + .../components/Cards/modules/CardRegister.vue | 1 + .../Cards/modules/CardSendConfirmations.vue | 1 + .../Cards/modules/CardUnpublishedPoll.vue | 5 ++ src/js/components/Comments/CommentAdd.vue | 2 + src/js/components/Comments/CommentItem.vue | 2 + src/js/components/Comments/Comments.vue | 1 + .../Configuration/AutoReminderInformation.vue | 5 ++ .../Configuration/ConfigAllowComment.vue | 6 +- .../Configuration/ConfigAllowMayBe.vue | 1 + .../Configuration/ConfigAnonymous.vue | 4 ++ .../Configuration/ConfigAutoReminder.vue | 4 ++ .../Configuration/ConfigClosing.vue | 2 + .../Configuration/ConfigOptionLimit.vue | 6 +- .../Configuration/ConfigProposals.vue | 2 + .../Configuration/ConfigShowResults.vue | 1 + .../components/Configuration/ConfigUseNo.vue | 1 + .../Configuration/ConfigVoteLimit.vue | 5 ++ src/js/components/Create/CreateDlg.vue | 2 + src/js/components/Export/ExportPoll.vue | 2 + .../Navigation/PollNavigationItems.vue | 5 ++ src/js/components/Options/OptionCloneDate.vue | 2 + src/js/components/Options/OptionItemOwner.vue | 5 ++ src/js/components/Options/OptionProposals.vue | 5 ++ src/js/components/Options/OptionsDate.vue | 2 + src/js/components/Options/OptionsDateAdd.vue | 2 + .../components/Options/OptionsDateShift.vue | 2 + src/js/components/Options/OptionsText.vue | 5 +- src/js/components/Options/OptionsTextAdd.vue | 1 + .../components/Options/OptionsTextAddBulk.vue | 2 + src/js/components/Poll/PollHeaderButtons.vue | 1 + src/js/components/Poll/PollInfoLine.vue | 1 + src/js/components/Poll/PollInformation.vue | 6 ++ src/js/components/Poll/PublicEmail.vue | 2 + src/js/components/PollList/PollItem.vue | 4 ++ .../components/Public/PublicRegisterModal.vue | 2 + .../AdminSettings/AdminActivities.vue | 5 ++ .../AdminSettings/AdminArchivePolls.vue | 5 ++ .../Settings/AdminSettings/AdminCombo.vue | 5 ++ .../Settings/AdminSettings/AdminEmail.vue | 2 + .../Settings/AdminSettings/AdminJobs.vue | 2 + .../Settings/AdminSettings/AdminLegal.vue | 2 + .../AdminSettings/AdminPerformance.vue | 1 + .../AdminSettings/AdminPollCreation.vue | 5 ++ .../AdminSettings/AdminPollDownload.vue | 5 ++ .../AdminSettings/AdminPollsInNavigation.vue | 5 ++ .../AdminSettings/AdminShareOpenPoll.vue | 5 ++ .../AdminSettings/AdminSharePublicCreate.vue | 5 ++ .../AdminSharePublicShowLogin.vue | 5 ++ .../AdminSettings/AdminShowMailAddresses.vue | 5 ++ .../UserSettings/CalendarSettings.vue | 2 + .../Settings/UserSettings/FeatureSettings.vue | 2 + .../UserSettings/PerformanceSettings.vue | 2 + .../Settings/UserSettings/StyleSettings.vue | 2 + .../components/Settings/UserSettingsDlg.vue | 5 ++ src/js/components/Shares/ShareItem.vue | 2 + .../components/Shares/ShareItemAllUsers.vue | 1 + src/js/components/Shares/SharePublicAdd.vue | 2 + src/js/components/Shares/SharesList.vue | 9 ++- src/js/components/Shares/SharesListLocked.vue | 13 ++++- src/js/components/Shares/SharesListUnsent.vue | 2 + .../components/SideBar/SideBarTabActivity.vue | 11 +++- .../components/SideBar/SideBarTabComments.vue | 14 ++++- .../SideBar/SideBarTabConfiguration.vue | 2 + .../components/SideBar/SideBarTabOptions.vue | 44 +++++++++++--- .../Subscription/ActionSubscription.vue | 2 + .../components/Subscription/Subscription.vue | 2 + src/js/components/User/UserItem.vue | 2 +- src/js/components/User/UserMenu.vue | 2 + src/js/components/User/UserSearch.vue | 2 + src/js/components/VoteTable/VoteColumn.vue | 4 +- src/js/components/VoteTable/VoteItem.vue | 1 + src/js/components/VoteTable/VoteTable.vue | 2 + src/js/dashboard.js | 6 -- src/js/main.js | 7 --- src/js/mixins/dateMixins.js | 3 + src/js/mixins/writePoll.js | 1 + src/js/store/modules/poll.js | 1 + src/js/store/modules/polls.js | 1 + src/js/store/modules/votes.js | 1 + src/js/userSettings.js | 5 -- src/js/views/AdminSettingsPage.vue | 57 ++++++++++++++----- src/js/views/Administration.vue | 2 + src/js/views/Combo.vue | 2 + src/js/views/Dashboard.vue | 16 +++++- src/js/views/Navigation.vue | 2 + src/js/views/NotFound.vue | 13 ++++- src/js/views/PollList.vue | 2 + src/js/views/SideBar.vue | 2 + src/js/views/SideBarCombo.vue | 2 + src/js/views/UserSettingsPage.vue | 34 ++++++++--- src/js/views/Vote.vue | 1 + 110 files changed, 421 insertions(+), 73 deletions(-) diff --git a/src/js/App.vue b/src/js/App.vue index fcd077d73..43adf7315 100644 --- a/src/js/App.vue +++ b/src/js/App.vue @@ -62,7 +62,7 @@ export default { }, useNavigation() { - return this.getCurrentUser() + return getCurrentUser() }, useSidebar() { diff --git a/src/js/adminSettings.js b/src/js/adminSettings.js index 0593e9839..1dbfb61c9 100644 --- a/src/js/adminSettings.js +++ b/src/js/adminSettings.js @@ -6,13 +6,8 @@ import Vue from 'vue' import Vuex, { Store } from 'vuex' import appSettings from './store/modules/appSettings.js' -import { translate, translatePlural } from '@nextcloud/l10n' - import AdminSettingsPage from './views/AdminSettingsPage.vue' -Vue.prototype.t = translate -Vue.prototype.n = translatePlural - Vue.config.devtools = import.meta.env.MODE !== 'production' Vue.use(Vuex) diff --git a/src/js/components/Actions/modules/ActionChangeView.vue b/src/js/components/Actions/modules/ActionChangeView.vue index d61481d9e..3f0a9e35c 100644 --- a/src/js/components/Actions/modules/ActionChangeView.vue +++ b/src/js/components/Actions/modules/ActionChangeView.vue @@ -23,6 +23,7 @@ import { NcButton } from '@nextcloud/vue' import { emit } from '@nextcloud/event-bus' import ListViewIcon from 'vue-material-design-icons/ViewListOutline.vue' // view-sequential-outline import TableViewIcon from 'vue-material-design-icons/Table.vue' // view-comfy-outline +import { t } from '@nextcloud/l10n' export default { name: 'ActionChangeView', diff --git a/src/js/components/Actions/modules/ActionDelete.vue b/src/js/components/Actions/modules/ActionDelete.vue index 54d7b0a47..57bd9b5bb 100644 --- a/src/js/components/Actions/modules/ActionDelete.vue +++ b/src/js/components/Actions/modules/ActionDelete.vue @@ -32,6 +32,7 @@ import DeleteIcon from 'vue-material-design-icons/Delete.vue' import RestoreIcon from 'vue-material-design-icons/Recycle.vue' import LockIcon from 'vue-material-design-icons/Lock.vue' import UndoIcon from 'vue-material-design-icons/ArrowULeftTop.vue' +import { t, n } from '@nextcloud/l10n' export default { name: 'ActionDelete', diff --git a/src/js/components/Actions/modules/ActionDeleteOrphanedVotes.vue b/src/js/components/Actions/modules/ActionDeleteOrphanedVotes.vue index a38aa0773..b17cad4d5 100644 --- a/src/js/components/Actions/modules/ActionDeleteOrphanedVotes.vue +++ b/src/js/components/Actions/modules/ActionDeleteOrphanedVotes.vue @@ -16,7 +16,7 @@ diff --git a/src/js/components/Cards/modules/CardAnonymousPollHint.vue b/src/js/components/Cards/modules/CardAnonymousPollHint.vue index 4ee8dc108..077695c32 100644 --- a/src/js/components/Cards/modules/CardAnonymousPollHint.vue +++ b/src/js/components/Cards/modules/CardAnonymousPollHint.vue @@ -12,6 +12,7 @@ diff --git a/src/js/components/Cards/modules/CardClosedPoll.vue b/src/js/components/Cards/modules/CardClosedPoll.vue index d1f94fa70..f14a41e59 100644 --- a/src/js/components/Cards/modules/CardClosedPoll.vue +++ b/src/js/components/Cards/modules/CardClosedPoll.vue @@ -15,6 +15,7 @@ diff --git a/src/js/components/Cards/modules/CardHiddenParticipants.vue b/src/js/components/Cards/modules/CardHiddenParticipants.vue index ebc35edb1..aca48a0aa 100644 --- a/src/js/components/Cards/modules/CardHiddenParticipants.vue +++ b/src/js/components/Cards/modules/CardHiddenParticipants.vue @@ -17,6 +17,7 @@ import { mapGetters } from 'vuex' import { CardDiv } from '../../Base/index.js' import ActionSwitchSafeTable from '../../Actions/modules/ActionSwitchSafeTable.vue' +import { t } from '@nextcloud/l10n' export default { name: 'CardHiddenParticipants', @@ -36,5 +37,9 @@ export default { countHiddenParticipants: 'poll/countHiddenParticipants', }), }, + + methods: { + t, + }, } diff --git a/src/js/components/Cards/modules/CardLimitedVotes.vue b/src/js/components/Cards/modules/CardLimitedVotes.vue index af8d03aca..18a9a2801 100644 --- a/src/js/components/Cards/modules/CardLimitedVotes.vue +++ b/src/js/components/Cards/modules/CardLimitedVotes.vue @@ -28,6 +28,7 @@ import { mapState } from 'vuex' import { CardDiv } from '../../Base/index.js' import ActionDeleteOrphanedVotes from '../../Actions/modules/ActionDeleteOrphanedVotes.vue' +import { t, n } from '@nextcloud/l10n' export default { name: 'CardLimitedVotes', @@ -61,7 +62,11 @@ export default { cardType() { return this.maxVotesPerUser && this.votesLeft < 1 ? 'error' : 'info' }, + }, + methods: { + t, + n, }, } diff --git a/src/js/components/Cards/modules/CardLocked.vue b/src/js/components/Cards/modules/CardLocked.vue index 96871cdbc..c0ba764e7 100644 --- a/src/js/components/Cards/modules/CardLocked.vue +++ b/src/js/components/Cards/modules/CardLocked.vue @@ -11,6 +11,7 @@ diff --git a/src/js/components/Comments/CommentAdd.vue b/src/js/components/Comments/CommentAdd.vue index e565ee081..e9f23877c 100644 --- a/src/js/components/Comments/CommentAdd.vue +++ b/src/js/components/Comments/CommentAdd.vue @@ -19,6 +19,7 @@ import { mapState } from 'vuex' import { showError } from '@nextcloud/dialogs' import { InputDiv } from '../Base/index.js' +import { t } from '@nextcloud/l10n' export default { name: 'CommentAdd', @@ -41,6 +42,7 @@ export default { }, methods: { + t, async writeComment() { if (this.comment) { try { diff --git a/src/js/components/Comments/CommentItem.vue b/src/js/components/Comments/CommentItem.vue index 4241651e3..018d93543 100644 --- a/src/js/components/Comments/CommentItem.vue +++ b/src/js/components/Comments/CommentItem.vue @@ -33,6 +33,7 @@ import linkifyStr from 'linkify-string' import { showError } from '@nextcloud/dialogs' import { mapState } from 'vuex' import { ActionDelete } from '../Actions/index.js' +import { t } from '@nextcloud/l10n' export default { name: 'CommentItem', @@ -62,6 +63,7 @@ export default { }, methods: { + t, linkify(subComment) { return linkifyStr(subComment) }, diff --git a/src/js/components/Comments/Comments.vue b/src/js/components/Comments/Comments.vue index 16013c954..1dc10d2df 100644 --- a/src/js/components/Comments/Comments.vue +++ b/src/js/components/Comments/Comments.vue @@ -19,6 +19,7 @@ import CommentItem from './CommentItem.vue' import { mapGetters, mapState } from 'vuex' +import { t } from '@nextcloud/l10n' export default { name: 'Comments', diff --git a/src/js/components/Configuration/AutoReminderInformation.vue b/src/js/components/Configuration/AutoReminderInformation.vue index e232d2504..03c2bae18 100644 --- a/src/js/components/Configuration/AutoReminderInformation.vue +++ b/src/js/components/Configuration/AutoReminderInformation.vue @@ -27,9 +27,14 @@ +../stores/polls.ts \ No newline at end of file From 8dab1ce1c39ff55e290beb03878fd81a02f22d1d Mon Sep 17 00:00:00 2001 From: dartcafe Date: Sat, 8 Jun 2024 14:58:45 +0200 Subject: [PATCH 014/178] fixes and maintanance Signed-off-by: dartcafe --- src/App.vue | 74 +++++++++++++++++++++++++++++++++----- src/main.js | 4 +++ src/stores/acl.ts | 13 ++++--- src/stores/activity.ts | 6 ++-- src/stores/appSettings.ts | 4 +-- src/stores/combo.ts | 6 ++-- src/stores/comments.ts | 32 +++++++++-------- src/stores/options.ts | 46 ++++++++++++++---------- src/stores/poll.ts | 51 ++++++++++++++++++-------- src/stores/preferences.ts | 10 ++---- src/stores/router.ts | 32 +++++++++++++++++ src/stores/share.ts | 28 +++++++++------ src/stores/shares.ts | 11 +++--- src/stores/subscription.ts | 21 ++++++----- src/stores/votes.ts | 55 ++++++++++++++++------------ 15 files changed, 269 insertions(+), 124 deletions(-) create mode 100644 src/stores/router.ts diff --git a/src/App.vue b/src/App.vue index 43adf7315..25c9ae9f2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,7 +14,6 @@ diff --git a/src/components/Actions/modules/ActionSwitchSafeTable.vue b/src/components/Actions/modules/ActionSwitchSafeTable.vue index e0862087d..f9c69dff5 100644 --- a/src/components/Actions/modules/ActionSwitchSafeTable.vue +++ b/src/components/Actions/modules/ActionSwitchSafeTable.vue @@ -14,9 +14,10 @@ diff --git a/src/components/Base/modules/InputDiv.vue b/src/components/Base/modules/InputDiv.vue index 610538562..da24f910c 100644 --- a/src/components/Base/modules/InputDiv.vue +++ b/src/components/Base/modules/InputDiv.vue @@ -16,14 +16,14 @@ :inputmode="inputmode" :placeholder="placeholder" :class="[{ 'has-modifier': useNumModifiers, 'has-submit': submit }, computedSignalingClass]" - @input="$emit('input', $event.target.value)" - @change="$emit('change', $event.target.value)" - @keyup.enter="$emit('submit', $event.target.value)"> + @input="emitValidated('input', $event.target.value)" + @change="emitValidated('change', $event.target.value)" + @keyup.enter="emitValidated('submit'), $event.target.value"> - - - + + + @@ -41,6 +41,7 @@ import ArrowRightIcon from 'vue-material-design-icons/ArrowRight.vue' import CheckIcon from 'vue-material-design-icons/Check.vue' import AlertIcon from 'vue-material-design-icons/AlertCircleOutline.vue' import { Spinner } from '../../AppIcons/index.js' +import { Logger } from '../../../helpers/index.js' export default { name: 'InputDiv', @@ -92,14 +93,18 @@ export default { type: Number, default: 1, }, - modifierMax: { + numMax: { type: Number, default: null, }, - modifierMin: { + numMin: { type: Number, default: null, }, + numWrap: { + type: Boolean, + default: false, + }, focus: { type: Boolean, default: false, @@ -143,6 +148,7 @@ export default { if (this.focus) { this.setFocus() } + this.assertBoundaries() }, methods: { @@ -152,28 +158,74 @@ export default { }) }, + assertBoundaries() { + if (this.numMin && this.numMax && this.numMin >= this.numMax) { + Logger.warning('numMin is greater or equal than numMax. Validation will be skipped.') + return false + } + return true + }, + add() { - let newValue = this.value - if (this.modifierMax && (newValue + this.modifierStepValue) > this.modifierMax) { - if (this.modifierMin) { - newValue = this.modifierMin - } - } else { - newValue += this.modifierStepValue + const value = this.numWrapper(this.value + this.modifierStepValue) + if (value !== this.value) { + this.emitValidated('change', value) } - this.$emit('input', newValue) }, subtract() { - let newValue = this.value - if (this.modifierMin && (newValue - this.modifierStepValue) < this.modifierMin) { - if (this.modifierMax) { - newValue = this.modifierMax + const value = this.numWrapper(this.value - this.modifierStepValue) + if (value !== this.value) { + this.emitValidated('change', value) + } + }, + + numWrapper(value) { + if (!this.assertBoundaries() || (this.numMax === null && this.numMin === null)) { + this.$emit('input', value) + return value + } + + if (this.numMax && value > this.numMax) { + if (this.numWrap) { + value = this.numMin ?? 0 + } else { + value = this.numMax + } + } + + if (this.numMin && value < this.numMin) { + if (this.numWrap) { + value = this.numMax ?? value + } else { + value = this.numMin } - } else { - newValue -= this.modifierStepValue } - this.$emit('input', newValue) + + this.$emit('input', value) + return value + }, + + numCheckBoundaries(value) { + if (this.type === 'number' && (this.numMin !== null || this.numMax !== null)) { + if (this.numMax && value > this.numMax) { + value = this.numMax + } + + if (this.numMin && value < this.numMin) { + value = this.numMin + } + } + + return value + }, + + emitValidated(eventName = 'input', value) { + if (eventName === 'change') { + value = this.numCheckBoundaries(value) + } + + this.$emit(eventName, value) }, }, } diff --git a/src/components/Calendar/CalendarPeek.vue b/src/components/Calendar/CalendarPeek.vue index 5d332a3e2..4ad4f3879 100644 --- a/src/components/Calendar/CalendarPeek.vue +++ b/src/components/Calendar/CalendarPeek.vue @@ -24,7 +24,7 @@ diff --git a/src/components/Combo/VoteItem.vue b/src/components/Combo/VoteItem.vue index ee4096650..22d07221f 100644 --- a/src/components/Combo/VoteItem.vue +++ b/src/components/Combo/VoteItem.vue @@ -10,8 +10,9 @@ diff --git a/src/components/Configuration/ConfigAnonymous.vue b/src/components/Configuration/ConfigAnonymous.vue index a2485aa55..16475a2d8 100644 --- a/src/components/Configuration/ConfigAnonymous.vue +++ b/src/components/Configuration/ConfigAnonymous.vue @@ -4,15 +4,18 @@ --> diff --git a/src/components/Configuration/ConfigOptionLimit.vue b/src/components/Configuration/ConfigOptionLimit.vue index b60dba9f6..7954d148b 100644 --- a/src/components/Configuration/ConfigOptionLimit.vue +++ b/src/components/Configuration/ConfigOptionLimit.vue @@ -5,31 +5,37 @@ diff --git a/src/components/Configuration/ConfigProposals.vue b/src/components/Configuration/ConfigProposals.vue index 3c173b5bf..f3bb20892 100644 --- a/src/components/Configuration/ConfigProposals.vue +++ b/src/components/Configuration/ConfigProposals.vue @@ -9,20 +9,20 @@ {{ t('polls', 'Allow Proposals') }} - + {{ t('polls', 'Proposal closing date') }} - + diff --git a/src/components/Configuration/ConfigShowResults.vue b/src/components/Configuration/ConfigShowResults.vue index 12fedf046..617f67b1c 100644 --- a/src/components/Configuration/ConfigShowResults.vue +++ b/src/components/Configuration/ConfigShowResults.vue @@ -5,14 +5,16 @@ diff --git a/src/components/Configuration/ConfigTitle.vue b/src/components/Configuration/ConfigTitle.vue index 2b7576a03..ef8f48e40 100644 --- a/src/components/Configuration/ConfigTitle.vue +++ b/src/components/Configuration/ConfigTitle.vue @@ -7,12 +7,13 @@ + @change="pollStore.write()" /> diff --git a/src/components/Create/CreateDlg.vue b/src/components/Create/CreateDlg.vue index dec66dd0a..0ffd73ee0 100644 --- a/src/components/Create/CreateDlg.vue +++ b/src/components/Create/CreateDlg.vue @@ -41,13 +41,14 @@ diff --git a/src/components/Settings/AdminSettings/AdminLegal.vue b/src/components/Settings/AdminSettings/AdminLegal.vue index 6ee6d5ae6..2bc793e49 100644 --- a/src/components/Settings/AdminSettings/AdminLegal.vue +++ b/src/components/Settings/AdminSettings/AdminLegal.vue @@ -9,26 +9,26 @@ {{ t('polls', 'If you use different legal terms and privacy policy for public polls, enter the links below. Leave empty to use your default terms.') }}

- + @change="appSettingsStore.write()" /> - + @change="appSettingsStore.write()" /> diff --git a/src/components/Settings/AdminSettings/AdminPerformance.vue b/src/components/Settings/AdminSettings/AdminPerformance.vue index c551e0368..ea2d4d357 100644 --- a/src/components/Settings/AdminSettings/AdminPerformance.vue +++ b/src/components/Settings/AdminSettings/AdminPerformance.vue @@ -5,14 +5,15 @@ diff --git a/src/components/Settings/AdminSettings/AdminPollCreation.vue b/src/components/Settings/AdminSettings/AdminPollCreation.vue index 68a6f95f8..498d53a7a 100644 --- a/src/components/Settings/AdminSettings/AdminPollCreation.vue +++ b/src/components/Settings/AdminSettings/AdminPollCreation.vue @@ -5,11 +5,13 @@ diff --git a/src/components/Settings/UserSettings/StyleSettings.vue b/src/components/Settings/UserSettings/StyleSettings.vue index 029045d5b..744a27dfe 100644 --- a/src/components/Settings/UserSettings/StyleSettings.vue +++ b/src/components/Settings/UserSettings/StyleSettings.vue @@ -7,12 +7,16 @@
{{ t('polls', 'The style settings are still experimental!') }} @@ -21,9 +25,10 @@ diff --git a/src/components/Settings/UserSettingsDlg.vue b/src/components/Settings/UserSettingsDlg.vue index 7a944d377..0c4f6a8bd 100644 --- a/src/components/Settings/UserSettingsDlg.vue +++ b/src/components/Settings/UserSettingsDlg.vue @@ -29,6 +29,8 @@ import { NcAppSettingsDialog, NcAppSettingsSection } from '@nextcloud/vue' import { subscribe, unsubscribe } from '@nextcloud/event-bus' import { CalendarSettings, FeatureSettings, StyleSettings, PerformanceSettings } from './UserSettings/index.js' import { t } from '@nextcloud/l10n' +import { mapStores } from 'pinia' +import { usePreferencesStore } from '../../stores/preferences.ts' export default { name: 'UserSettingsDlg', @@ -48,11 +50,14 @@ export default { } }, + computed: { + ...mapStores(usePreferencesStore), + }, watch: { async show() { if (this.show === true) { - this.$store.dispatch('settings/get') - this.$store.dispatch('settings/getCalendars') + this.preferencesStore.get() + this.preferencesStore.getCalendars() } }, }, diff --git a/src/components/Shares/ShareItem.vue b/src/components/Shares/ShareItem.vue index 3ee97e9bb..a03a52c8f 100644 --- a/src/components/Shares/ShareItem.vue +++ b/src/components/Shares/ShareItem.vue @@ -52,7 +52,7 @@ + @click="sharesStore.switchAdmin({ share: share })"> diff --git a/src/components/Shares/SharePublicAdd.vue b/src/components/Shares/SharePublicAdd.vue index 9325747a9..58fe72f74 100644 --- a/src/components/Shares/SharePublicAdd.vue +++ b/src/components/Shares/SharePublicAdd.vue @@ -23,12 +23,13 @@ diff --git a/src/components/Shares/SharesListUnsent.vue b/src/components/Shares/SharesListUnsent.vue index 9115b3e59..c6fc2696d 100644 --- a/src/components/Shares/SharesListUnsent.vue +++ b/src/components/Shares/SharesListUnsent.vue @@ -4,7 +4,7 @@ --> diff --git a/src/components/SideBar/SideBarTabOptions.vue b/src/components/SideBar/SideBarTabOptions.vue index 5ad73ba12..49c646875 100644 --- a/src/components/SideBar/SideBarTabOptions.vue +++ b/src/components/SideBar/SideBarTabOptions.vue @@ -5,7 +5,7 @@ - - - {{ t('polls', 'Edit Email Address') }} - - - - {{ t('polls', 'Change name') }} - + + - {{ t('polls', 'Subscribe to notifications') }} - - @@ -74,7 +50,7 @@ - @@ -83,8 +59,8 @@ diff --git a/src/views/Administration.vue b/src/views/Administration.vue index 41d7c23cf..aafe5f3b3 100644 --- a/src/views/Administration.vue +++ b/src/views/Administration.vue @@ -9,7 +9,7 @@ - {{ t('polls', 'Manage polls of other accounts. You can take over the ownership or delete polls.') }} + {{ t('polls', 'Manage polls of other accounts. You can take over the ownership or delete pollsStore.') }}
@@ -18,7 +18,7 @@ :header="true" :sort="sort" :reverse="reverse" - @sort-list="setSort($event)" /> + @sort-list="pollsAdminStore.setSort($event)" /> diff --git a/src/views/Combo.vue b/src/views/Combo.vue index 3621904b3..d0208877c 100644 --- a/src/views/Combo.vue +++ b/src/views/Combo.vue @@ -18,9 +18,9 @@
- + - diff --git a/src/views/Vote.vue b/src/views/Vote.vue index 6740947ac..468174292 100644 --- a/src/views/Vote.vue +++ b/src/views/Vote.vue @@ -4,10 +4,10 @@ --> - +
@@ -33,6 +33,8 @@ import UserMenu from '../User/UserMenu.vue' import ExportPoll from '../Export/ExportPoll.vue' import { t } from '@nextcloud/l10n' import { usePollStore } from '../../stores/poll.ts' +import { useSessionStore } from '../../stores/session.ts' + export default { name: 'PollHeaderButtons', @@ -53,7 +55,7 @@ export default { }, computed: { - ...mapStores(usePollStore), + ...mapStores(usePollStore, useSessionStore), showUserMenu() { return this.$route.name !== 'publicVote' || this.pollStore.permissions.vote || this.pollStore.permissions.subscribe diff --git a/src/components/Poll/PollInformation.vue b/src/components/Poll/PollInformation.vue index 10eec67ee..6309b254c 100644 --- a/src/components/Poll/PollInformation.vue +++ b/src/components/Poll/PollInformation.vue @@ -229,7 +229,7 @@ export default { return this.votesStore.countAllVotesByAnswer('maybe') }, countUsedVotes() { - return this.pollStore.configuration.maxVotesPerUser - this.currentUserStatus.yesVotes + return this.pollStore.configuration.maxVotesPerUser - this.pollStore.currentUserStatus.yesVotes }, }, diff --git a/src/components/Public/PublicRegisterModal.vue b/src/components/Public/PublicRegisterModal.vue index f0521bf50..5c5551b9b 100644 --- a/src/components/Public/PublicRegisterModal.vue +++ b/src/components/Public/PublicRegisterModal.vue @@ -30,15 +30,15 @@ {{ t('polls', 'Remember me for 30 days') }} -
+
-