mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-03-25 22:00:54 +02:00
Show save error in UI
This commit is contained in:
parent
9549038121
commit
974c4a601b
@ -1,3 +1,7 @@
|
||||
.saveError {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
|
@ -5,6 +5,7 @@ interface CssExports {
|
||||
'header': string;
|
||||
'megabytesPerMinute': string;
|
||||
'quality': string;
|
||||
'saveError': string;
|
||||
'sizeLimit': string;
|
||||
'sizeLimitHelpText': string;
|
||||
'sizeLimitHelpTextContainer': string;
|
||||
|
@ -1,7 +1,9 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import Alert from 'Components/Alert';
|
||||
import FieldSet from 'Components/FieldSet';
|
||||
import PageSectionContent from 'Components/Page/PageSectionContent';
|
||||
import { kinds } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import QualityDefinitionConnector from './QualityDefinitionConnector';
|
||||
import styles from './QualityDefinitions.css';
|
||||
@ -15,15 +17,44 @@ class QualityDefinitions extends Component {
|
||||
const {
|
||||
items,
|
||||
advancedSettings,
|
||||
saveError,
|
||||
...otherProps
|
||||
} = this.props;
|
||||
|
||||
console.log(saveError);
|
||||
|
||||
return (
|
||||
<FieldSet legend={translate('QualityDefinitions')}>
|
||||
<PageSectionContent
|
||||
errorMessage={translate('QualityDefinitionsLoadError')}
|
||||
{...otherProps}
|
||||
>
|
||||
{
|
||||
saveError ?
|
||||
<div className={styles.saveError}>
|
||||
<Alert kind={kinds.DANGER}>
|
||||
{translate('QualityDefinitionsSaveError')}
|
||||
<ul>
|
||||
{
|
||||
Array.isArray(saveError.responseJSON) ?
|
||||
saveError.responseJSON.map((error, index) => {
|
||||
return (
|
||||
<li key={index}>
|
||||
{error.errorMessage}
|
||||
</li>
|
||||
);
|
||||
}) :
|
||||
<li>
|
||||
{
|
||||
JSON.stringify(saveError.responseJSON)
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</Alert>
|
||||
</div> : null
|
||||
}
|
||||
|
||||
<div className={styles.header}>
|
||||
<div className={styles.quality}>
|
||||
{translate('Quality')}
|
||||
@ -72,6 +103,7 @@ class QualityDefinitions extends Component {
|
||||
QualityDefinitions.propTypes = {
|
||||
isFetching: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object,
|
||||
saveError: PropTypes.object,
|
||||
defaultProfile: PropTypes.object,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
advancedSettings: PropTypes.bool.isRequired
|
||||
|
@ -1591,6 +1591,7 @@
|
||||
"QualityCutoffNotMet": "Quality cutoff has not been met",
|
||||
"QualityDefinitions": "Quality Definitions",
|
||||
"QualityDefinitionsLoadError": "Unable to load Quality Definitions",
|
||||
"QualityDefinitionsSaveError": "Unable to save Quality Definitions",
|
||||
"QualityLimitsSeriesRuntimeHelpText": "Limits are automatically adjusted for the series runtime and number of episodes in the file.",
|
||||
"QualityProfile": "Quality Profile",
|
||||
"QualityProfileInUseSeriesListCollection": "Can't delete a quality profile that is attached to a series, list, or collection",
|
||||
|
Loading…
x
Reference in New Issue
Block a user