mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
Fixed: Show errors when adding Root Folder
This commit is contained in:
parent
0a5200766e
commit
16d60a6586
@ -118,7 +118,7 @@ class ImportSeriesSelectFolder extends Component {
|
||||
className={styles.addErrorAlert}
|
||||
kind={kinds.DANGER}
|
||||
>
|
||||
{translate('RootFolderLoadError')}
|
||||
{translate('AddRootFolderError')}
|
||||
|
||||
<ul>
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ function RootFolders() {
|
||||
|
||||
if (!isFetching && !!error) {
|
||||
return (
|
||||
<Alert kind={kinds.DANGER}>{translate('UnableToLoadRootFolders')}</Alert>
|
||||
<Alert kind={kinds.DANGER}>{translate('RootFoldersLoadError')}</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,18 @@
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import Alert from 'Components/Alert';
|
||||
import FileBrowserModal from 'Components/FileBrowser/FileBrowserModal';
|
||||
import Icon from 'Components/Icon';
|
||||
import Button from 'Components/Link/Button';
|
||||
import { icons, kinds, sizes } from 'Helpers/Props';
|
||||
import { addRootFolder } from 'Store/Actions/rootFolderActions';
|
||||
import createRootFoldersSelector from 'Store/Selectors/createRootFoldersSelector';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import styles from './AddRootFolder.css';
|
||||
|
||||
function AddRootFolder() {
|
||||
const { isSaving, saveError } = useSelector(createRootFoldersSelector());
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const [isAddNewRootFolderModalOpen, setIsAddNewRootFolderModalOpen] =
|
||||
@ -30,6 +34,23 @@ function AddRootFolder() {
|
||||
}, [setIsAddNewRootFolderModalOpen]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!isSaving && saveError ? (
|
||||
<Alert kind={kinds.DANGER}>
|
||||
{translate('AddRootFolderError')}
|
||||
|
||||
<ul>
|
||||
{Array.isArray(saveError.responseJSON) ? (
|
||||
saveError.responseJSON.map((e, index) => {
|
||||
return <li key={index}>{e.errorMessage}</li>;
|
||||
})
|
||||
) : (
|
||||
<li>{JSON.stringify(saveError.responseJSON)}</li>
|
||||
)}
|
||||
</ul>
|
||||
</Alert>
|
||||
) : null}
|
||||
|
||||
<div className={styles.addRootFolderButtonContainer}>
|
||||
<Button
|
||||
kind={kinds.PRIMARY}
|
||||
@ -48,6 +69,7 @@ function AddRootFolder() {
|
||||
onModalClose={onAddRootFolderModalClose}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
"AddRemotePathMapping": "Add Remote Path Mapping",
|
||||
"AddRemotePathMappingError": "Unable to add a new remote path mapping, please try again.",
|
||||
"AddRootFolder": "Add Root Folder",
|
||||
"AddRootFolderError": "Unable to add root folder",
|
||||
"AddSeriesWithTitle": "Add {title}",
|
||||
"AddToDownloadQueue": "Add to download queue",
|
||||
"Added": "Added",
|
||||
@ -1348,7 +1349,6 @@
|
||||
"RetentionHelpText": "Usenet only: Set to zero to set for unlimited retention",
|
||||
"RetryingDownloadOn": "Retrying download on {date} at {time}",
|
||||
"RootFolder": "Root Folder",
|
||||
"RootFolderLoadError": "Unable to add root folder",
|
||||
"RootFolderMissingHealthCheckMessage": "Missing root folder: {rootFolderPath}",
|
||||
"RootFolderMultipleMissingHealthCheckMessage": "Multiple root folders are missing: {rootFolderPaths}",
|
||||
"RootFolderPath": "Root Folder Path",
|
||||
@ -1620,7 +1620,6 @@
|
||||
"Umask777Description": "{octal} - Everyone write",
|
||||
"UnableToLoadAutoTagging": "Unable to load auto tagging",
|
||||
"UnableToLoadBackups": "Unable to load backups",
|
||||
"UnableToLoadRootFolders": "Unable to load root folders",
|
||||
"UnableToUpdateSonarrDirectly": "Unable to update {appName} directly,",
|
||||
"Unavailable": "Unavailable",
|
||||
"Underscore": "Underscore",
|
||||
|
Loading…
Reference in New Issue
Block a user