mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
New: Advanced settings toggle in indexer edit/add modal
(cherry picked from commit 94a8ef63044f47b615facbb6e04200bdd3797189) Fixes #8538
This commit is contained in:
parent
9175c737d3
commit
156def3138
@ -10,7 +10,8 @@ import styles from './AdvancedSettingsButton.css';
|
|||||||
function AdvancedSettingsButton(props) {
|
function AdvancedSettingsButton(props) {
|
||||||
const {
|
const {
|
||||||
advancedSettings,
|
advancedSettings,
|
||||||
onAdvancedSettingsPress
|
onAdvancedSettingsPress,
|
||||||
|
showLabel
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -43,18 +44,27 @@ function AdvancedSettingsButton(props) {
|
|||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div className={styles.labelContainer}>
|
{
|
||||||
<div className={styles.label}>
|
showLabel ?
|
||||||
{advancedSettings ? translate('HideAdvanced') : translate('ShowAdvanced')}
|
<div className={styles.labelContainer}>
|
||||||
</div>
|
<div className={styles.label}>
|
||||||
</div>
|
{advancedSettings ? translate('HideAdvanced') : translate('ShowAdvanced')}
|
||||||
|
</div>
|
||||||
|
</div> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
AdvancedSettingsButton.propTypes = {
|
AdvancedSettingsButton.propTypes = {
|
||||||
advancedSettings: PropTypes.bool.isRequired,
|
advancedSettings: PropTypes.bool.isRequired,
|
||||||
onAdvancedSettingsPress: PropTypes.func.isRequired
|
onAdvancedSettingsPress: PropTypes.func.isRequired,
|
||||||
|
showLabel: PropTypes.bool.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
AdvancedSettingsButton.defaultProps = {
|
||||||
|
showLabel: true
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AdvancedSettingsButton;
|
export default AdvancedSettingsButton;
|
||||||
|
@ -13,6 +13,7 @@ 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 AdvancedSettingsButton from 'Settings/AdvancedSettingsButton';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import styles from './EditIndexerModalContent.css';
|
import styles from './EditIndexerModalContent.css';
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ function EditIndexerModalContent(props) {
|
|||||||
onSavePress,
|
onSavePress,
|
||||||
onTestPress,
|
onTestPress,
|
||||||
onDeleteIndexerPress,
|
onDeleteIndexerPress,
|
||||||
|
onAdvancedSettingsPress,
|
||||||
...otherProps
|
...otherProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
@ -200,6 +202,12 @@ function EditIndexerModalContent(props) {
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<AdvancedSettingsButton
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
|
onAdvancedSettingsPress={onAdvancedSettingsPress}
|
||||||
|
showLabel={false}
|
||||||
|
/>
|
||||||
|
|
||||||
<SpinnerErrorButton
|
<SpinnerErrorButton
|
||||||
isSpinning={isTesting}
|
isSpinning={isTesting}
|
||||||
error={saveError}
|
error={saveError}
|
||||||
@ -239,6 +247,7 @@ EditIndexerModalContent.propTypes = {
|
|||||||
onModalClose: PropTypes.func.isRequired,
|
onModalClose: PropTypes.func.isRequired,
|
||||||
onSavePress: PropTypes.func.isRequired,
|
onSavePress: PropTypes.func.isRequired,
|
||||||
onTestPress: PropTypes.func.isRequired,
|
onTestPress: PropTypes.func.isRequired,
|
||||||
|
onAdvancedSettingsPress: PropTypes.func.isRequired,
|
||||||
onDeleteIndexerPress: PropTypes.func
|
onDeleteIndexerPress: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { saveIndexer, setIndexerFieldValue, setIndexerValue, testIndexer } from 'Store/Actions/settingsActions';
|
import { saveIndexer, setIndexerFieldValue, setIndexerValue, testIndexer, toggleAdvancedSettings } from 'Store/Actions/settingsActions';
|
||||||
import createProviderSettingsSelector from 'Store/Selectors/createProviderSettingsSelector';
|
import createProviderSettingsSelector from 'Store/Selectors/createProviderSettingsSelector';
|
||||||
import EditIndexerModalContent from './EditIndexerModalContent';
|
import EditIndexerModalContent from './EditIndexerModalContent';
|
||||||
|
|
||||||
@ -23,7 +23,8 @@ const mapDispatchToProps = {
|
|||||||
setIndexerValue,
|
setIndexerValue,
|
||||||
setIndexerFieldValue,
|
setIndexerFieldValue,
|
||||||
saveIndexer,
|
saveIndexer,
|
||||||
testIndexer
|
testIndexer,
|
||||||
|
toggleAdvancedSettings
|
||||||
};
|
};
|
||||||
|
|
||||||
class EditIndexerModalContentConnector extends Component {
|
class EditIndexerModalContentConnector extends Component {
|
||||||
@ -56,6 +57,10 @@ class EditIndexerModalContentConnector extends Component {
|
|||||||
this.props.testIndexer({ id: this.props.id });
|
this.props.testIndexer({ id: this.props.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onAdvancedSettingsPress = () => {
|
||||||
|
this.props.toggleAdvancedSettings();
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Render
|
// Render
|
||||||
|
|
||||||
@ -65,6 +70,7 @@ class EditIndexerModalContentConnector extends Component {
|
|||||||
{...this.props}
|
{...this.props}
|
||||||
onSavePress={this.onSavePress}
|
onSavePress={this.onSavePress}
|
||||||
onTestPress={this.onTestPress}
|
onTestPress={this.onTestPress}
|
||||||
|
onAdvancedSettingsPress={this.onAdvancedSettingsPress}
|
||||||
onInputChange={this.onInputChange}
|
onInputChange={this.onInputChange}
|
||||||
onFieldChange={this.onFieldChange}
|
onFieldChange={this.onFieldChange}
|
||||||
/>
|
/>
|
||||||
@ -80,6 +86,7 @@ EditIndexerModalContentConnector.propTypes = {
|
|||||||
item: PropTypes.object.isRequired,
|
item: PropTypes.object.isRequired,
|
||||||
setIndexerValue: PropTypes.func.isRequired,
|
setIndexerValue: PropTypes.func.isRequired,
|
||||||
setIndexerFieldValue: PropTypes.func.isRequired,
|
setIndexerFieldValue: PropTypes.func.isRequired,
|
||||||
|
toggleAdvancedSettings: PropTypes.func.isRequired,
|
||||||
saveIndexer: PropTypes.func.isRequired,
|
saveIndexer: PropTypes.func.isRequired,
|
||||||
testIndexer: PropTypes.func.isRequired,
|
testIndexer: PropTypes.func.isRequired,
|
||||||
onModalClose: PropTypes.func.isRequired
|
onModalClose: PropTypes.func.isRequired
|
||||||
|
Loading…
Reference in New Issue
Block a user