diff --git a/src/components/AccountSettings.vue b/src/components/AccountSettings.vue index 850a1a183c..703ee899a0 100644 --- a/src/components/AccountSettings.vue +++ b/src/components/AccountSettings.vue @@ -139,9 +139,6 @@ export default { } }, computed: { - menu() { - return this.buildMenu() - }, displayName() { return this.account.name }, diff --git a/src/components/AppSettingsMenu.vue b/src/components/AppSettingsMenu.vue index 3873caed8e..8d47b798ec 100755 --- a/src/components/AppSettingsMenu.vue +++ b/src/components/AppSettingsMenu.vue @@ -8,7 +8,7 @@ :name="t('mail', 'Mail settings')" :show-navigation="true" :open.sync="showSettings"> - + {{ t('mail', 'Add mail account') }} + +
{{ t('mail', 'Account settings') }}
+

{{ t('mail', 'Settings for:') }}

+
  • + + {{ account.emailAddress }} + +
  • @@ -347,6 +359,9 @@ export default { displaySmimeCertificateModal: false, sortOrder: 'newest', showSettings: false, + showAccountSettings: false, + showMailSettings: true, + selectedAccount: null, mailvelopeIsAvailable: false, } }, @@ -354,6 +369,9 @@ export default { ...mapGetters([ 'isFollowUpFeatureAvailable', ]), + ...mapGetters({ + accounts: 'accounts', + }), searchPriorityBody() { return this.$store.getters.getPreference('search-priority-body', 'false') === 'true' }, @@ -402,6 +420,13 @@ export default { this.checkMailvelope() }, methods: { + closeAccountSettings() { + this.showAccountSettings = false + }, + openAccountSettings(accountId) { + this.$store.commit('showSettingsForAccount', accountId) + this.showSettings = false + }, checkMailvelope() { this.mailvelopeIsAvailable = !!window.mailvelope }, diff --git a/src/components/NavigationAccount.vue b/src/components/NavigationAccount.vue index 906050362e..a10ee64109 100644 --- a/src/components/NavigationAccount.vue +++ b/src/components/NavigationAccount.vue @@ -28,8 +28,7 @@ {{ quotaText }} + @click="showAccountSettings(true)"> @@ -81,7 +80,7 @@ - + @@ -150,7 +149,6 @@ export default { quota: undefined, editing: false, showSaving: false, - showSettings: false, createMailboxName: '', showMailboxes: false, nameInput: false, @@ -158,6 +156,9 @@ export default { } }, computed: { + showSettings() { + return this.$store.getters.showSettingsForAccount(this.account.id) + }, visible() { return this.account.isUnified !== true && this.account.visible !== false }, @@ -286,16 +287,16 @@ export default { } }, /** - * Toggles the account settings overview - */ - toggleAccountSettings() { - this.showSettings = !this.showSettings - }, - /** - * Shows the account settings + * Show the settings for the given account + * + * @param {boolean} show true to show, false to hide */ - showAccountSettings() { - this.showSettings = true + showAccountSettings(show) { + if (show) { + this.$store.commit('showSettingsForAccount', this.account.id) + } else { + this.$store.commit('showSettingsForAccount', null) + } }, }, } diff --git a/src/store/getters.js b/src/store/getters.js index d19e116ac9..f0b8351b88 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -159,4 +159,5 @@ export const getters = { isFollowUpFeatureAvailable: (state) => state.followUpFeatureAvailable, getInternalAddresses: (state) => state.internalAddress?.filter(internalAddress => internalAddress !== undefined), hasCurrentUserPrincipalAndCollections: (state) => state.hasCurrentUserPrincipalAndCollections, + showSettingsForAccount: (state) => (accountId) => state.showAccountSettings === accountId, } diff --git a/src/store/index.js b/src/store/index.js index 98ddc42ad1..55bfb36d5a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -108,6 +108,7 @@ export default new Store({ followUpFeatureAvailable: false, internalAddress: [], hasCurrentUserPrincipalAndCollections: false, + showAccountSettings: null, }, getters, mutations, diff --git a/src/store/mutations.js b/src/store/mutations.js index a5cb937757..60214361e5 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -516,4 +516,7 @@ export default { hasCurrentUserPrincipalAndCollections(state, hasCurrentUserPrincipalAndCollections) { state.hasCurrentUserPrincipalAndCollections = hasCurrentUserPrincipalAndCollections }, + showSettingsForAccount(state, accountId) { + state.showAccountSettings = accountId + }, }