Most linting fixes completed

This commit is contained in:
Robin Dadswell
2021-01-17 23:45:44 +00:00
committed by nitsua
parent 1d922f3ce6
commit da2bc75eab
18 changed files with 82 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { removeFromBlacklist } from 'Store/Actions/blacklistActions';
import { removeBlacklistItem } from 'Store/Actions/blacklistActions';
import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
import BlacklistRow from './BlacklistRow';

View File

@@ -24,6 +24,8 @@ import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
import Popover from 'Components/Tooltip/Popover';
import Tooltip from 'Components/Tooltip/Tooltip';
import { align, icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
import InteractiveSearchFilterMenuConnector from 'InteractiveSearch/InteractiveSearchFilterMenuConnector';
import InteractiveSearchTable from 'InteractiveSearch/InteractiveSearchTable';
import OrganizePreviewModalConnector from 'Organize/OrganizePreviewModalConnector';
import RetagPreviewModalConnector from 'Retag/RetagPreviewModalConnector';
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';

View File

@@ -9,7 +9,6 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import { kinds, sizes } from 'Helpers/Props';
import formatTimeSpan from 'Utilities/Date/formatTimeSpan';
import styles from './BookRow.css';
function getBookCountKind(monitored, bookFileCount, bookCount) {

View File

@@ -55,7 +55,7 @@ class AuthorEditorConnector extends Component {
}
onTableOptionChange = (payload) => {
this.props.dispatchSetArtistEditorTableOption(payload);
this.props.dispatchSetAuthorEditorTableOption(payload);
}
onSaveSelected = (payload) => {
@@ -85,7 +85,7 @@ class AuthorEditorConnector extends Component {
}
}
ArtistEditorConnector.propTypes = {
AuthorEditorConnector.propTypes = {
dispatchSetAuthorEditorSort: PropTypes.func.isRequired,
dispatchSetAuthorEditorFilter: PropTypes.func.isRequired,
dispatchSetAuthorEditorTableOption: PropTypes.func.isRequired,

View File

@@ -147,6 +147,7 @@ class AuthorEditorFooter extends Component {
monitored,
qualityProfileId,
metadataProfileId,
bookFolder,
rootFolderPath,
savingTags,
isTagsModalOpen,
@@ -161,6 +162,12 @@ class AuthorEditorFooter extends Component {
{ key: 'unmonitored', value: 'Unmonitored' }
];
const bookFolderOptions = [
{ key: NO_CHANGE, value: 'No Change', disabled: true },
{ key: 'yes', value: 'Yes' },
{ key: 'no', value: 'No' }
];
return (
<PageContentFooter>
<div className={styles.inputContainer}>

View File

@@ -27,9 +27,10 @@ class AuthorEditorRow extends Component {
const {
id,
status,
titleSlug,
foreignAuthorId,
authorName,
authorType,
bookFolder,
monitored,
metadataProfile,
qualityProfile,
@@ -37,7 +38,9 @@ class AuthorEditorRow extends Component {
statistics,
tags,
columns,
isSaving,
isSelected,
onAuthorMonitoredPress,
onSelectedChange
} = this.props;
@@ -79,7 +82,7 @@ class AuthorEditorRow extends Component {
key={name}
className={styles.title}
>
<ArtistNameLink
<AuthorNameLink
foreignAuthorId={foreignAuthorId}
authorName={authorName}
/>
@@ -156,9 +159,11 @@ class AuthorEditorRow extends Component {
AuthorEditorRow.propTypes = {
id: PropTypes.number.isRequired,
status: PropTypes.string.isRequired,
foreignAuthorId: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
authorName: PropTypes.string.isRequired,
authorType: PropTypes.string,
bookFolder: PropTypes.string,
monitored: PropTypes.bool.isRequired,
metadataProfile: PropTypes.object.isRequired,
qualityProfile: PropTypes.object.isRequired,
@@ -166,7 +171,9 @@ AuthorEditorRow.propTypes = {
statistics: PropTypes.object.isRequired,
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
isSaving: PropTypes.bool.isRequired,
isSelected: PropTypes.bool,
onAuthorMonitoredPress: PropTypes.func.isRequired,
onSelectedChange: PropTypes.func.isRequired
};

View File

@@ -152,6 +152,10 @@ class AuthorIndexPosters extends Component {
});
}
}
if (this._grid && scrollTop !== 0) {
this._grid.scrollToPosition({ scrollTop });
}
}
//
@@ -316,6 +320,7 @@ AuthorIndexPosters.propTypes = {
sortKey: PropTypes.string,
posterOptions: PropTypes.object.isRequired,
jumpToCharacter: PropTypes.string,
scrollTop: PropTypes.number.isRequired,
scroller: PropTypes.instanceOf(Element).isRequired,
showRelativeDates: PropTypes.bool.isRequired,
shortDateFormat: PropTypes.string.isRequired,

View File

@@ -4,7 +4,6 @@ import BookQuality from 'Book/BookQuality';
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
import TableRow from 'Components/Table/TableRow';
import padNumber from 'Utilities/Number/padNumber';
function BookFileEditorRow(props) {
const {

View File

@@ -19,7 +19,6 @@ import NumberInput from './NumberInput';
import OAuthInputConnector from './OAuthInputConnector';
import PasswordInput from './PasswordInput';
import PathInputConnector from './PathInputConnector';
import PlaylistInputConnector from './PlaylistInputConnector';
import QualityProfileSelectInputConnector from './QualityProfileSelectInputConnector';
import RootFolderSelectInputConnector from './RootFolderSelectInputConnector';
import SeriesTypeSelectInput from './SeriesTypeSelectInput';

View File

@@ -9,6 +9,7 @@ import styles from './ToolbarMenuButton.css';
function ToolbarMenuButton(props) {
const {
iconName,
indicator,
text,
...otherProps
} = props;
@@ -24,6 +25,21 @@ function ToolbarMenuButton(props) {
size={21}
/>
{
indicator &&
<span
className={classNames(
styles.indicatorContainer,
'fa-layers fa-fw'
)}
>
<Icon
name={icons.CIRCLE}
size={9}
/>
</span>
}
<div className={styles.labelContainer}>
<div className={styles.label}>
{text}
@@ -36,7 +52,8 @@ function ToolbarMenuButton(props) {
ToolbarMenuButton.propTypes = {
iconName: PropTypes.object.isRequired,
text: PropTypes.string
text: PropTypes.string,
indicator: PropTypes.bool.isRequired
};
export default ToolbarMenuButton;

View File

@@ -9,6 +9,14 @@ import styles from './PageContentBody.css';
class PageContentBody extends Component {
//
// Lifecyle
constructor(props, context) {
super(props, context);
this._isMobile = isMobileUtil();
}
//
// Listeners
@@ -27,13 +35,12 @@ class PageContentBody extends Component {
const {
className,
innerClassName,
isSmallScreen,
children,
dispatch,
...otherProps
} = this.props;
const ScrollerComponent = isSmallScreen ? Scroller : OverlayScroller;
const ScrollerComponent = this._isMobile ? Scroller : OverlayScroller;
return (
<ScrollerComponent
@@ -53,7 +60,6 @@ class PageContentBody extends Component {
PageContentBody.propTypes = {
className: PropTypes.string,
innerClassName: PropTypes.string,
isSmallScreen: PropTypes.bool.isRequired,
children: PropTypes.node.isRequired,
onScroll: PropTypes.func,
dispatch: PropTypes.func

View File

@@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import BookQuality from 'Book/BookQuality';
import Icon from 'Components/Icon';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRowCellButton from 'Components/Table/Cells/TableRowCellButton';
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
@@ -14,7 +13,6 @@ import SelectAuthorModal from 'InteractiveImport/Author/SelectAuthorModal';
import SelectBookModal from 'InteractiveImport/Book/SelectBookModal';
import SelectQualityModal from 'InteractiveImport/Quality/SelectQualityModal';
import formatBytes from 'Utilities/Number/formatBytes';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import InteractiveImportRowCellPlaceholder from './InteractiveImportRowCellPlaceholder';
import styles from './InteractiveImportRow.css';
@@ -274,6 +272,7 @@ class InteractiveImportRow extends Component {
isOpen={isSelectBookModalOpen}
ids={[id]}
authorId={author && author.id}
sortDirection={sortDirections.ASCENDING}
onModalClose={this.onSelectBookModalClose}
/>

View File

@@ -90,16 +90,33 @@ function InteractiveSearch(props) {
error,
totalReleasesCount,
items,
selectedFilterKey,
filters,
customFilters,
sortKey,
sortDirection,
type,
longDateFormat,
timeFormat,
onSortPress,
onFilterSelect,
onGrabPress
} = props;
return (
<div>
<div className={styles.filterMenuContainer}>
<FilterMenu
alignMenu={align.RIGHT}
selectedFilterKey={selectedFilterKey}
filters={filters}
customFilters={customFilters}
buttonComponent={PageMenuButton}
filterModalConnectorComponent={InteractiveSearchFilterModalConnector}
filterModalConnectorComponentProps={{ type }}
onFilterSelect={onFilterSelect}
/>
</div>
{
isFetching ? <LoadingIndicator /> : null
}
@@ -174,12 +191,16 @@ InteractiveSearch.propTypes = {
error: PropTypes.object,
totalReleasesCount: PropTypes.number.isRequired,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
sortKey: PropTypes.string,
sortDirection: PropTypes.string,
type: PropTypes.string.isRequired,
longDateFormat: PropTypes.string.isRequired,
timeFormat: PropTypes.string.isRequired,
onSortPress: PropTypes.func.isRequired,
onFilterSelect: PropTypes.func.isRequired,
onGrabPress: PropTypes.func.isRequired
};

View File

@@ -12,9 +12,6 @@ import ModalContent from 'Components/Modal/ModalContent';
import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader';
import { inputTypes, kinds } from 'Helpers/Props';
import PrimaryTypeItems from './PrimaryTypeItems';
import ReleaseStatusItems from './ReleaseStatusItems';
import SecondaryTypeItems from './SecondaryTypeItems';
import styles from './EditMetadataProfileModalContent.css';
function EditMetadataProfileModalContent(props) {

View File

@@ -9,7 +9,7 @@ function findMatchingItems(ids, items) {
});
}
function createMatchingAuthorSelector() {
function createUnorderedMatchingAuthorSelector() {
return createSelector(
(state, { authorIds }) => authorIds,
createAllAuthorSelector(),
@@ -17,13 +17,13 @@ function createMatchingAuthorSelector() {
);
}
function createMatchingArtistSelector() {
function createMatchingAuthorSelector() {
return createSelector(
createUnorderedMatchingArtistSelector(),
(artists) => {
return artists.sort((artistA, artistB) => {
const sortNameA = artistA.sortName;
const sortNameB = artistB.sortName;
createUnorderedMatchingAuthorSelector(),
(authors) => {
return authors.sort((authorA, authorB) => {
const sortNameA = authorA.sortName;
const sortNameB = authorB.sortName;
if (sortNameA > sortNameB) {
return 1;

View File

@@ -10,7 +10,6 @@ import PageContent from 'Components/Page/PageContent';
import PageContentBody from 'Components/Page/PageContentBody';
import { inputTypes } from 'Helpers/Props';
import SettingsToolbarConnector from 'Settings/SettingsToolbarConnector';
import styles from './UISettings.css';
export const firstDayOfWeekOptions = [
{ key: 0, value: 'Sunday' },

View File

@@ -1,6 +1,3 @@
import * as albums from './albumActions';
import * as albumHistory from './albumHistoryActions';
import * as albumStudio from './albumStudioActions';
import * as app from './appActions';
import * as author from './authorActions';
import * as authorEditor from './authorEditorActions';

View File

@@ -5,7 +5,6 @@ import createFetchHandler from './Creators/createFetchHandler';
import createHandleActions from './Creators/createHandleActions';
import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer';
import createSetSettingValueReducer from './Creators/Reducers/createSetSettingValueReducer';
import createSetTableOptionReducer from './Creators/Reducers/createSetTableOptionReducer';
//
// Variables
@@ -105,7 +104,6 @@ export const SET_SERIES_VALUE = 'albums/setAlbumValue';
export const fetchSeries = createThunk(FETCH_SERIES);
export const setSeriesSort = createAction(SET_SERIES_SORT);
export const setSeriesTableOption = createAction(SET_SERIES_TABLE_OPTION);
export const clearSeries = createAction(CLEAR_SERIES);
//
@@ -122,8 +120,6 @@ export const reducers = createHandleActions({
[SET_SERIES_SORT]: createSetClientSideCollectionSortReducer(section),
[SET_SERIES_TABLE_OPTION]: createSetTableOptionReducer(section),
[SET_SERIES_VALUE]: createSetSettingValueReducer(section),
[CLEAR_SERIES]: (state) => {