diff --git a/frontend/src/Components/Filter/Builder/FilterBuilderModalContent.js b/frontend/src/Components/Filter/Builder/FilterBuilderModalContent.js index d33f4d4fb..0c4a31657 100644 --- a/frontend/src/Components/Filter/Builder/FilterBuilderModalContent.js +++ b/frontend/src/Components/Filter/Builder/FilterBuilderModalContent.js @@ -1,3 +1,4 @@ +import { maxBy } from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import FormInputGroup from 'Components/Form/FormInputGroup'; @@ -50,7 +51,7 @@ class FilterBuilderModalContent extends Component { if (id) { dispatchSetFilter({ selectedFilterKey: id }); } else { - const last = customFilters[customFilters.length -1]; + const last = maxBy(customFilters, 'id'); dispatchSetFilter({ selectedFilterKey: last.id }); } @@ -108,7 +109,7 @@ class FilterBuilderModalContent extends Component { this.setState({ labelErrors: [ { - message: 'Label is required' + message: translate('LabelIsRequired') } ] }); @@ -146,7 +147,7 @@ class FilterBuilderModalContent extends Component { return ( - Custom Filter + {translate('CustomFilter')} @@ -166,7 +167,9 @@ class FilterBuilderModalContent extends Component { -
{translate('Filters')}
+
+ {translate('Filters')} +
{ diff --git a/frontend/src/Components/Filter/CustomFilters/CustomFilter.js b/frontend/src/Components/Filter/CustomFilters/CustomFilter.js index 7407f729a..9f378d5a2 100644 --- a/frontend/src/Components/Filter/CustomFilters/CustomFilter.js +++ b/frontend/src/Components/Filter/CustomFilters/CustomFilter.js @@ -37,8 +37,8 @@ class CustomFilter extends Component { dispatchSetFilter } = this.props; - // Assume that delete and then unmounting means the delete was successful. - // Moving this check to a ancestor would be more accurate, but would have + // Assume that delete and then unmounting means the deletion was successful. + // Moving this check to an ancestor would be more accurate, but would have // more boilerplate. if (this.state.isDeleting && id === selectedFilterKey) { dispatchSetFilter({ selectedFilterKey: 'all' }); diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 520837a8f..b903ae491 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -245,6 +245,7 @@ "CreateEmptyArtistFoldersHelpText": "Create missing artist folders during disk scan", "CreateGroup": "Create group", "Custom": "Custom", + "CustomFilter": "Custom Filter", "CustomFilters": "Custom Filters", "CustomFormat": "Custom Format", "CustomFormatRequiredHelpText": "This {0} condition must match for the custom format to apply. Otherwise a single {0} match is sufficient.", @@ -482,8 +483,8 @@ "FormatAgeHours": "hours", "FormatAgeMinute": "minute", "FormatAgeMinutes": "minutes", - "FormatDateTimeRelative": "{relativeDay}, {formattedDate} {formattedTime}", "FormatDateTime": "{formattedDate} {formattedTime}", + "FormatDateTimeRelative": "{relativeDay}, {formattedDate} {formattedTime}", "FormatRuntimeHours": "{hours}h", "FormatRuntimeMinutes": "{minutes}m", "FormatShortTimeSpanHours": "{hours} hour(s)", @@ -609,6 +610,7 @@ "ItsEasyToAddANewArtistJustStartTypingTheNameOfTheArtistYouWantToAdd": "It's easy to add a new artist, just start typing the name of the artist you want to add.", "KeyboardShortcuts": "Keyboard Shortcuts", "Label": "Label", + "LabelIsRequired": "Label is required", "Language": "Language", "Large": "Large", "LastAlbum": "Last Album",