(cherry picked from commit b95a84f6612333d96fcdca083f9c39d96956f3f4) Closes #5083pull/6194/head
parent
5328fb4ab3
commit
ade40b72bc
@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
||||
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
function SeriesMonitorNewItemsOptionsPopoverContent() {
|
||||
return (
|
||||
<DescriptionList>
|
||||
<DescriptionListItem
|
||||
title={translate('MonitorAllSeasons')}
|
||||
data={translate('MonitorAllSeasonsDescription')}
|
||||
/>
|
||||
|
||||
<DescriptionListItem
|
||||
title={translate('MonitorNone')}
|
||||
data={translate('MonitorNoNewSeasonsDescription')}
|
||||
/>
|
||||
</DescriptionList>
|
||||
);
|
||||
}
|
||||
|
||||
export default SeriesMonitorNewItemsOptionsPopoverContent;
|
@ -0,0 +1,50 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import monitorNewItemsOptions from 'Utilities/Series/monitorNewItemsOptions';
|
||||
import SelectInput from './SelectInput';
|
||||
|
||||
function MonitorNewItemsSelectInput(props) {
|
||||
const {
|
||||
includeNoChange,
|
||||
includeMixed,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const values = [...monitorNewItemsOptions];
|
||||
|
||||
if (includeNoChange) {
|
||||
values.unshift({
|
||||
key: 'noChange',
|
||||
value: 'No Change',
|
||||
disabled: true
|
||||
});
|
||||
}
|
||||
|
||||
if (includeMixed) {
|
||||
values.unshift({
|
||||
key: 'mixed',
|
||||
value: '(Mixed)',
|
||||
disabled: true
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<SelectInput
|
||||
values={values}
|
||||
{...otherProps}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
MonitorNewItemsSelectInput.propTypes = {
|
||||
includeNoChange: PropTypes.bool.isRequired,
|
||||
includeMixed: PropTypes.bool.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
MonitorNewItemsSelectInput.defaultProps = {
|
||||
includeNoChange: false,
|
||||
includeMixed: false
|
||||
};
|
||||
|
||||
export default MonitorNewItemsSelectInput;
|
@ -0,0 +1,18 @@
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
const monitorNewItemsOptions = [
|
||||
{
|
||||
key: 'all',
|
||||
get value() {
|
||||
return translate('MonitorAllSeasons');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'none',
|
||||
get value() {
|
||||
return translate('MonitorNone');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export default monitorNewItemsOptions;
|
@ -0,0 +1,15 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(200)]
|
||||
public class AddNewItemMonitorType : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Series").AddColumn("MonitorNewItems").AsInt32().WithDefaultValue(0);
|
||||
Alter.Table("ImportLists").AddColumn("MonitorNewItems").AsInt32().WithDefaultValue(0);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue