From 9620207503126342b3bf099b835b4b658a5a0b31 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 4 Feb 2024 20:40:38 +0200 Subject: [PATCH] Improve add/loading error notices (cherry picked from commit dd704579df43b0dd835f8bb618c4b4412561a888) Closes #9767 --- frontend/src/Organize/OrganizePreviewModalContent.js | 2 +- .../CustomFormats/CustomFormats/CustomFormats.js | 2 +- .../Specifications/AddSpecificationModalContent.js | 4 ++-- .../DownloadClients/DownloadClients/DownloadClient.js | 2 +- .../EditRemotePathMappingModalContentConnector.js | 3 +-- .../EditImportListExclusionModalContentConnector.js | 9 ++++----- .../src/Settings/ImportLists/ImportLists/ImportList.js | 2 +- .../Settings/ImportLists/Options/ImportListOptions.js | 2 +- .../Indexers/Indexers/EditIndexerModalContent.js | 5 +++-- frontend/src/Settings/Indexers/Indexers/Indexer.js | 2 +- .../Delay/EditDelayProfileModalContentConnector.js | 3 +-- .../Profiles/Quality/EditQualityProfileModalContent.js | 5 +++-- .../src/Settings/Profiles/Quality/QualityProfiles.js | 2 +- frontend/src/Settings/Profiles/Release/ReleaseProfile.js | 4 ++-- src/NzbDrone.Core/Localization/Core/ar.json | 2 +- src/NzbDrone.Core/Localization/Core/bg.json | 2 +- src/NzbDrone.Core/Localization/Core/ca.json | 2 +- src/NzbDrone.Core/Localization/Core/cs.json | 2 +- src/NzbDrone.Core/Localization/Core/da.json | 2 +- src/NzbDrone.Core/Localization/Core/de.json | 2 +- src/NzbDrone.Core/Localization/Core/el.json | 2 +- src/NzbDrone.Core/Localization/Core/en.json | 2 +- src/NzbDrone.Core/Localization/Core/es.json | 2 +- src/NzbDrone.Core/Localization/Core/fi.json | 2 +- src/NzbDrone.Core/Localization/Core/fr.json | 2 +- src/NzbDrone.Core/Localization/Core/he.json | 2 +- src/NzbDrone.Core/Localization/Core/hi.json | 2 +- src/NzbDrone.Core/Localization/Core/hu.json | 2 +- src/NzbDrone.Core/Localization/Core/is.json | 2 +- src/NzbDrone.Core/Localization/Core/it.json | 2 +- src/NzbDrone.Core/Localization/Core/ja.json | 2 +- src/NzbDrone.Core/Localization/Core/ko.json | 2 +- src/NzbDrone.Core/Localization/Core/nl.json | 2 +- src/NzbDrone.Core/Localization/Core/pl.json | 2 +- src/NzbDrone.Core/Localization/Core/pt.json | 2 +- src/NzbDrone.Core/Localization/Core/pt_BR.json | 2 +- src/NzbDrone.Core/Localization/Core/ro.json | 2 +- src/NzbDrone.Core/Localization/Core/ru.json | 2 +- src/NzbDrone.Core/Localization/Core/sv.json | 2 +- src/NzbDrone.Core/Localization/Core/th.json | 2 +- src/NzbDrone.Core/Localization/Core/tr.json | 2 +- src/NzbDrone.Core/Localization/Core/uk.json | 2 +- src/NzbDrone.Core/Localization/Core/vi.json | 2 +- src/NzbDrone.Core/Localization/Core/zh_CN.json | 2 +- 44 files changed, 53 insertions(+), 54 deletions(-) diff --git a/frontend/src/Organize/OrganizePreviewModalContent.js b/frontend/src/Organize/OrganizePreviewModalContent.js index fc3fbeb6e..33ee8baa6 100644 --- a/frontend/src/Organize/OrganizePreviewModalContent.js +++ b/frontend/src/Organize/OrganizePreviewModalContent.js @@ -104,7 +104,7 @@ class OrganizePreviewModalContent extends Component { { !isFetching && error && -
{translate('OrganizeLoadError')}
+ {translate('OrganizeLoadError')} } { diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormats.js b/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormats.js index 188df61d9..8036a4a25 100644 --- a/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormats.js +++ b/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormats.js @@ -62,7 +62,7 @@ class CustomFormats extends Component {
{ diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/Specifications/AddSpecificationModalContent.js b/frontend/src/Settings/CustomFormats/CustomFormats/Specifications/AddSpecificationModalContent.js index a61ff3599..933db301e 100644 --- a/frontend/src/Settings/CustomFormats/CustomFormats/Specifications/AddSpecificationModalContent.js +++ b/frontend/src/Settings/CustomFormats/CustomFormats/Specifications/AddSpecificationModalContent.js @@ -42,9 +42,9 @@ class AddSpecificationModalContent extends Component { { !isSchemaFetching && !!schemaError && -
+ {translate('AddConditionError')} -
+ } { diff --git a/frontend/src/Settings/DownloadClients/DownloadClients/DownloadClient.js b/frontend/src/Settings/DownloadClients/DownloadClients/DownloadClient.js index fceaeda65..4e5063382 100644 --- a/frontend/src/Settings/DownloadClients/DownloadClients/DownloadClient.js +++ b/frontend/src/Settings/DownloadClients/DownloadClients/DownloadClient.js @@ -41,7 +41,7 @@ class DownloadClient extends Component { }); }; - onDeleteDownloadClientModalClose= () => { + onDeleteDownloadClientModalClose = () => { this.setState({ isDeleteDownloadClientModalOpen: false }); }; diff --git a/frontend/src/Settings/DownloadClients/RemotePathMappings/EditRemotePathMappingModalContentConnector.js b/frontend/src/Settings/DownloadClients/RemotePathMappings/EditRemotePathMappingModalContentConnector.js index 136a68f50..6848d8bad 100644 --- a/frontend/src/Settings/DownloadClients/RemotePathMappings/EditRemotePathMappingModalContentConnector.js +++ b/frontend/src/Settings/DownloadClients/RemotePathMappings/EditRemotePathMappingModalContentConnector.js @@ -1,4 +1,3 @@ -import _ from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -55,7 +54,7 @@ function createRemotePathMappingSelector() { items } = remotePathMappings; - const mapping = id ? _.find(items, { id }) : newRemotePathMapping; + const mapping = id ? items.find((i) => i.id === id) : newRemotePathMapping; const settings = selectSettings(mapping, pendingChanges, saveError); return { diff --git a/frontend/src/Settings/ImportLists/ImportListExclusions/EditImportListExclusionModalContentConnector.js b/frontend/src/Settings/ImportLists/ImportListExclusions/EditImportListExclusionModalContentConnector.js index 63d437c0d..ebccc321c 100644 --- a/frontend/src/Settings/ImportLists/ImportListExclusions/EditImportListExclusionModalContentConnector.js +++ b/frontend/src/Settings/ImportLists/ImportListExclusions/EditImportListExclusionModalContentConnector.js @@ -1,4 +1,3 @@ -import _ from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -7,7 +6,7 @@ import { saveImportExclusion, setImportExclusionValue } from 'Store/Actions/sett import selectSettings from 'Store/Selectors/selectSettings'; import EditImportListExclusionModalContent from './EditImportListExclusionModalContent'; -const newImportExclusion = { +const newImportListExclusion = { movieTitle: '', tmdbId: 0, movieYear: 0 @@ -27,7 +26,7 @@ function createImportExclusionSelector() { items } = importExclusions; - const mapping = id ? _.find(items, { id }) : newImportExclusion; + const mapping = id ? items.find((i) => i.id === id) : newImportListExclusion; const settings = selectSettings(mapping, pendingChanges, saveError); return { @@ -66,10 +65,10 @@ class EditImportExclusionModalContentConnector extends Component { componentDidMount() { if (!this.props.id) { - Object.keys(newImportExclusion).forEach((name) => { + Object.keys(newImportListExclusion).forEach((name) => { this.props.setImportExclusionValue({ name, - value: newImportExclusion[name] + value: newImportListExclusion[name] }); }); } diff --git a/frontend/src/Settings/ImportLists/ImportLists/ImportList.js b/frontend/src/Settings/ImportLists/ImportLists/ImportList.js index 4d4577453..414fd8213 100644 --- a/frontend/src/Settings/ImportLists/ImportLists/ImportList.js +++ b/frontend/src/Settings/ImportLists/ImportLists/ImportList.js @@ -41,7 +41,7 @@ class ImportList extends Component { }); }; - onDeleteImportListModalClose= () => { + onDeleteImportListModalClose = () => { this.setState({ isDeleteImportListModalOpen: false }); }; diff --git a/frontend/src/Settings/ImportLists/Options/ImportListOptions.js b/frontend/src/Settings/ImportLists/Options/ImportListOptions.js index 8aa1902ea..dcd963386 100644 --- a/frontend/src/Settings/ImportLists/Options/ImportListOptions.js +++ b/frontend/src/Settings/ImportLists/Options/ImportListOptions.js @@ -39,7 +39,7 @@ function ImportListOptions(props) { { !isFetching && error && - {translate('UnableToLoadListOptions')} + {translate('ListOptionsLoadError')} } diff --git a/frontend/src/Settings/Indexers/Indexers/EditIndexerModalContent.js b/frontend/src/Settings/Indexers/Indexers/EditIndexerModalContent.js index 73043512a..77e23cead 100644 --- a/frontend/src/Settings/Indexers/Indexers/EditIndexerModalContent.js +++ b/frontend/src/Settings/Indexers/Indexers/EditIndexerModalContent.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; +import Alert from 'Components/Alert'; import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormInputGroup from 'Components/Form/FormInputGroup'; @@ -66,9 +67,9 @@ function EditIndexerModalContent(props) { { !isFetching && !!error && -
+ {translate('AddIndexerError')} -
+ } { diff --git a/frontend/src/Settings/Indexers/Indexers/Indexer.js b/frontend/src/Settings/Indexers/Indexers/Indexer.js index 5110e9317..f9a944e34 100644 --- a/frontend/src/Settings/Indexers/Indexers/Indexer.js +++ b/frontend/src/Settings/Indexers/Indexers/Indexer.js @@ -42,7 +42,7 @@ class Indexer extends Component { }); }; - onDeleteIndexerModalClose= () => { + onDeleteIndexerModalClose = () => { this.setState({ isDeleteIndexerModalOpen: false }); }; diff --git a/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContentConnector.js b/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContentConnector.js index a1e3d85a1..3643bb158 100644 --- a/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContentConnector.js +++ b/frontend/src/Settings/Profiles/Delay/EditDelayProfileModalContentConnector.js @@ -1,4 +1,3 @@ -import _ from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -33,7 +32,7 @@ function createDelayProfileSelector() { items } = delayProfiles; - const profile = id ? _.find(items, { id }) : newDelayProfile; + const profile = id ? items.find((i) => i.id === id) : newDelayProfile; const settings = selectSettings(profile, pendingChanges, saveError); return { diff --git a/frontend/src/Settings/Profiles/Quality/EditQualityProfileModalContent.js b/frontend/src/Settings/Profiles/Quality/EditQualityProfileModalContent.js index aa2c4852c..08d424cf0 100644 --- a/frontend/src/Settings/Profiles/Quality/EditQualityProfileModalContent.js +++ b/frontend/src/Settings/Profiles/Quality/EditQualityProfileModalContent.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; +import Alert from 'Components/Alert'; import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormInputGroup from 'Components/Form/FormInputGroup'; @@ -157,9 +158,9 @@ class EditQualityProfileModalContent extends Component { { !isFetching && !!error && -
+ {translate('AddQualityProfileError')} -
+ } { diff --git a/frontend/src/Settings/Profiles/Quality/QualityProfiles.js b/frontend/src/Settings/Profiles/Quality/QualityProfiles.js index 26740b468..6e40bedad 100644 --- a/frontend/src/Settings/Profiles/Quality/QualityProfiles.js +++ b/frontend/src/Settings/Profiles/Quality/QualityProfiles.js @@ -55,7 +55,7 @@ class QualityProfiles extends Component {
{ diff --git a/frontend/src/Settings/Profiles/Release/ReleaseProfile.js b/frontend/src/Settings/Profiles/Release/ReleaseProfile.js index 42d4dea09..cc4017d8d 100644 --- a/frontend/src/Settings/Profiles/Release/ReleaseProfile.js +++ b/frontend/src/Settings/Profiles/Release/ReleaseProfile.js @@ -41,7 +41,7 @@ class ReleaseProfile extends Component { }); }; - onDeleteReleaseProfileModalClose= () => { + onDeleteReleaseProfileModalClose = () => { this.setState({ isDeleteReleaseProfileModalOpen: false }); }; @@ -70,7 +70,7 @@ class ReleaseProfile extends Component { isDeleteReleaseProfileModalOpen } = this.state; - const indexer = indexerList.find((i) => i.id === indexerId); + const indexer = indexerId !== 0 && indexerList.find((i) => i.id === indexerId); return (