import PropTypes from 'prop-types'; import React from 'react'; import SeriesMonitoringOptionsPopoverContent from 'AddSeries/SeriesMonitoringOptionsPopoverContent'; import SeriesMonitorNewItemsOptionsPopoverContent from 'AddSeries/SeriesMonitorNewItemsOptionsPopoverContent'; import SeriesTypePopoverContent from 'AddSeries/SeriesTypePopoverContent'; import Alert from 'Components/Alert'; import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormInputGroup from 'Components/Form/FormInputGroup'; import FormLabel from 'Components/Form/FormLabel'; import ProviderFieldFormGroup from 'Components/Form/ProviderFieldFormGroup'; import Icon from 'Components/Icon'; import Button from 'Components/Link/Button'; import SpinnerErrorButton from 'Components/Link/SpinnerErrorButton'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import ModalBody from 'Components/Modal/ModalBody'; import ModalContent from 'Components/Modal/ModalContent'; import ModalFooter from 'Components/Modal/ModalFooter'; import ModalHeader from 'Components/Modal/ModalHeader'; import Popover from 'Components/Tooltip/Popover'; import { icons, inputTypes, kinds, tooltipPositions } from 'Helpers/Props'; import AdvancedSettingsButton from 'Settings/AdvancedSettingsButton'; import formatShortTimeSpan from 'Utilities/Date/formatShortTimeSpan'; import translate from 'Utilities/String/translate'; import styles from './EditImportListModalContent.css'; function EditImportListModalContent(props) { const { advancedSettings, isFetching, error, isSaving, isTesting, saveError, item, onInputChange, onFieldChange, onModalClose, onSavePress, onTestPress, onAdvancedSettingsPress, onDeleteImportListPress, ...otherProps } = props; const { id, implementationName, name, enableAutomaticAdd, searchForMissingEpisodes, minRefreshInterval, shouldMonitor, rootFolderPath, monitorNewItems, qualityProfileId, seriesType, seasonFolder, tags, fields } = item; return ( {id ? translate('EditImportListImplementation', { implementationName }) : translate('AddImportListImplementation', { implementationName })} { isFetching ? : null } { !isFetching && !!error ? {translate('AddListError')} : null } { !isFetching && !error ?
{translate('ListWillRefreshEveryInterval', { refreshInterval: formatShortTimeSpan(minRefreshInterval.value) })} {translate('Name')} {translate('EnableAutomaticAdd')} {translate('ImportListSearchForMissingEpisodes')} {translate('Monitor')} } title={translate('MonitoringOptions')} body={} position={tooltipPositions.RIGHT} /> {translate('MonitorNewSeasons')} } title={translate('MonitorNewSeasons')} body={} position={tooltipPositions.RIGHT} /> {translate('RootFolder')} {translate('QualityProfile')} {translate('SeriesType')} } title={translate('SeriesTypes')} body={} position={tooltipPositions.RIGHT} /> {translate('SeasonFolder')} {translate('SonarrTags')} { !!fields && !!fields.length &&
{ fields.map((field) => { return ( ); }) }
}
: null }
{ id && } {translate('Test')} {translate('Save')}
); } EditImportListModalContent.propTypes = { advancedSettings: PropTypes.bool.isRequired, isFetching: PropTypes.bool.isRequired, error: PropTypes.object, isSaving: PropTypes.bool.isRequired, isTesting: PropTypes.bool.isRequired, saveError: PropTypes.object, item: PropTypes.object.isRequired, onInputChange: PropTypes.func.isRequired, onFieldChange: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired, onSavePress: PropTypes.func.isRequired, onTestPress: PropTypes.func.isRequired, onAdvancedSettingsPress: PropTypes.func.isRequired, onDeleteImportListPress: PropTypes.func }; export default EditImportListModalContent;