New: Show all options when authentication modal is open

(cherry picked from commit c7d6c0f45264944bb5c00374ff025344218ef7eb)
(cherry picked from commit ca93a72d63b89f7b1f3346643cc549e4df617263)
pull/4220/head
Mark McDowall 2 years ago committed by Qstick
parent 2d140e35bd
commit 6c4db36cdf

@ -11,7 +11,8 @@ import ModalContent from 'Components/Modal/ModalContent';
import ModalFooter from 'Components/Modal/ModalFooter'; import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader'; import ModalHeader from 'Components/Modal/ModalHeader';
import { inputTypes, kinds } from 'Helpers/Props'; import { inputTypes, kinds } from 'Helpers/Props';
import { authenticationMethodOptions, authenticationRequiredOptions, authenticationRequiredWarning } from 'Settings/General/SecuritySettings'; import { authenticationMethodOptions, authenticationRequiredOptions } from 'Settings/General/SecuritySettings';
import translate from 'Utilities/String/translate';
import styles from './AuthenticationRequiredModalContent.css'; import styles from './AuthenticationRequiredModalContent.css';
function onModalClose() { function onModalClose() {
@ -54,7 +55,7 @@ function AuthenticationRequiredModalContent(props) {
onModalClose={onModalClose} onModalClose={onModalClose}
> >
<ModalHeader> <ModalHeader>
Authentication Required {translate('AuthenticationRequired')}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
@ -62,71 +63,59 @@ function AuthenticationRequiredModalContent(props) {
className={styles.authRequiredAlert} className={styles.authRequiredAlert}
kind={kinds.WARNING} kind={kinds.WARNING}
> >
{authenticationRequiredWarning} {translate('AuthenticationRequiredWarning')}
</Alert> </Alert>
{ {
isPopulated && !error ? isPopulated && !error ?
<div> <div>
<FormGroup> <FormGroup>
<FormLabel>Authentication</FormLabel> <FormLabel>{translate('Authentication')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="authenticationMethod" name="authenticationMethod"
values={authenticationMethodOptions} values={authenticationMethodOptions}
helpText="Require Username and Password to access Radarr" helpText={translate('AuthenticationMethodHelpText')}
onChange={onInputChange} onChange={onInputChange}
{...authenticationMethod} {...authenticationMethod}
/> />
</FormGroup> </FormGroup>
{ <FormGroup>
authenticationEnabled ? <FormLabel>{translate('AuthenticationRequired')}</FormLabel>
<FormGroup>
<FormLabel>Authentication Required</FormLabel> <FormInputGroup
type={inputTypes.SELECT}
<FormInputGroup name="authenticationRequired"
type={inputTypes.SELECT} values={authenticationRequiredOptions}
name="authenticationRequired" helpText={translate('AuthenticationRequiredHelpText')}
values={authenticationRequiredOptions} onChange={onInputChange}
helpText="Change which requests authentication is required for. Do not change unless you understand the risks." {...authenticationRequired}
onChange={onInputChange} />
{...authenticationRequired} </FormGroup>
/>
</FormGroup> : <FormGroup>
null <FormLabel>{translate('Username')}</FormLabel>
}
<FormInputGroup
{ type={inputTypes.TEXT}
authenticationEnabled ? name="username"
<FormGroup> onChange={onInputChange}
<FormLabel>Username</FormLabel> {...username}
/>
<FormInputGroup </FormGroup>
type={inputTypes.TEXT}
name="username" <FormGroup>
onChange={onInputChange} <FormLabel>{translate('Password')}</FormLabel>
{...username}
/> <FormInputGroup
</FormGroup> : type={inputTypes.PASSWORD}
null name="password"
} onChange={onInputChange}
{...password}
{ />
authenticationEnabled ? </FormGroup>
<FormGroup>
<FormLabel>Password</FormLabel>
<FormInputGroup
type={inputTypes.PASSWORD}
name="password"
onChange={onInputChange}
{...password}
/>
</FormGroup> :
null
}
</div> : </div> :
null null
} }
@ -143,7 +132,7 @@ function AuthenticationRequiredModalContent(props) {
isDisabled={!authenticationEnabled} isDisabled={!authenticationEnabled}
onPress={onSavePress} onPress={onSavePress}
> >
Save {translate('Save')}
</SpinnerButton> </SpinnerButton>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>

@ -108,6 +108,10 @@
"Authentication": "Authentication", "Authentication": "Authentication",
"AuthenticationMethodHelpText": "Require Username and Password to access Lidarr", "AuthenticationMethodHelpText": "Require Username and Password to access Lidarr",
"AutoAdd": "Auto Add", "AutoAdd": "Auto Add",
"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.",
"Auto": "Auto",
"AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release", "AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release",
"Automatic": "Automatic", "Automatic": "Automatic",
"AutomaticAdd": "Automatic Add", "AutomaticAdd": "Automatic Add",

Loading…
Cancel
Save