Improve messaging in Authentication Required modal

Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
This commit is contained in:
Bogdan 2023-08-28 22:31:12 +03:00 committed by Mark McDowall
parent 87b3a305e9
commit 340740377e
3 changed files with 15 additions and 7 deletions

View File

@ -63,20 +63,22 @@ function AuthenticationRequiredModalContent(props) {
className={styles.authRequiredAlert} className={styles.authRequiredAlert}
kind={kinds.WARNING} kind={kinds.WARNING}
> >
{translate('AuthenticationRequiredWarning')} {translate('AuthenticationRequiredWarning', { appName: 'Sonarr' })}
</Alert> </Alert>
{ {
isPopulated && !error ? isPopulated && !error ?
<div> <div>
<FormGroup> <FormGroup>
<FormLabel>{translate('Authentication')}</FormLabel> <FormLabel>{translate('AuthenticationMethod')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="authenticationMethod" name="authenticationMethod"
values={authenticationMethodOptions} values={authenticationMethodOptions}
helpText={translate('AuthenticationMethodHelpText')} helpText={translate('AuthenticationMethodHelpText', { appName: 'Sonarr' })}
helpTextWarning={authenticationMethod.value === 'none' ? translate('AuthenticationMethodHelpTextWarning') : undefined}
helpLink="https://wiki.servarr.com/sonarr/faq#forced-authentication"
onChange={onInputChange} onChange={onInputChange}
{...authenticationMethod} {...authenticationMethod}
/> />
@ -102,6 +104,7 @@ function AuthenticationRequiredModalContent(props) {
type={inputTypes.TEXT} type={inputTypes.TEXT}
name="username" name="username"
onChange={onInputChange} onChange={onInputChange}
helpTextWarning={username.value === '' ? translate('AuthenticationRequiredUsernameHelpTextWarning') : undefined}
{...username} {...username}
/> />
</FormGroup> </FormGroup>
@ -113,6 +116,7 @@ function AuthenticationRequiredModalContent(props) {
type={inputTypes.PASSWORD} type={inputTypes.PASSWORD}
name="password" name="password"
onChange={onInputChange} onChange={onInputChange}
helpTextWarning={password.value === '' ? translate('AuthenticationRequiredPasswordHelpTextWarning') : undefined}
{...password} {...password}
/> />
</FormGroup> </FormGroup>

View File

@ -139,8 +139,8 @@ class SecuritySettings extends Component {
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="authenticationMethod" name="authenticationMethod"
values={authenticationMethodOptions} values={authenticationMethodOptions}
helpText={translate('AuthenticationMethodHelpText')} helpText={translate('AuthenticationMethodHelpText', { appName: 'Sonarr' })}
helpTextWarning={translate('AuthenticationRequiredWarning')} helpTextWarning={translate('AuthenticationRequiredWarning', { appName: 'Sonarr' })}
onChange={onInputChange} onChange={onInputChange}
{...authenticationMethod} {...authenticationMethod}
/> />

View File

@ -103,10 +103,14 @@
"AuthBasic": "Basic (Browser Popup)", "AuthBasic": "Basic (Browser Popup)",
"AuthForm": "Forms (Login Page)", "AuthForm": "Forms (Login Page)",
"Authentication": "Authentication", "Authentication": "Authentication",
"AuthenticationMethodHelpText": "Require Username and Password to access Sonarr", "AuthenticationMethod": "Authentication Method",
"AuthenticationMethodHelpText": "Require Username and Password to access {appName}",
"AuthenticationMethodHelpTextWarning": "Please select a valid authentication method",
"AuthenticationRequired": "Authentication Required", "AuthenticationRequired": "Authentication Required",
"AuthenticationRequiredHelpText": "Change which requests authentication is required for. Do not change unless you understand the risks.", "AuthenticationRequiredHelpText": "Change which requests authentication is required for. Do not change unless you understand the risks.",
"AuthenticationRequiredWarning": "To prevent remote access without authentication, Sonarr 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.",
"AutoAdd": "Auto Add", "AutoAdd": "Auto Add",
"AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release", "AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release",
"AutoTagging": "Auto Tagging", "AutoTagging": "Auto Tagging",