From 7c6858ecfb1ba8e0bf12b501e0321a6057a617bf Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 30 Apr 2022 16:55:33 -0700 Subject: [PATCH] New: Rename Protocol to Preferred Protocol in Delay Profiles Closes #7278 (cherry picked from commit 704cf7aebef60b5b5bdf1ea55d68d4a3394396e0) --- .../Settings/Profiles/Delay/DelayProfile.js | 2 +- .../Settings/Profiles/Delay/DelayProfiles.js | 2 +- .../Delay/EditDelayProfileModalContent.js | 31 ++++++++++++------- .../EditDelayProfileModalContentConnector.js | 9 ------ src/NzbDrone.Core/Localization/Core/en.json | 1 + 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/frontend/src/Settings/Profiles/Delay/DelayProfile.js b/frontend/src/Settings/Profiles/Delay/DelayProfile.js index f53dd5cbb..a3daefc80 100644 --- a/frontend/src/Settings/Profiles/Delay/DelayProfile.js +++ b/frontend/src/Settings/Profiles/Delay/DelayProfile.js @@ -85,7 +85,7 @@ class DelayProfile extends Component { connectDragSource } = this.props; - let preferred = titleCase(preferredProtocol); + let preferred = `Prefer ${titleCase(preferredProtocol)}`; if (!enableUsenet) { preferred = translate('OnlyTorrent'); diff --git a/frontend/src/Settings/Profiles/Delay/DelayProfiles.js b/frontend/src/Settings/Profiles/Delay/DelayProfiles.js index 52109eb87..83ac09bf8 100644 --- a/frontend/src/Settings/Profiles/Delay/DelayProfiles.js +++ b/frontend/src/Settings/Profiles/Delay/DelayProfiles.js @@ -83,7 +83,7 @@ class DelayProfiles extends Component {
- {translate('Protocol')} + {translate('PreferredProtocol')}
{translate('UsenetDelay')} diff --git a/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContent.js b/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContent.js index 8607be28a..4348cccf2 100644 --- a/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContent.js +++ b/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContent.js @@ -17,6 +17,13 @@ import { boolSettingShape, numberSettingShape, tagSettingShape } from 'Helpers/P import translate from 'Utilities/String/translate'; import styles from './EditDelayProfileModalContent.css'; +const protocolOptions = [ + { key: 'preferUsenet', value: translate('PreferUsenet') }, + { key: 'preferTorrent', value: translate('PreferTorrent') }, + { key: 'onlyUsenet', value: translate('OnlyUsenet') }, + { key: 'onlyTorrent', value: translate('OnlyTorrent') } +]; + function EditDelayProfileModalContent(props) { const { id, @@ -26,7 +33,6 @@ function EditDelayProfileModalContent(props) { saveError, item, protocol, - protocolOptions, onInputChange, onProtocolChange, onSavePress, @@ -52,22 +58,24 @@ function EditDelayProfileModalContent(props) { { - isFetching && - + isFetching ? + : + null } { - !isFetching && !!error && + !isFetching && !!error ?
{translate('UnableToAddANewQualityProfilePleaseTryAgain')} -
+
: + null } { - !isFetching && !error && + !isFetching && !error ?
- {translate('Protocol')} + {translate('PreferredProtocol')} } -
+ : + null } { - id && id > 1 && + id && id > 1 ? + : + null }