New: Rename Protocol to Preferred Protocol in Delay Profiles

Closes #4951
This commit is contained in:
Mark McDowall 2022-04-30 16:55:33 -07:00
parent 52d95fa632
commit 704cf7aebe
4 changed files with 22 additions and 21 deletions

View File

@ -84,7 +84,7 @@ class DelayProfile extends Component {
connectDragSource
} = this.props;
let preferred = titleCase(preferredProtocol);
let preferred = `Prefer ${titleCase(preferredProtocol)}`;
if (!enableUsenet) {
preferred = 'Only Torrent';

View File

@ -81,7 +81,7 @@ class DelayProfiles extends Component {
>
<div>
<div className={styles.delayProfilesHeader}>
<div className={styles.column}>Protocol</div>
<div className={styles.column}>Preferred Protocol</div>
<div className={styles.column}>Usenet Delay</div>
<div className={styles.column}>Torrent Delay</div>
<div className={styles.tags}>Tags</div>

View File

@ -16,6 +16,13 @@ import FormLabel from 'Components/Form/FormLabel';
import FormInputGroup from 'Components/Form/FormInputGroup';
import styles from './EditDelayProfileModalContent.css';
const protocolOptions = [
{ key: 'preferUsenet', value: 'Prefer Usenet' },
{ key: 'preferTorrent', value: 'Prefer Torrent' },
{ key: 'onlyUsenet', value: 'Only Usenet' },
{ key: 'onlyTorrent', value: 'Only Torrent' }
];
function EditDelayProfileModalContent(props) {
const {
id,
@ -25,7 +32,6 @@ function EditDelayProfileModalContent(props) {
saveError,
item,
protocol,
protocolOptions,
onInputChange,
onProtocolChange,
onSavePress,
@ -51,20 +57,22 @@ function EditDelayProfileModalContent(props) {
<ModalBody>
{
isFetching &&
<LoadingIndicator />
isFetching ?
<LoadingIndicator /> :
null
}
{
!isFetching && !!error &&
<div>Unable to add a new quality profile, please try again.</div>
!isFetching && !!error ?
<div>Unable to add a new quality profile, please try again.</div> :
null
}
{
!isFetching && !error &&
!isFetching && !error ?
<Form {...otherProps}>
<FormGroup>
<FormLabel>Protocol</FormLabel>
<FormLabel>Preferred Protocol</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
@ -140,19 +148,21 @@ function EditDelayProfileModalContent(props) {
/>
</FormGroup>
}
</Form>
</Form> :
null
}
</ModalBody>
<ModalFooter>
{
id && id > 1 &&
id && id > 1 ?
<Button
className={styles.deleteButton}
kind={kinds.DANGER}
onPress={onDeleteDelayProfilePress}
>
Delete
</Button>
</Button> :
null
}
<Button
@ -190,7 +200,6 @@ EditDelayProfileModalContent.propTypes = {
saveError: PropTypes.object,
item: PropTypes.shape(delayProfileShape).isRequired,
protocol: PropTypes.string.isRequired,
protocolOptions: PropTypes.arrayOf(PropTypes.object).isRequired,
onInputChange: PropTypes.func.isRequired,
onProtocolChange: PropTypes.func.isRequired,
onSavePress: PropTypes.func.isRequired,

View File

@ -16,13 +16,6 @@ const newDelayProfile = {
tags: []
};
const protocolOptions = [
{ key: 'preferUsenet', value: 'Prefer Usenet' },
{ key: 'preferTorrent', value: 'Prefer Torrent' },
{ key: 'onlyUsenet', value: 'Only Usenet' },
{ key: 'onlyTorrent', value: 'Only Torrent' }
];
function createDelayProfileSelector() {
return createSelector(
(state, { id }) => id,
@ -78,7 +71,6 @@ function createMapStateToProps() {
return {
protocol,
protocolOptions,
...delayProfile
};
}