@ -14,6 +14,50 @@ import styles from './CollectionFooter.css';
const NO _CHANGE = 'noChange' ;
const monitoredOptions = [
{
key : NO _CHANGE ,
get value ( ) {
return translate ( 'NoChange' ) ;
} ,
disabled : true
} ,
{
key : 'monitored' ,
get value ( ) {
return translate ( 'Monitored' ) ;
}
} ,
{
key : 'unmonitored' ,
get value ( ) {
return translate ( 'Unmonitored' ) ;
}
}
] ;
const searchOnAddOptions = [
{
key : NO _CHANGE ,
get value ( ) {
return translate ( 'NoChange' ) ;
} ,
disabled : true
} ,
{
key : 'yes' ,
get value ( ) {
return translate ( 'Yes' ) ;
}
} ,
{
key : 'no' ,
get value ( ) {
return translate ( 'No' ) ;
}
}
] ;
class CollectionFooter extends Component {
//
@ -23,12 +67,12 @@ class CollectionFooter extends Component {
super ( props , context ) ;
this . state = {
monitor : NO _CHANGE ,
monitored : NO _CHANGE ,
monitor : NO _CHANGE ,
qualityProfileId : NO _CHANGE ,
minimumAvailability : NO _CHANGE ,
rootFolderPath : NO _CHANGE ,
destinationRootFolder: null
searchOnAdd: NO _CHANGE
} ;
}
@ -44,8 +88,9 @@ class CollectionFooter extends Component {
monitored : NO _CHANGE ,
monitor : NO _CHANGE ,
qualityProfileId : NO _CHANGE ,
minimumAvailability : NO _CHANGE ,
rootFolderPath : NO _CHANGE ,
minimumAvailability : NO _CHANGE
searchOnAdd : NO _CHANGE
} ) ;
}
@ -63,11 +108,12 @@ class CollectionFooter extends Component {
onUpdateSelectedPress = ( ) => {
const {
monitor ,
monitored ,
monitor ,
qualityProfileId ,
minimumAvailability ,
rootFolderPath
rootFolderPath ,
searchOnAdd
} = this . state ;
const changes = { } ;
@ -92,6 +138,10 @@ class CollectionFooter extends Component {
changes . rootFolderPath = rootFolderPath ;
}
if ( searchOnAdd !== NO _CHANGE ) {
changes . searchOnAdd = searchOnAdd === 'yes' ;
}
this . props . onUpdateSelectedPress ( changes ) ;
} ;
@ -109,15 +159,10 @@ class CollectionFooter extends Component {
monitor ,
qualityProfileId ,
minimumAvailability ,
rootFolderPath
rootFolderPath ,
searchOnAdd
} = this . state ;
const monitoredOptions = [
{ key : NO _CHANGE , value : translate ( 'NoChange' ) , disabled : true } ,
{ key : 'monitored' , value : translate ( 'Monitored' ) } ,
{ key : 'unmonitored' , value : translate ( 'Unmonitored' ) }
] ;
const selectedCount = selectedIds . length ;
return (
@ -125,7 +170,7 @@ class CollectionFooter extends Component {
< div className = { styles . inputContainer } >
< CollectionFooterLabel
label = { translate ( 'MonitorCollection' ) }
isSaving = { isSaving }
isSaving = { isSaving && monitored !== NO _CHANGE }
/ >
< SelectInput
@ -140,7 +185,7 @@ class CollectionFooter extends Component {
< div className = { styles . inputContainer } >
< CollectionFooterLabel
label = { translate ( 'MonitorMovies' ) }
isSaving = { isSaving }
isSaving = { isSaving && monitor !== NO _CHANGE }
/ >
< SelectInput
@ -198,10 +243,25 @@ class CollectionFooter extends Component {
/ >
< / d i v >
< div className = { styles . inputContainer } >
< CollectionFooterLabel
label = { translate ( 'SearchMoviesOnAdd' ) }
isSaving = { isSaving && searchOnAdd !== NO _CHANGE }
/ >
< SelectInput
name = "searchOnAdd"
value = { searchOnAdd }
values = { searchOnAddOptions }
isDisabled = { ! selectedCount }
onChange = { this . onInputChange }
/ >
< / d i v >
< div className = { styles . buttonContainer } >
< div className = { styles . buttonContainerContent } >
< CollectionFooterLabel
label = { translate ( 'CollectionsSelectedInterp' , [ selectedCount ] ) }
label = { translate ( 'Co untCollectionsSelected', { count : selectedCount } ) }
isSaving = { false }
/ >