New: Combine mass editor and author editor, enable book editor

This commit is contained in:
ta264
2021-11-21 18:31:03 +00:00
parent d460cbf319
commit 615acdaebe
45 changed files with 1122 additions and 931 deletions
+211 -7
View File
@@ -1,6 +1,9 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import RetagAuthorModal from 'Author/Editor/AudioTags/RetagAuthorModal';
import AuthorEditorFooter from 'Author/Editor/AuthorEditorFooter';
import OrganizeAuthorModal from 'Author/Editor/Organize/OrganizeAuthorModal';
import NoAuthor from 'Author/NoAuthor';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import PageContent from 'Components/Page/PageContent';
@@ -15,6 +18,9 @@ import { align, icons, sortDirections } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage';
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
import translate from 'Utilities/String/translate';
import getSelectedIds from 'Utilities/Table/getSelectedIds';
import selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected';
import AuthorIndexFooterConnector from './AuthorIndexFooterConnector';
import AuthorIndexFilterMenu from './Menus/AuthorIndexFilterMenu';
import AuthorIndexSortMenu from './Menus/AuthorIndexSortMenu';
@@ -52,12 +58,20 @@ class AuthorIndex extends Component {
jumpBarItems: { order: [] },
jumpToCharacter: null,
isPosterOptionsModalOpen: false,
isOverviewOptionsModalOpen: false
isOverviewOptionsModalOpen: false,
isEditorActive: false,
isOrganizingAuthorModalOpen: false,
isRetaggingAuthorModalOpen: false,
allSelected: false,
allUnselected: false,
lastToggled: null,
selectedState: {}
};
}
componentDidMount() {
this.setJumpBarItems();
this.setSelectedState();
}
componentDidUpdate(prevProps) {
@@ -72,6 +86,7 @@ class AuthorIndex extends Component {
hasDifferentItemsOrOrder(prevProps.items, items)
) {
this.setJumpBarItems();
this.setSelectedState();
}
if (this.state.jumpToCharacter != null) {
@@ -86,6 +101,48 @@ class AuthorIndex extends Component {
this.setState({ scroller: ref });
}
getSelectedIds = () => {
if (this.state.allUnselected) {
return [];
}
return getSelectedIds(this.state.selectedState);
}
setSelectedState() {
const {
items
} = this.props;
const {
selectedState
} = this.state;
const newSelectedState = {};
items.forEach((author) => {
const isItemSelected = selectedState[author.id];
if (isItemSelected) {
newSelectedState[author.id] = isItemSelected;
} else {
newSelectedState[author.id] = false;
}
});
const selectedCount = getSelectedIds(newSelectedState).length;
const newStateCount = Object.keys(newSelectedState).length;
let isAllSelected = false;
let isAllUnselected = false;
if (selectedCount === 0) {
isAllUnselected = true;
} else if (selectedCount === newStateCount) {
isAllSelected = true;
}
this.setState({ selectedState: newSelectedState, allSelected: isAllSelected, allUnselected: isAllUnselected });
}
setJumpBarItems() {
const {
items,
@@ -149,10 +206,72 @@ class AuthorIndex extends Component {
this.setState({ isOverviewOptionsModalOpen: false });
}
onEditorTogglePress = () => {
if (this.state.isEditorActive) {
this.setState({ isEditorActive: false });
} else {
const newState = selectAll(this.state.selectedState, false);
newState.isEditorActive = true;
this.setState(newState);
}
}
onJumpBarItemPress = (jumpToCharacter) => {
this.setState({ jumpToCharacter });
}
onSelectAllChange = ({ value }) => {
this.setState(selectAll(this.state.selectedState, value));
}
onSelectAllPress = () => {
this.onSelectAllChange({ value: !this.state.allSelected });
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
this.setState((state) => {
return toggleSelected(state, this.props.items, id, value, shiftKey);
});
}
onSaveSelected = (changes) => {
this.props.onSaveSelected({
authorIds: this.getSelectedIds(),
...changes
});
}
onOrganizeAuthorPress = () => {
this.setState({ isOrganizingAuthorModalOpen: true });
}
onOrganizeAuthorModalClose = (organized) => {
this.setState({ isOrganizingAuthorModalOpen: false });
if (organized === true) {
this.onSelectAllChange({ value: false });
}
}
onRetagAuthorPress = () => {
this.setState({ isRetaggingAuthorModalOpen: true });
}
onRetagAuthorModalClose = (organized) => {
this.setState({ isRetaggingAuthorModalOpen: false });
if (organized === true) {
this.onSelectAllChange({ value: false });
}
}
onRefreshAuthorPress = () => {
const selectedIds = this.getSelectedIds();
const refreshIds = this.state.isEditorActive && selectedIds.length > 0 ? selectedIds : [];
this.props.onRefreshAuthorPress(refreshIds);
}
//
// Render
@@ -172,11 +291,16 @@ class AuthorIndex extends Component {
view,
isRefreshingAuthor,
isRssSyncExecuting,
isOrganizingAuthor,
isRetaggingAuthor,
isSaving,
saveError,
isDeleting,
deleteError,
onScroll,
onSortSelect,
onFilterSelect,
onViewSelect,
onRefreshAuthorPress,
onRssSyncPress,
...otherProps
} = this.props;
@@ -186,23 +310,31 @@ class AuthorIndex extends Component {
jumpBarItems,
jumpToCharacter,
isPosterOptionsModalOpen,
isOverviewOptionsModalOpen
isOverviewOptionsModalOpen,
isEditorActive,
selectedState,
allSelected,
allUnselected
} = this.state;
const selectedAuthorIds = this.getSelectedIds();
const ViewComponent = getViewComponent(view);
const isLoaded = !!(!error && isPopulated && items.length && scroller);
const hasNoAuthor = !totalItems;
const refreshLabel = isEditorActive && selectedAuthorIds.length > 0 ? translate('UpdateSelected') : translate('UpdateAll');
return (
<PageContent>
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
label={translate('UpdateAll')}
label={refreshLabel}
iconName={icons.REFRESH}
spinningName={icons.REFRESH}
isSpinning={isRefreshingAuthor}
onPress={onRefreshAuthorPress}
onPress={this.onRefreshAuthorPress}
/>
<PageToolbarButton
@@ -213,6 +345,35 @@ class AuthorIndex extends Component {
onPress={onRssSyncPress}
/>
<PageToolbarSeparator />
{
isEditorActive ?
<PageToolbarButton
label={translate('AuthorIndex')}
iconName={icons.AUTHOR_CONTINUING}
isDisabled={hasNoAuthor}
onPress={this.onEditorTogglePress}
/> :
<PageToolbarButton
label={translate('AuthorEditor')}
iconName={icons.EDIT}
isDisabled={hasNoAuthor}
onPress={this.onEditorTogglePress}
/>
}
{
isEditorActive ?
<PageToolbarButton
label={allSelected ? translate('UnselectAll') : translate('SelectAll')}
iconName={icons.CHECK_SQUARE}
isDisabled={hasNoAuthor}
onPress={this.onSelectAllPress}
/> :
null
}
</PageToolbarSection>
<PageToolbarSection
@@ -310,6 +471,12 @@ class AuthorIndex extends Component {
sortKey={sortKey}
sortDirection={sortDirection}
jumpToCharacter={jumpToCharacter}
isEditorActive={isEditorActive}
allSelected={allSelected}
allUnselected={allUnselected}
onSelectedChange={this.onSelectedChange}
onSelectAllChange={this.onSelectAllChange}
selectedState={selectedState}
{...otherProps}
/>
@@ -332,6 +499,24 @@ class AuthorIndex extends Component {
}
</div>
{
isLoaded && isEditorActive &&
<AuthorEditorFooter
authorIds={selectedAuthorIds}
selectedCount={selectedAuthorIds.length}
isSaving={isSaving}
saveError={saveError}
isDeleting={isDeleting}
deleteError={deleteError}
isOrganizingAuthor={isOrganizingAuthor}
isRetaggingAuthor={isRetaggingAuthor}
showMetadataProfile={true}
onSaveSelected={this.onSaveSelected}
onOrganizeAuthorPress={this.onOrganizeAuthorPress}
onRetagAuthorPress={this.onRetagAuthorPress}
/>
}
<AuthorIndexPosterOptionsModal
isOpen={isPosterOptionsModalOpen}
onModalClose={this.onPosterOptionsModalClose}
@@ -340,8 +525,20 @@ class AuthorIndex extends Component {
<AuthorIndexOverviewOptionsModal
isOpen={isOverviewOptionsModalOpen}
onModalClose={this.onOverviewOptionsModalClose}
/>
<OrganizeAuthorModal
isOpen={this.state.isOrganizingAuthorModalOpen}
authorIds={selectedAuthorIds}
onModalClose={this.onOrganizeAuthorModalClose}
/>
<RetagAuthorModal
isOpen={this.state.isRetaggingAuthorModalOpen}
authorIds={selectedAuthorIds}
onModalClose={this.onRetagAuthorModalClose}
/>
</PageContent>
);
}
@@ -361,14 +558,21 @@ AuthorIndex.propTypes = {
sortDirection: PropTypes.oneOf(sortDirections.all),
view: PropTypes.string.isRequired,
isRefreshingAuthor: PropTypes.bool.isRequired,
isOrganizingAuthor: PropTypes.bool.isRequired,
isRetaggingAuthor: PropTypes.bool.isRequired,
isRssSyncExecuting: PropTypes.bool.isRequired,
isSmallScreen: PropTypes.bool.isRequired,
isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object,
isDeleting: PropTypes.bool.isRequired,
deleteError: PropTypes.object,
onSortSelect: PropTypes.func.isRequired,
onFilterSelect: PropTypes.func.isRequired,
onViewSelect: PropTypes.func.isRequired,
onRefreshAuthorPress: PropTypes.func.isRequired,
onRssSyncPress: PropTypes.func.isRequired,
onScroll: PropTypes.func.isRequired
onScroll: PropTypes.func.isRequired,
onSaveSelected: PropTypes.func.isRequired
};
export default AuthorIndex;
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import * as commandNames from 'Commands/commandNames';
import withScrollPosition from 'Components/withScrollPosition';
import { setAuthorFilter, setAuthorSort, setAuthorTableOption, setAuthorView } from 'Store/Actions/authorIndexActions';
import { saveAuthorEditor, setAuthorFilter, setAuthorSort, setAuthorTableOption, setAuthorView } from 'Store/Actions/authorIndexActions';
import { executeCommand } from 'Store/Actions/commandActions';
import scrollPositions from 'Store/scrollPositions';
import createAuthorClientSideCollectionItemsSelector from 'Store/Selectors/createAuthorClientSideCollectionItemsSelector';
@@ -18,16 +18,22 @@ function createMapStateToProps() {
createAuthorClientSideCollectionItemsSelector('authorIndex'),
createCommandExecutingSelector(commandNames.REFRESH_AUTHOR),
createCommandExecutingSelector(commandNames.RSS_SYNC),
createCommandExecutingSelector(commandNames.RENAME_AUTHOR),
createCommandExecutingSelector(commandNames.RETAG_AUTHOR),
createDimensionsSelector(),
(
author,
isRefreshingAuthor,
isOrganizingAuthor,
isRetaggingAuthor,
isRssSyncExecuting,
dimensionsState
) => {
return {
...author,
isRefreshingAuthor,
isOrganizingAuthor,
isRetaggingAuthor,
isRssSyncExecuting,
isSmallScreen: dimensionsState.isSmallScreen
};
@@ -53,9 +59,14 @@ function createMapDispatchToProps(dispatch, props) {
dispatch(setAuthorView({ view }));
},
onRefreshAuthorPress() {
dispatchSaveAuthorEditor(payload) {
dispatch(saveAuthorEditor(payload));
},
onRefreshAuthorPress(items) {
dispatch(executeCommand({
name: commandNames.REFRESH_AUTHOR
name: commandNames.BULK_REFRESH_AUTHOR,
authorIds: items
}));
},
@@ -76,6 +87,10 @@ class AuthorIndexConnector extends Component {
this.props.dispatchSetAuthorView(view);
}
onSaveSelected = (payload) => {
this.props.dispatchSaveAuthorEditor(payload);
}
onScroll = ({ scrollTop }) => {
scrollPositions.authorIndex = scrollTop;
}
@@ -89,6 +104,7 @@ class AuthorIndexConnector extends Component {
{...this.props}
onViewSelect={this.onViewSelect}
onScroll={this.onScroll}
onSaveSelected={this.onSaveSelected}
/>
);
}
@@ -97,7 +113,8 @@ class AuthorIndexConnector extends Component {
AuthorIndexConnector.propTypes = {
isSmallScreen: PropTypes.bool.isRequired,
view: PropTypes.string.isRequired,
dispatchSetAuthorView: PropTypes.func.isRequired
dispatchSetAuthorView: PropTypes.func.isRequired,
dispatchSaveAuthorEditor: PropTypes.func.isRequired
};
export default withScrollPosition(
@@ -19,6 +19,13 @@ $hoverScale: 1.05;
left: 0;
}
.editorSelect {
position: absolute;
top: 0;
left: 5px;
z-index: 3;
}
.posterContainer {
position: relative;
overflow: hidden;
@@ -5,6 +5,7 @@ import AuthorPoster from 'Author/AuthorPoster';
import DeleteAuthorModal from 'Author/Delete/DeleteAuthorModal';
import EditAuthorModalConnector from 'Author/Edit/EditAuthorModalConnector';
import AuthorIndexProgressBar from 'Author/Index/ProgressBar/AuthorIndexProgressBar';
import CheckInput from 'Components/Form/CheckInput';
import IconButton from 'Components/Link/IconButton';
import Link from 'Components/Link/Link';
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
@@ -67,6 +68,15 @@ class AuthorIndexOverview extends Component {
this.setState({ isDeleteAuthorModalOpen: false });
}
onChange = ({ value, shiftKey }) => {
const {
id,
onSelectedChange
} = this.props;
onSelectedChange({ id, value, shiftKey });
}
//
// Render
@@ -97,6 +107,8 @@ class AuthorIndexOverview extends Component {
isSearchingAuthor,
onRefreshAuthorPress,
onSearchPress,
isEditorActive,
isSelected,
...otherProps
} = this.props;
@@ -127,6 +139,18 @@ class AuthorIndexOverview extends Component {
<div className={styles.container}>
<div className={styles.content}>
<div className={styles.posterContainer}>
{
isEditorActive &&
<div className={styles.editorSelect}>
<CheckInput
className={styles.checkInput}
name={id.toString()}
value={isSelected}
onChange={this.onChange}
/>
</div>
}
{
status === 'ended' &&
<div
@@ -270,7 +294,10 @@ AuthorIndexOverview.propTypes = {
isRefreshingAuthor: PropTypes.bool.isRequired,
isSearchingAuthor: PropTypes.bool.isRequired,
onRefreshAuthorPress: PropTypes.func.isRequired,
onSearchPress: PropTypes.func.isRequired
onSearchPress: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired,
isSelected: PropTypes.bool,
onSelectedChange: PropTypes.func.isRequired
};
AuthorIndexOverview.defaultProps = {
@@ -73,7 +73,9 @@ class AuthorIndexOverviews extends Component {
sortKey,
overviewOptions,
jumpToCharacter,
scrollTop
scrollTop,
isEditorActive,
selectedState
} = this.props;
const {
@@ -91,6 +93,8 @@ class AuthorIndexOverviews extends Component {
(prevState.width !== width ||
prevState.rowHeight !== rowHeight ||
hasDifferentItemsOrOrder(prevProps.items, items) ||
prevProps.isEditorActive !== isEditorActive ||
prevProps.selectedState !== selectedState ||
prevProps.overviewOptions.showTitle !== overviewOptions.showTitle)) {
// recomputeGridSize also forces Grid to discard its cache of rendered cells
this._grid.recomputeGridSize();
@@ -148,7 +152,10 @@ class AuthorIndexOverviews extends Component {
shortDateFormat,
longDateFormat,
timeFormat,
isSmallScreen
isSmallScreen,
selectedState,
isEditorActive,
onSelectedChange
} = this.props;
const {
@@ -184,6 +191,9 @@ class AuthorIndexOverviews extends Component {
authorId={author.id}
qualityProfileId={author.qualityProfileId}
metadataProfileId={author.metadataProfileId}
isSelected={selectedState[author.id]}
onSelectedChange={onSelectedChange}
isEditorActive={isEditorActive}
/>
</div>
);
@@ -264,7 +274,10 @@ AuthorIndexOverviews.propTypes = {
shortDateFormat: PropTypes.string.isRequired,
longDateFormat: PropTypes.string.isRequired,
isSmallScreen: PropTypes.bool.isRequired,
timeFormat: PropTypes.string.isRequired
timeFormat: PropTypes.string.isRequired,
selectedState: PropTypes.object.isRequired,
onSelectedChange: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired
};
export default AuthorIndexOverviews;
@@ -78,6 +78,13 @@ $hoverScale: 1.05;
color: $white;
}
.editorSelect {
position: absolute;
top: 10px;
left: 10px;
z-index: 4;
}
.controls {
position: absolute;
bottom: 10px;
@@ -4,6 +4,7 @@ import AuthorPoster from 'Author/AuthorPoster';
import DeleteAuthorModal from 'Author/Delete/DeleteAuthorModal';
import EditAuthorModalConnector from 'Author/Edit/EditAuthorModalConnector';
import AuthorIndexProgressBar from 'Author/Index/ProgressBar/AuthorIndexProgressBar';
import CheckInput from 'Components/Form/CheckInput';
import Label from 'Components/Label';
import IconButton from 'Components/Link/IconButton';
import Link from 'Components/Link/Link';
@@ -63,6 +64,15 @@ class AuthorIndexPoster extends Component {
}
}
onChange = ({ value, shiftKey }) => {
const {
id,
onSelectedChange
} = this.props;
onSelectedChange({ id, value, shiftKey });
}
//
// Render
@@ -92,6 +102,9 @@ class AuthorIndexPoster extends Component {
isSearchingAuthor,
onRefreshAuthorPress,
onSearchPress,
isEditorActive,
isSelected,
onSelectedChange,
...otherProps
} = this.props;
@@ -120,6 +133,18 @@ class AuthorIndexPoster extends Component {
<div>
<div className={styles.content}>
<div className={styles.posterContainer}>
{
isEditorActive &&
<div className={styles.editorSelect}>
<CheckInput
className={styles.checkInput}
name={id.toString()}
value={isSelected}
onChange={this.onChange}
/>
</div>
}
<Label className={styles.controls}>
<SpinnerIconButton
className={styles.action}
@@ -282,7 +307,10 @@ AuthorIndexPoster.propTypes = {
isRefreshingAuthor: PropTypes.bool.isRequired,
isSearchingAuthor: PropTypes.bool.isRequired,
onRefreshAuthorPress: PropTypes.func.isRequired,
onSearchPress: PropTypes.func.isRequired
onSearchPress: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired,
isSelected: PropTypes.bool,
onSelectedChange: PropTypes.func.isRequired
};
AuthorIndexPoster.defaultProps = {
@@ -116,7 +116,9 @@ class AuthorIndexPosters extends Component {
posterOptions,
jumpToCharacter,
isSmallScreen,
scrollTop
isEditorActive,
scrollTop,
selectedState
} = this.props;
const {
@@ -138,6 +140,8 @@ class AuthorIndexPosters extends Component {
prevState.columnCount !== columnCount ||
prevState.rowHeight !== rowHeight ||
hasDifferentItemsOrOrder(prevProps.items, items)) ||
prevProps.isEditorActive !== isEditorActive ||
prevProps.selectedState !== selectedState ||
prevProps.posterOptions.showTitle !== posterOptions.showTitle) {
// recomputeGridSize also forces Grid to discard its cache of rendered cells
this._grid.recomputeGridSize();
@@ -198,7 +202,10 @@ class AuthorIndexPosters extends Component {
posterOptions,
showRelativeDates,
shortDateFormat,
timeFormat
timeFormat,
selectedState,
isEditorActive,
onSelectedChange
} = this.props;
const {
@@ -246,6 +253,9 @@ class AuthorIndexPosters extends Component {
authorId={author.id}
qualityProfileId={author.qualityProfileId}
metadataProfileId={author.metadataProfileId}
isSelected={selectedState[author.id]}
onSelectedChange={onSelectedChange}
isEditorActive={isEditorActive}
/>
</div>
);
@@ -328,7 +338,10 @@ AuthorIndexPosters.propTypes = {
showRelativeDates: PropTypes.bool.isRequired,
shortDateFormat: PropTypes.string.isRequired,
isSmallScreen: PropTypes.bool.isRequired,
timeFormat: PropTypes.string.isRequired
timeFormat: PropTypes.string.isRequired,
selectedState: PropTypes.object.isRequired,
onSelectedChange: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired
};
export default AuthorIndexPosters;
@@ -5,6 +5,7 @@ import IconButton from 'Components/Link/IconButton';
import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper';
import VirtualTableHeader from 'Components/Table/VirtualTableHeader';
import VirtualTableHeaderCell from 'Components/Table/VirtualTableHeaderCell';
import VirtualTableSelectAllHeaderCell from 'Components/Table/VirtualTableSelectAllHeaderCell';
import { icons } from 'Helpers/Props';
import AuthorIndexTableOptionsConnector from './AuthorIndexTableOptionsConnector';
import hasGrowableColumns from './hasGrowableColumns';
@@ -15,6 +16,10 @@ function AuthorIndexHeader(props) {
showBanners,
columns,
onTableOptionChange,
allSelected,
allUnselected,
onSelectAllChange,
isEditorActive,
...otherProps
} = props;
@@ -33,6 +38,21 @@ function AuthorIndexHeader(props) {
return null;
}
if (name === 'select') {
if (isEditorActive) {
return (
<VirtualTableSelectAllHeaderCell
key={name}
allSelected={allSelected}
allUnselected={allUnselected}
onSelectAllChange={onSelectAllChange}
/>
);
}
return null;
}
if (name === 'actions') {
return (
<VirtualTableHeaderCell
@@ -80,6 +100,10 @@ function AuthorIndexHeader(props) {
AuthorIndexHeader.propTypes = {
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
onTableOptionChange: PropTypes.func.isRequired,
allSelected: PropTypes.bool.isRequired,
allUnselected: PropTypes.bool.isRequired,
onSelectAllChange: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired,
showBanners: PropTypes.bool.isRequired
};
@@ -13,6 +13,7 @@ import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
import ProgressBar from 'Components/ProgressBar';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
import TagListConnector from 'Components/TagListConnector';
import { icons } from 'Helpers/Props';
import getProgressBarKind from 'Utilities/Author/getProgressBarKind';
@@ -101,8 +102,11 @@ class AuthorIndexRow extends Component {
columns,
isRefreshingAuthor,
isSearchingAuthor,
isEditorActive,
isSelected,
onRefreshAuthorPress,
onSearchPress
onSearchPress,
onSelectedChange
} = this.props;
const {
@@ -131,6 +135,19 @@ class AuthorIndexRow extends Component {
return null;
}
if (isEditorActive && name === 'select') {
return (
<VirtualTableSelectCell
inputClassName={styles.checkInput}
id={id}
key={name}
isSelected={isSelected}
isDisabled={false}
onSelectedChange={onSelectedChange}
/>
);
}
if (name === 'status') {
return (
<AuthorStatusCell
@@ -431,7 +448,10 @@ AuthorIndexRow.propTypes = {
isRefreshingAuthor: PropTypes.bool.isRequired,
isSearchingAuthor: PropTypes.bool.isRequired,
onRefreshAuthorPress: PropTypes.func.isRequired,
onSearchPress: PropTypes.func.isRequired
onSearchPress: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired,
isSelected: PropTypes.bool,
onSelectedChange: PropTypes.func.isRequired
};
AuthorIndexRow.defaultProps = {
@@ -48,6 +48,9 @@ class AuthorIndexTable extends Component {
const {
items,
columns,
selectedState,
onSelectedChange,
isEditorActive,
showBanners,
showTitle
} = this.props;
@@ -67,6 +70,9 @@ class AuthorIndexTable extends Component {
authorId={author.id}
qualityProfileId={author.qualityProfileId}
metadataProfileId={author.metadataProfileId}
isSelected={selectedState[author.id]}
onSelectedChange={onSelectedChange}
isEditorActive={isEditorActive}
showBanners={showBanners}
showTitle={showTitle}
/>
@@ -87,7 +93,12 @@ class AuthorIndexTable extends Component {
isSmallScreen,
onSortPress,
scroller,
scrollTop
scrollTop,
allSelected,
allUnselected,
onSelectAllChange,
isEditorActive,
selectedState
} = this.props;
return (
@@ -108,8 +119,13 @@ class AuthorIndexTable extends Component {
sortKey={sortKey}
sortDirection={sortDirection}
onSortPress={onSortPress}
allSelected={allSelected}
allUnselected={allUnselected}
onSelectAllChange={onSelectAllChange}
isEditorActive={isEditorActive}
/>
}
selectedState={selectedState}
columns={columns}
sortKey={sortKey}
sortDirection={sortDirection}
@@ -129,7 +145,13 @@ AuthorIndexTable.propTypes = {
scrollTop: PropTypes.number,
scroller: PropTypes.instanceOf(Element).isRequired,
isSmallScreen: PropTypes.bool.isRequired,
onSortPress: PropTypes.func.isRequired
onSortPress: PropTypes.func.isRequired,
allSelected: PropTypes.bool.isRequired,
allUnselected: PropTypes.bool.isRequired,
selectedState: PropTypes.object.isRequired,
onSelectedChange: PropTypes.func.isRequired,
onSelectAllChange: PropTypes.func.isRequired,
isEditorActive: PropTypes.bool.isRequired
};
export default AuthorIndexTable;