Skip to content

Commit

Permalink
Add explicit warning on empty password to SMTP test UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Jul 30, 2022
1 parent b497f52 commit 57dbb9e
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 7 deletions.
24 changes: 18 additions & 6 deletions frontend/src/views/settings/smtp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<b-input v-model="item.password"
:disabled="item.auth_protocol === 'none'"
name="password" type="password"
:custom-class="`password-${n}`"
:placeholder="$t('settings.mailserver.passwordHelp')"
:maxlength="200" />
</b-field>
Expand Down Expand Up @@ -160,7 +161,7 @@
</div>
<hr />

<form @submit.prevent="() => doSMTPTest(item)">
<form @submit.prevent="() => doSMTPTest(item, n)">
<div class="columns">
<template v-if="smtpTestItem === n">
<div class="column is-5">
Expand All @@ -178,7 +179,7 @@
</template>
<div class="column has-text-right">
<b-button v-if="smtpTestItem === n" class="is-primary"
:disabled="isTestEnabled(item)" @click.prevent="() => doSMTPTest(item)">
@click.prevent="() => doSMTPTest(item, n)">
{{ $t('settings.smtp.sendTest') }}
</b-button>
<a href="#" v-else class="is-primary" @click.prevent="showTestForm(n)">
Expand Down Expand Up @@ -296,7 +297,18 @@ export default Vue.extend({
}
},
doSMTPTest(item) {
doSMTPTest(item, n) {
if (!this.isTestEnabled(item)) {
this.$utils.toast(this.$t('settings.smtp.testEnterEmail'), 'is-danger');
this.$nextTick(() => {
const i = document.querySelector(`.password-${n}`);
i.focus();
i.select();
});
return;
}
this.errMsg = '';
this.$api.testSMTP({ ...item, email: this.testEmail }).then(() => {
this.$utils.toast(this.$t('campaigns.testSent'));
Expand All @@ -319,13 +331,13 @@ export default Vue.extend({
isTestEnabled(item) {
if (!item.host || !item.port) {
return true;
return false;
}
if (item.auth_protocol !== 'none' && !item.password.trim()) {
return true;
return false;
}
return false;
return true;
},
fillSettings(n, key) {
Expand Down
2 changes: 2 additions & 0 deletions i18n/cs-cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Naplánovaná",
"campaigns.statusChanged": "\"{name}\" je {status}",
"campaigns.subject": "Předmět",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-maily",
"campaigns.testSent": "Testovací zpráva odeslána",
"campaigns.timestamps": "Časová razítka",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Odeslat e-mail",
"settings.smtp.setCustomHeaders": "Nastavit vlastní záhlaví",
"settings.smtp.testConnection": "Ověřit spojení",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "Na e-mail",
"settings.title": "Nastavení",
"settings.updateAvailable": "Nová aktualizace {version} je k dispozici.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Geplant",
"campaigns.statusChanged": "\"{name}\" ist {status}",
"campaigns.subject": "Betreff",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-Mails",
"campaigns.testSent": "Testnachricht gesendet",
"campaigns.timestamps": "Zeitstempel",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "E-mail senden",
"settings.smtp.setCustomHeaders": "Benutzerdefinierten Header verwenden",
"settings.smtp.testConnection": "Verbindung testen",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "Empfänger E-mail",
"settings.title": "Einstellungen",
"settings.updateAvailable": "Ein neues Update auf {version} ist verfügbar.",
Expand Down
1 change: 1 addition & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Set custom headers",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Settings",
"settings.updateAvailable": "A new update {version} is available.",
Expand Down
4 changes: 3 additions & 1 deletion i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Agendada",
"campaigns.statusChanged": "\"{name}\" está {status}",
"campaigns.subject": "Asunto",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "Correos electrónicos de prueba",
"campaigns.testSent": "Mensaje de prueba enviado",
"campaigns.timestamps": "Marcas de timepo",
Expand Down Expand Up @@ -108,8 +109,8 @@
"email.unsub": "Des-subscribir",
"email.unsubHelp": "¿No quiere recibir estos correos electrónicos?",
"email.viewInBrowser": "Ver en el navegador",
"forms.formHTMLHelp": "Use este código HTML para mostrar el formulario de subscripción en un sitio web. El formulario debe contener el campo `email` y uno o más campos `l` (UUID de lista). El campo `name` es opcional.",
"forms.formHTML": "Formulario HTML",
"forms.formHTMLHelp": "Use este código HTML para mostrar el formulario de subscripción en un sitio web. El formulario debe contener el campo `email` y uno o más campos `l` (UUID de lista). El campo `name` es opcional.",
"forms.noPublicLists": "No hay listas públicas para generar formularios",
"forms.publicLists": "Listas públicas",
"forms.publicSubPage": "Página pública de subscripción",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Enviar correo electrónico de prueba",
"settings.smtp.setCustomHeaders": "Configurar encabezados personalizados.",
"settings.smtp.testConnection": "Probar conexión",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "Correo electrónico del destinatario",
"settings.title": "Configuraciones",
"settings.updateAvailable": "Una actualización {version} está disponible.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Scheduled",
"campaigns.statusChanged": "\"{name}\" is {status}",
"campaigns.subject": "Subject",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Test message sent",
"campaigns.timestamps": "Timestamps",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Lähetä e-mail",
"settings.smtp.setCustomHeaders": "Set custom headers",
"settings.smtp.testConnection": "Testaa yhteyttä",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "Vastaanottajan e-mail",
"settings.title": "Settings",
"settings.updateAvailable": "A new update {version} is available.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "planifiée",
"campaigns.statusChanged": "La campagne « {name} » est {status}",
"campaigns.subject": "Objet",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails de test",
"campaigns.testSent": "Message de test envoyé",
"campaigns.timestamps": "Horodatages",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Envoyer un e-mail",
"settings.smtp.setCustomHeaders": "Définir des en-têtes personnalisés",
"settings.smtp.testConnection": "Tester la connexion",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "E-mail du destinataire",
"settings.title": "Paramètres",
"settings.updateAvailable": "Une nouvelle version ({version}) est disponible.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Ütemezett",
"campaigns.statusChanged": "\"{name}\" van {status}",
"campaigns.subject": "Tárgy",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mail",
"campaigns.testSent": "Tesztüzenet elküldve",
"campaigns.timestamps": "Időbélyegek",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Egyéni fejlécek beállítása",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Beállítások",
"settings.updateAvailable": "Új frissítés {version} elérhető.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Programmata",
"campaigns.statusChanged": "\"{name}\" e {status}",
"campaigns.subject": "Oggetto",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "Emails di prova",
"campaigns.testSent": "Messaggio di prova inviato",
"campaigns.timestamps": "Marcatura temporale ",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Definisci intestazioni personalizzate",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Impostazioni",
"settings.updateAvailable": "È a disposizione una nuova versione {version}.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "スケジュールされている",
"campaigns.statusChanged": "\"{name}\" は {status}",
"campaigns.subject": "件名",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "メール",
"campaigns.testSent": "テストメッセージ送信済み",
"campaigns.timestamps": "タイムスタンプ",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "カスタムヘッダー設定",
"settings.smtp.testConnection": "接続テスト",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "メール宛",
"settings.title": "設定",
"settings.updateAvailable": "新しい {version} の更新が可能です。",
Expand Down
2 changes: 2 additions & 0 deletions i18n/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "ആസൂത്രണം ചെയ്തു",
"campaigns.statusChanged": "\"{name}\" {status} ആണ്",
"campaigns.subject": "വിഷയം",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "ഈ-മെയിലുകൾ",
"campaigns.testSent": "ടെസ്റ്റ് സന്ദേശം അയച്ചു",
"campaigns.timestamps": "സമയം",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "ഇഷ്‌ടാനുസൃത തലക്കെട്ടുകൾ നൽകുക",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "ക്രമീകരണങ്ങൾ",
"settings.updateAvailable": "A new update {version} is available.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Gepland",
"campaigns.statusChanged": "\"{name}\" is {status}",
"campaigns.subject": "Onderwerp",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Testbericht verzonden",
"campaigns.timestamps": "Tijdstippen",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Stuur e-mail",
"settings.smtp.setCustomHeaders": "Stel custom headers in",
"settings.smtp.testConnection": "Test verbinding",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "Naar e-mail",
"settings.title": "Instellingen",
"settings.updateAvailable": "Een nieuwe update {version} is beschikbaar.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Zaplanowana",
"campaigns.statusChanged": "\"{name}\" jest {status}",
"campaigns.subject": "Temat",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-maile",
"campaigns.testSent": "Wiadomość testowa wysłana",
"campaigns.timestamps": "Sygnatury czasowe",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Ustaw niestandardowe nagłówki",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Ustawienia",
"settings.updateAvailable": "Nowa wersja {version} jest dostępna.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Agendado",
"campaigns.statusChanged": "O status da campanha \"{name}\" é {status}",
"campaigns.subject": "Assunto",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Mensagem de teste enviada",
"campaigns.timestamps": "Data e hora",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Enviar e-mail",
"settings.smtp.setCustomHeaders": "Definir cabeçalhos personalizados",
"settings.smtp.testConnection": "Testar conexões",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Configurações",
"settings.updateAvailable": "Atualização: a nova versão {version} já está disponível.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Agendada",
"campaigns.statusChanged": "\"{name}\" está {status}",
"campaigns.subject": "Assunto",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Mensagem de teste enviada",
"campaigns.timestamps": "Carimbo de hora",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Colocar headers customizados",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Definições",
"settings.updateAvailable": "A new update {version} is available.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Programat",
"campaigns.statusChanged": "\"{nume}\" este {stare}",
"campaigns.subject": "Subiect",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "Emailuri",
"campaigns.testSent": "Mesaju de test a fost trimis",
"campaigns.timestamps": "Marcaje de timp",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Setează anteturi personalizate",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Setări",
"settings.updateAvailable": "Este disponibilă o nouă actualizare {versiune}.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Запланирована",
"campaigns.statusChanged": "\"{name}\" {status}",
"campaigns.subject": "Тема",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Тестовое сообщение отправлено",
"campaigns.timestamps": "Метки времени",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Установка настраиваемых заголовков",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Параметры",
"settings.updateAvailable": "Доступна новая версия: {version}.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Zamanlandı",
"campaigns.statusChanged": "\"{name}\" durumu {status}",
"campaigns.subject": "Konu",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-postalar",
"campaigns.testSent": "Test mesajı gönderildi",
"campaigns.timestamps": "Zaman etiketi",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Özel başlık tanımla",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Ayarlar",
"settings.updateAvailable": "Yeni bir güncel sürüm {version} mevcuttur.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "Đã lên lịch",
"campaigns.statusChanged": "\"{name}\" là {status}",
"campaigns.subject": "Tiêu đề",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "E-mails",
"campaigns.testSent": "Gửi tin nhắn thử",
"campaigns.timestamps": "Dấu thời gian",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "Đặt tiêu đề tùy chỉnh",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "Cài đặt",
"settings.updateAvailable": "Đã có bản cập nhật mới {version}.",
Expand Down
2 changes: 2 additions & 0 deletions i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"campaigns.status.scheduled": "已安排",
"campaigns.statusChanged": " “{name}”是 {status}",
"campaigns.subject": "主题",
"campaigns.testDisabled": "Enter password to test",
"campaigns.testEmails": "电子邮件",
"campaigns.testSent": "已发送测试消息",
"campaigns.timestamps": "时间戳",
Expand Down Expand Up @@ -457,6 +458,7 @@
"settings.smtp.sendTest": "Send e-mail",
"settings.smtp.setCustomHeaders": "设置自定义标头",
"settings.smtp.testConnection": "Test connection",
"settings.smtp.testEnterEmail": "Enter password to test",
"settings.smtp.toEmail": "To e-mail",
"settings.title": "设置",
"settings.updateAvailable": "有新的更新 {version} 可用。",
Expand Down

0 comments on commit 57dbb9e

Please sign in to comment.