fix: SMTP shouldn't be configurable without IMAP enabled (#4428)

* fix: Configure SMTP only if IMAP is enabled
This commit is contained in:
Aswin Dev P.S 2022-04-11 12:35:03 +05:30 committed by GitHub
parent b1efcde495
commit f1ae09d21b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 3 deletions

View file

@ -7,6 +7,10 @@
<p class="sub-head">
{{ subTitle }}
</p>
<p v-if="note">
<span class="note">{{ $t('INBOX_MGMT.NOTE') }}</span>
{{ note }}
</p>
</div>
<div class="medium-6 small-12">
<slot></slot>
@ -25,6 +29,10 @@ export default {
type: String,
required: true,
},
note: {
type: String,
default: '',
},
},
};
</script>
@ -46,5 +54,9 @@ export default {
.title--section {
padding-right: var(--space-large);
}
.note {
font-weight: var(--font-weight-bold);
}
}
</style>

View file

@ -470,6 +470,7 @@
"IMAP": {
"TITLE": "IMAP",
"SUBTITLE": "Set your IMAP details",
"NOTE_TEXT": "To enable SMTP, please configure IMAP.",
"UPDATE": "Update IMAP settings",
"TOGGLE_AVAILABILITY": "Enable IMAP configuration for this inbox",
"TOGGLE_HELP": "Enabling IMAP will help the user to recieve email",
@ -529,6 +530,7 @@
"SSL_TLS": "SSL/TLS",
"START_TLS": "STARTTLS",
"OPEN_SSL_VERIFY_MODE": "Open SSL Verify Mode"
}
},
"NOTE": "Note: "
}
}

View file

@ -3,6 +3,7 @@
<settings-section
:title="$t('INBOX_MGMT.IMAP.TITLE')"
:sub-title="$t('INBOX_MGMT.IMAP.SUBTITLE')"
:note="$t('INBOX_MGMT.IMAP.NOTE_TEXT')"
>
<form @submit.prevent="updateInbox">
<label for="toggle-imap-enable">
@ -132,7 +133,7 @@ export default {
async updateInbox() {
try {
this.loading = true;
const payload = {
let payload = {
id: this.inbox.id,
formData: false,
channel: {
@ -147,6 +148,11 @@ export default {
: undefined,
},
};
if (!this.isIMAPEnabled) {
payload.channel.smtp_enabled = false;
}
await this.$store.dispatch('inboxes/updateInboxIMAP', payload);
this.showAlert(this.$t('INBOX_MGMT.IMAP.EDIT.SUCCESS_MESSAGE'));
} catch (error) {

View file

@ -422,7 +422,7 @@
</settings-section>
</div>
<imap-settings :inbox="inbox" />
<smtp-settings :inbox="inbox" />
<smtp-settings v-if="inbox.imap_enabled" :inbox="inbox" />
</div>
</div>
<div v-if="selectedTabKey === 'preChatForm'">