New: Option to control which new author books get monitored

This commit is contained in:
ta264
2021-12-01 21:23:23 +00:00
parent 1d694af98e
commit c51ae664aa
42 changed files with 774 additions and 265 deletions
+31 -6
View File
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import MonitorBooksSelectInput from 'Components/Form/MonitorBooksSelectInput';
import MonitorNewItemsSelectInput from 'Components/Form/MonitorNewItemsSelectInput';
import SelectInput from 'Components/Form/SelectInput';
import SpinnerButton from 'Components/Link/SpinnerButton';
import PageContentFooter from 'Components/Page/PageContentFooter';
@@ -19,7 +20,8 @@ class BookshelfFooter extends Component {
this.state = {
monitored: NO_CHANGE,
monitor: NO_CHANGE
monitor: NO_CHANGE,
monitorNewItems: NO_CHANGE
};
}
@@ -32,7 +34,8 @@ class BookshelfFooter extends Component {
if (prevProps.isSaving && !isSaving && !saveError) {
this.setState({
monitored: NO_CHANGE,
monitor: NO_CHANGE
monitor: NO_CHANGE,
monitorNewItems: NO_CHANGE
});
}
}
@@ -47,7 +50,8 @@ class BookshelfFooter extends Component {
onUpdateSelectedPress = () => {
const {
monitor,
monitored
monitored,
monitorNewItems
} = this.state;
const changes = {};
@@ -60,6 +64,10 @@ class BookshelfFooter extends Component {
changes.monitor = monitor;
}
if (monitorNewItems !== NO_CHANGE) {
changes.monitorNewItems = monitorNewItems;
}
this.props.onUpdateSelectedPress(changes);
}
@@ -74,7 +82,8 @@ class BookshelfFooter extends Component {
const {
monitored,
monitor
monitor,
monitorNewItems
} = this.state;
const monitoredOptions = [
@@ -83,7 +92,9 @@ class BookshelfFooter extends Component {
{ key: 'unmonitored', value: 'Unmonitored' }
];
const noChanges = monitored === NO_CHANGE && monitor === NO_CHANGE;
const noChanges = monitored === NO_CHANGE &&
monitor === NO_CHANGE &&
monitorNewItems === NO_CHANGE;
return (
<PageContentFooter>
@@ -103,7 +114,7 @@ class BookshelfFooter extends Component {
<div className={styles.inputContainer}>
<div className={styles.label}>
Monitor Books
Monitor Existing Books
</div>
<MonitorBooksSelectInput
@@ -115,6 +126,20 @@ class BookshelfFooter extends Component {
/>
</div>
<div className={styles.inputContainer}>
<div className={styles.label}>
Monitor New Books
</div>
<MonitorNewItemsSelectInput
name="monitorNewItems"
value={monitorNewItems}
includeNoChange={true}
isDisabled={!selectedCount}
onChange={this.onInputChange}
/>
</div>
<div>
<div className={styles.label}>
{selectedCount} Author(s) Selected