@ -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') }
< / M o d a l H e a d e r >
< / M o d a l H e a d e r >
< ModalBody >
< ModalBody >
@ -62,46 +63,40 @@ function AuthenticationRequiredModalContent(props) {
className = { styles . authRequiredAlert }
className = { styles . authRequiredAlert }
kind = { kinds . WARNING }
kind = { kinds . WARNING }
>
>
{ authenticationRequiredWarning}
{ tr anslate( 'A uthenticationRequiredWarning') }
< / A l e r t >
< / A l e r t >
{
{
isPopulated && ! error ?
isPopulated && ! error ?
< div >
< div >
< FormGroup >
< FormGroup >
< FormLabel > Authentication< / F o r m L a b e l >
< FormLabel > { translate( ' Authentication') } < / F o r m L a b e l >
< 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 }
/ >
/ >
< / F o r m G r o u p >
< / F o r m G r o u p >
{
authenticationEnabled ?
< FormGroup >
< FormGroup >
< FormLabel > Authentication Required< / F o r m L a b e l >
< FormLabel > { translate ( 'AuthenticationRequired' ) } < / F o r m L a b e l >
< FormInputGroup
< FormInputGroup
type = { inputTypes . SELECT }
type = { inputTypes . SELECT }
name = "authenticationRequired"
name = "authenticationRequired"
values = { authenticationRequiredOptions }
values = { authenticationRequiredOptions }
helpText = "Change which requests authentication is required for. Do not change unless you understand the risks."
helpText = { translate ( 'AuthenticationRequiredHelpText' ) }
onChange = { onInputChange }
onChange = { onInputChange }
{ ... authenticationRequired }
{ ... authenticationRequired }
/ >
/ >
< / F o r m G r o u p > :
< / F o r m G r o u p >
null
}
{
authenticationEnabled ?
< FormGroup >
< FormGroup >
< FormLabel > Username< / F o r m L a b e l >
< FormLabel > { translate ( 'Username' ) } < / F o r m L a b e l >
< FormInputGroup
< FormInputGroup
type = { inputTypes . TEXT }
type = { inputTypes . TEXT }
@ -109,14 +104,10 @@ function AuthenticationRequiredModalContent(props) {
onChange = { onInputChange }
onChange = { onInputChange }
{ ... username }
{ ... username }
/ >
/ >
< / F o r m G r o u p > :
< / F o r m G r o u p >
null
}
{
authenticationEnabled ?
< FormGroup >
< FormGroup >
< FormLabel > Password< / F o r m L a b e l >
< FormLabel > { translate ( 'Password' ) } < / F o r m L a b e l >
< FormInputGroup
< FormInputGroup
type = { inputTypes . PASSWORD }
type = { inputTypes . PASSWORD }
@ -124,9 +115,7 @@ function AuthenticationRequiredModalContent(props) {
onChange = { onInputChange }
onChange = { onInputChange }
{ ... password }
{ ... password }
/ >
/ >
< / F o r m G r o u p > :
< / F o r m G r o u p >
null
}
< / d i v > :
< / d i v > :
null
null
}
}
@ -143,7 +132,7 @@ function AuthenticationRequiredModalContent(props) {
isDisabled = { ! authenticationEnabled }
isDisabled = { ! authenticationEnabled }
onPress = { onSavePress }
onPress = { onSavePress }
>
>
Save
{ translate( ' Save') }
< / S p i n n e r B u t t o n >
< / S p i n n e r B u t t o n >
< / M o d a l F o o t e r >
< / M o d a l F o o t e r >
< / M o d a l C o n t e n t >
< / M o d a l C o n t e n t >