From 5946456c49820bcf38aa150b9cc1aba3117865c6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 28 Aug 2023 22:31:12 +0300 Subject: [PATCH] Improve messaging in Authentication Required modal Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> (cherry picked from commit 340740377eb83527814f6c9b6f3602321d4a4344) --- .../src/FirstRun/AuthenticationRequiredModalContent.js | 10 +++++++--- frontend/src/Settings/General/SecuritySettings.js | 4 ++-- src/NzbDrone.Core/Localization/Core/en.json | 10 +++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/FirstRun/AuthenticationRequiredModalContent.js b/frontend/src/FirstRun/AuthenticationRequiredModalContent.js index 5b9141a7b..c7fb75c07 100644 --- a/frontend/src/FirstRun/AuthenticationRequiredModalContent.js +++ b/frontend/src/FirstRun/AuthenticationRequiredModalContent.js @@ -63,20 +63,22 @@ function AuthenticationRequiredModalContent(props) { className={styles.authRequiredAlert} kind={kinds.WARNING} > - {translate('AuthenticationRequiredWarning')} + {translate('AuthenticationRequiredWarning', { appName: 'Lidarr' })} { isPopulated && !error ?
- {translate('Authentication')} + {translate('AuthenticationMethod')} @@ -102,6 +104,7 @@ function AuthenticationRequiredModalContent(props) { type={inputTypes.TEXT} name="username" onChange={onInputChange} + helpTextWarning={username.value === '' ? translate('AuthenticationRequiredUsernameHelpTextWarning') : undefined} {...username} /> @@ -113,6 +116,7 @@ function AuthenticationRequiredModalContent(props) { type={inputTypes.PASSWORD} name="password" onChange={onInputChange} + helpTextWarning={password.value === '' ? translate('AuthenticationRequiredPasswordHelpTextWarning') : undefined} {...password} /> diff --git a/frontend/src/Settings/General/SecuritySettings.js b/frontend/src/Settings/General/SecuritySettings.js index 577ba0c78..551a14a4e 100644 --- a/frontend/src/Settings/General/SecuritySettings.js +++ b/frontend/src/Settings/General/SecuritySettings.js @@ -141,8 +141,8 @@ class SecuritySettings extends Component { type={inputTypes.SELECT} name="authenticationMethod" values={authenticationMethodOptions} - helpText={translate('AuthenticationMethodHelpText')} - helpTextWarning={translate('AuthenticationRequiredWarning')} + helpText={translate('AuthenticationMethodHelpText', { appName: 'Lidarr' })} + helpTextWarning={translate('AuthenticationRequiredWarning', { appName: 'Lidarr' })} onChange={onInputChange} {...authenticationMethod} /> diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index b29e17432..04a66a2d2 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -106,12 +106,16 @@ "AuthBasic": "Basic (Browser Popup)", "AuthForm": "Forms (Login Page)", "Authentication": "Authentication", - "AuthenticationMethodHelpText": "Require Username and Password to access Lidarr", - "AutoAdd": "Auto Add", + "AuthenticationMethod": "Authentication Method", + "AuthenticationMethodHelpText": "Require Username and Password to access {appName}", + "AuthenticationMethodHelpTextWarning": "Please select a valid authentication method", "AuthenticationRequired": "Authentication Required", "AuthenticationRequiredHelpText": "Change which requests authentication is required for. Do not change unless you understand the risks.", - "AuthenticationRequiredWarning": "To prevent remote access without authentication, Lidarr now requires authentication to be enabled. You can optionally disable authentication from local addresses.", + "AuthenticationRequiredPasswordHelpTextWarning": "Enter a new password", + "AuthenticationRequiredUsernameHelpTextWarning": "Enter a new username", + "AuthenticationRequiredWarning": "To prevent remote access without authentication, {appName} now requires authentication to be enabled. You can optionally disable authentication from local addresses.", "Auto": "Auto", + "AutoAdd": "Auto Add", "AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release", "Automatic": "Automatic", "AutomaticAdd": "Automatic Add",