1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

New: Mass Editor is now part of series list

This commit is contained in:
Mark McDowall
2023-01-15 10:47:40 -08:00
committed by Mark McDowall
parent 815a16d5cf
commit a731d24e23
42 changed files with 1455 additions and 63 deletions
@@ -5,14 +5,15 @@ import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import sortByName from 'Utilities/Array/sortByName';
import SelectInput from './SelectInput';
import EnhancedSelectInput from './EnhancedSelectInput';
function createMapStateToProps() {
return createSelector(
createSortedSectionSelector('settings.qualityProfiles', sortByName),
(state, { includeNoChange }) => includeNoChange,
(state, { includeNoChangeDisabled }) => includeNoChangeDisabled,
(state, { includeMixed }) => includeMixed,
(qualityProfiles, includeNoChange, includeMixed) => {
(qualityProfiles, includeNoChange, includeNoChangeDisabled = true, includeMixed) => {
const values = _.map(qualityProfiles.items, (qualityProfile) => {
return {
key: qualityProfile.id,
@@ -24,7 +25,7 @@ function createMapStateToProps() {
values.unshift({
key: 'noChange',
value: 'No Change',
disabled: true
disabled: includeNoChangeDisabled
});
}
@@ -55,8 +56,8 @@ class QualityProfileSelectInputConnector extends Component {
values
} = this.props;
if (!value || !_.some(values, (option) => parseInt(option.key) === value)) {
const firstValue = _.find(values, (option) => !isNaN(parseInt(option.key)));
if (!value || !values.some((option) => option.key === value || parseInt(option.key) === value)) {
const firstValue = values.find((option) => !isNaN(parseInt(option.key)));
if (firstValue) {
this.onChange({ name, value: firstValue.key });
@@ -76,7 +77,7 @@ class QualityProfileSelectInputConnector extends Component {
render() {
return (
<SelectInput
<EnhancedSelectInput
{...this.props}
onChange={this.onChange}
/>