mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-22 22:34:53 -04:00
Cleanup unused frontend components
This commit is contained in:
@@ -11,10 +11,10 @@ import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
|
||||
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
|
||||
import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper';
|
||||
import { align, icons, sortDirections } from 'Helpers/Props';
|
||||
import AddIndexerModal from 'Indexer/Add/AddIndexerModal';
|
||||
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
||||
import IndexerEditorFooter from 'Indexer/Editor/IndexerEditorFooter.js';
|
||||
import NoIndexer from 'Indexer/NoIndexer';
|
||||
import AddIndexerModal from 'Settings/Indexers/Indexers/AddIndexerModal';
|
||||
import EditIndexerModalConnector from 'Settings/Indexers/Indexers/EditIndexerModalConnector';
|
||||
import * as keyCodes from 'Utilities/Constants/keyCodes';
|
||||
import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
||||
@@ -23,14 +23,14 @@ import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
||||
import selectAll from 'Utilities/Table/selectAll';
|
||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
||||
import IndexerIndexFooterConnector from './IndexerIndexFooterConnector';
|
||||
import MovieIndexFilterMenu from './Menus/MovieIndexFilterMenu';
|
||||
import MovieIndexSortMenu from './Menus/MovieIndexSortMenu';
|
||||
import MovieIndexTableConnector from './Table/MovieIndexTableConnector';
|
||||
import MovieIndexTableOptionsConnector from './Table/MovieIndexTableOptionsConnector';
|
||||
import IndexerIndexFilterMenu from './Menus/IndexerIndexFilterMenu';
|
||||
import IndexerIndexSortMenu from './Menus/IndexerIndexSortMenu';
|
||||
import IndexerIndexTableConnector from './Table/IndexerIndexTableConnector';
|
||||
import IndexerIndexTableOptionsConnector from './Table/IndexerIndexTableOptionsConnector';
|
||||
import styles from './IndexerIndex.css';
|
||||
|
||||
function getViewComponent() {
|
||||
return MovieIndexTableConnector;
|
||||
return IndexerIndexTableConnector;
|
||||
}
|
||||
|
||||
class IndexerIndex extends Component {
|
||||
@@ -354,7 +354,7 @@ class IndexerIndex extends Component {
|
||||
<TableOptionsModalWrapper
|
||||
{...otherProps}
|
||||
columns={columns}
|
||||
optionsComponent={MovieIndexTableOptionsConnector}
|
||||
optionsComponent={IndexerIndexTableOptionsConnector}
|
||||
>
|
||||
<PageToolbarButton
|
||||
label={translate('Options')}
|
||||
@@ -365,14 +365,14 @@ class IndexerIndex extends Component {
|
||||
|
||||
<PageToolbarSeparator />
|
||||
|
||||
<MovieIndexSortMenu
|
||||
<IndexerIndexSortMenu
|
||||
sortKey={sortKey}
|
||||
sortDirection={sortDirection}
|
||||
isDisabled={hasNoIndexer}
|
||||
onSortSelect={onSortSelect}
|
||||
/>
|
||||
|
||||
<MovieIndexFilterMenu
|
||||
<IndexerIndexFilterMenu
|
||||
selectedFilterKey={selectedFilterKey}
|
||||
filters={filters}
|
||||
customFilters={customFilters}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { setMovieFilter } from 'Store/Actions/indexerIndexActions';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.movies.items,
|
||||
(state) => state.indexers.items,
|
||||
(state) => state.indexerIndex.filterBuilderProps,
|
||||
(sectionItems, filterBuilderProps) => {
|
||||
return {
|
||||
+3
-3
@@ -53,7 +53,7 @@ const mapDispatchToProps = {
|
||||
dispatchExecuteCommand: executeCommand
|
||||
};
|
||||
|
||||
class MovieIndexItemConnector extends Component {
|
||||
class IndexerIndexItemConnector extends Component {
|
||||
|
||||
//
|
||||
// Render
|
||||
@@ -78,10 +78,10 @@ class MovieIndexItemConnector extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexItemConnector.propTypes = {
|
||||
IndexerIndexItemConnector.propTypes = {
|
||||
id: PropTypes.number,
|
||||
component: PropTypes.elementType.isRequired,
|
||||
dispatchExecuteCommand: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default connect(createMapStateToProps, mapDispatchToProps)(MovieIndexItemConnector);
|
||||
export default connect(createMapStateToProps, mapDispatchToProps)(IndexerIndexItemConnector);
|
||||
+6
-6
@@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import FilterMenu from 'Components/Menu/FilterMenu';
|
||||
import { align } from 'Helpers/Props';
|
||||
import MovieIndexFilterModalConnector from 'Indexer/Index/MovieIndexFilterModalConnector';
|
||||
import IndexerIndexFilterModalConnector from 'Indexer/Index/IndexerIndexFilterModalConnector';
|
||||
|
||||
function MovieIndexFilterMenu(props) {
|
||||
function IndexerIndexFilterMenu(props) {
|
||||
const {
|
||||
selectedFilterKey,
|
||||
filters,
|
||||
@@ -20,13 +20,13 @@ function MovieIndexFilterMenu(props) {
|
||||
selectedFilterKey={selectedFilterKey}
|
||||
filters={filters}
|
||||
customFilters={customFilters}
|
||||
filterModalConnectorComponent={MovieIndexFilterModalConnector}
|
||||
filterModalConnectorComponent={IndexerIndexFilterModalConnector}
|
||||
onFilterSelect={onFilterSelect}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
MovieIndexFilterMenu.propTypes = {
|
||||
IndexerIndexFilterMenu.propTypes = {
|
||||
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
@@ -34,8 +34,8 @@ MovieIndexFilterMenu.propTypes = {
|
||||
onFilterSelect: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
MovieIndexFilterMenu.defaultProps = {
|
||||
IndexerIndexFilterMenu.defaultProps = {
|
||||
showCustomFilters: false
|
||||
};
|
||||
|
||||
export default MovieIndexFilterMenu;
|
||||
export default IndexerIndexFilterMenu;
|
||||
+3
-3
@@ -6,7 +6,7 @@ import SortMenuItem from 'Components/Menu/SortMenuItem';
|
||||
import { align, sortDirections } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
function MovieIndexSortMenu(props) {
|
||||
function IndexerIndexSortMenu(props) {
|
||||
const {
|
||||
sortKey,
|
||||
sortDirection,
|
||||
@@ -78,11 +78,11 @@ function MovieIndexSortMenu(props) {
|
||||
);
|
||||
}
|
||||
|
||||
MovieIndexSortMenu.propTypes = {
|
||||
IndexerIndexSortMenu.propTypes = {
|
||||
sortKey: PropTypes.string,
|
||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
||||
isDisabled: PropTypes.bool.isRequired,
|
||||
onSortSelect: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexSortMenu;
|
||||
export default IndexerIndexSortMenu;
|
||||
@@ -1,52 +0,0 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import Menu from 'Components/Menu/Menu';
|
||||
import MenuContent from 'Components/Menu/MenuContent';
|
||||
import SearchMenuItem from 'Components/Menu/SearchMenuItem';
|
||||
import ToolbarMenuButton from 'Components/Menu/ToolbarMenuButton';
|
||||
import { align, icons } from 'Helpers/Props';
|
||||
|
||||
class MovieIndexSearchMenu extends Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
isDisabled,
|
||||
onSearchPress
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Menu
|
||||
isDisabled={isDisabled}
|
||||
alignMenu={align.RIGHT}
|
||||
>
|
||||
<ToolbarMenuButton
|
||||
iconName={icons.SEARCH}
|
||||
text="Search"
|
||||
isDisabled={isDisabled}
|
||||
/>
|
||||
<MenuContent>
|
||||
<SearchMenuItem
|
||||
name="missingMoviesSearch"
|
||||
onPress={onSearchPress}
|
||||
>
|
||||
Search Missing
|
||||
</SearchMenuItem>
|
||||
|
||||
<SearchMenuItem
|
||||
name="cutoffUnmetMoviesSearch"
|
||||
onPress={onSearchPress}
|
||||
>
|
||||
Search Cutoff Unmet
|
||||
</SearchMenuItem>
|
||||
</MenuContent>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexSearchMenu.propTypes = {
|
||||
isDisabled: PropTypes.bool.isRequired,
|
||||
onSearchPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexSearchMenu;
|
||||
+3
-3
@@ -8,7 +8,7 @@ import DeleteMovieModal from 'Indexer/Delete/DeleteMovieModal';
|
||||
import EditMovieModalConnector from 'Indexer/Edit/EditMovieModalConnector';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
class MovieIndexActionsCell extends Component {
|
||||
class IndexerIndexActionsCell extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
@@ -94,10 +94,10 @@ class MovieIndexActionsCell extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexActionsCell.propTypes = {
|
||||
IndexerIndexActionsCell.propTypes = {
|
||||
id: PropTypes.number.isRequired,
|
||||
isRefreshingMovie: PropTypes.bool.isRequired,
|
||||
onRefreshMoviePress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexActionsCell;
|
||||
export default IndexerIndexActionsCell;
|
||||
+6
-6
@@ -6,10 +6,10 @@ import VirtualTableHeader from 'Components/Table/VirtualTableHeader';
|
||||
import VirtualTableHeaderCell from 'Components/Table/VirtualTableHeaderCell';
|
||||
import VirtualTableSelectAllHeaderCell from 'Components/Table/VirtualTableSelectAllHeaderCell';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import MovieIndexTableOptionsConnector from './MovieIndexTableOptionsConnector';
|
||||
import styles from './MovieIndexHeader.css';
|
||||
import IndexerIndexTableOptionsConnector from './IndexerIndexTableOptionsConnector';
|
||||
import styles from './IndexerIndexHeader.css';
|
||||
|
||||
class MovieIndexHeader extends Component {
|
||||
class IndexerIndexHeader extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
@@ -111,7 +111,7 @@ class MovieIndexHeader extends Component {
|
||||
<TableOptionsModal
|
||||
isOpen={this.state.isTableOptionsModalOpen}
|
||||
columns={columns}
|
||||
optionsComponent={MovieIndexTableOptionsConnector}
|
||||
optionsComponent={IndexerIndexTableOptionsConnector}
|
||||
onTableOptionChange={onTableOptionChange}
|
||||
onModalClose={this.onTableOptionsModalClose}
|
||||
/>
|
||||
@@ -120,7 +120,7 @@ class MovieIndexHeader extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexHeader.propTypes = {
|
||||
IndexerIndexHeader.propTypes = {
|
||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
onTableOptionChange: PropTypes.func.isRequired,
|
||||
allSelected: PropTypes.bool.isRequired,
|
||||
@@ -129,4 +129,4 @@ MovieIndexHeader.propTypes = {
|
||||
isMovieEditorActive: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexHeader;
|
||||
export default IndexerIndexHeader;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { setMovieTableOption } from 'Store/Actions/indexerIndexActions';
|
||||
import MovieIndexHeader from './MovieIndexHeader';
|
||||
import IndexerIndexHeader from './IndexerIndexHeader';
|
||||
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
return {
|
||||
@@ -10,4 +10,4 @@ function createMapDispatchToProps(dispatch, props) {
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(undefined, createMapDispatchToProps)(MovieIndexHeader);
|
||||
export default connect(undefined, createMapDispatchToProps)(IndexerIndexHeader);
|
||||
@@ -8,7 +8,7 @@ import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCel
|
||||
import TagListConnector from 'Components/TagListConnector';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import DeleteIndexerModal from 'Indexer/Delete/DeleteIndexerModal';
|
||||
import EditIndexerModalConnector from 'Settings/Indexers/Indexers/EditIndexerModalConnector';
|
||||
import EditIndexerModalConnector from 'Indexer/Edit/EditIndexerModalConnector';
|
||||
import titleCase from 'Utilities/String/titleCase';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import CapabilitiesLabel from './CapabilitiesLabel';
|
||||
|
||||
+10
-13
@@ -3,13 +3,13 @@ import React, { Component } from 'react';
|
||||
import VirtualTable from 'Components/Table/VirtualTable';
|
||||
import VirtualTableRow from 'Components/Table/VirtualTableRow';
|
||||
import { sortDirections } from 'Helpers/Props';
|
||||
import MovieIndexItemConnector from 'Indexer/Index/MovieIndexItemConnector';
|
||||
import IndexerIndexItemConnector from 'Indexer/Index/IndexerIndexItemConnector';
|
||||
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
||||
import IndexerIndexHeaderConnector from './IndexerIndexHeaderConnector';
|
||||
import IndexerIndexRow from './IndexerIndexRow';
|
||||
import MovieIndexHeaderConnector from './MovieIndexHeaderConnector';
|
||||
import styles from './MovieIndexTable.css';
|
||||
import styles from './IndexerIndexTable.css';
|
||||
|
||||
class MovieIndexTable extends Component {
|
||||
class IndexerIndexTable extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
@@ -49,8 +49,7 @@ class MovieIndexTable extends Component {
|
||||
columns,
|
||||
selectedState,
|
||||
onSelectedChange,
|
||||
isMovieEditorActive,
|
||||
movieRuntimeFormat
|
||||
isMovieEditorActive
|
||||
} = this.props;
|
||||
|
||||
const movie = items[rowIndex];
|
||||
@@ -60,7 +59,7 @@ class MovieIndexTable extends Component {
|
||||
key={key}
|
||||
style={style}
|
||||
>
|
||||
<MovieIndexItemConnector
|
||||
<IndexerIndexItemConnector
|
||||
key={movie.id}
|
||||
component={IndexerIndexRow}
|
||||
columns={columns}
|
||||
@@ -68,7 +67,6 @@ class MovieIndexTable extends Component {
|
||||
isSelected={selectedState[movie.id]}
|
||||
onSelectedChange={onSelectedChange}
|
||||
isMovieEditorActive={isMovieEditorActive}
|
||||
movieRuntimeFormat={movieRuntimeFormat}
|
||||
/>
|
||||
</VirtualTableRow>
|
||||
);
|
||||
@@ -104,7 +102,7 @@ class MovieIndexTable extends Component {
|
||||
overscanRowCount={2}
|
||||
rowRenderer={this.rowRenderer}
|
||||
header={
|
||||
<MovieIndexHeaderConnector
|
||||
<IndexerIndexHeaderConnector
|
||||
columns={columns}
|
||||
sortKey={sortKey}
|
||||
sortDirection={sortDirection}
|
||||
@@ -122,7 +120,7 @@ class MovieIndexTable extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexTable.propTypes = {
|
||||
IndexerIndexTable.propTypes = {
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
sortKey: PropTypes.string,
|
||||
@@ -136,8 +134,7 @@ MovieIndexTable.propTypes = {
|
||||
selectedState: PropTypes.object.isRequired,
|
||||
onSelectedChange: PropTypes.func.isRequired,
|
||||
onSelectAllChange: PropTypes.func.isRequired,
|
||||
isMovieEditorActive: PropTypes.bool.isRequired,
|
||||
movieRuntimeFormat: PropTypes.string.isRequired
|
||||
isMovieEditorActive: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexTable;
|
||||
export default IndexerIndexTable;
|
||||
+4
-6
@@ -1,20 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { setMovieSort } from 'Store/Actions/indexerIndexActions';
|
||||
import MovieIndexTable from './MovieIndexTable';
|
||||
import IndexerIndexTable from './IndexerIndexTable';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.app.dimensions,
|
||||
(state) => state.indexerIndex.tableOptions,
|
||||
(state) => state.indexerIndex.columns,
|
||||
(state) => state.settings.ui.item.movieRuntimeFormat,
|
||||
(dimensions, tableOptions, columns, movieRuntimeFormat) => {
|
||||
(dimensions, tableOptions, columns) => {
|
||||
return {
|
||||
isSmallScreen: dimensions.isSmallScreen,
|
||||
showBanners: tableOptions.showBanners,
|
||||
columns,
|
||||
movieRuntimeFormat
|
||||
columns
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -28,4 +26,4 @@ function createMapDispatchToProps(dispatch, props) {
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(createMapStateToProps, createMapDispatchToProps)(MovieIndexTable);
|
||||
export default connect(createMapStateToProps, createMapDispatchToProps)(IndexerIndexTable);
|
||||
+3
-3
@@ -6,7 +6,7 @@ import FormLabel from 'Components/Form/FormLabel';
|
||||
import { inputTypes } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
class MovieIndexTableOptions extends Component {
|
||||
class IndexerIndexTableOptions extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
@@ -69,9 +69,9 @@ class MovieIndexTableOptions extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
MovieIndexTableOptions.propTypes = {
|
||||
IndexerIndexTableOptions.propTypes = {
|
||||
showSearchAction: PropTypes.bool.isRequired,
|
||||
onTableOptionChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default MovieIndexTableOptions;
|
||||
export default IndexerIndexTableOptions;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import MovieIndexTableOptions from './MovieIndexTableOptions';
|
||||
import IndexerIndexTableOptions from './IndexerIndexTableOptions';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
@@ -11,4 +11,4 @@ function createMapStateToProps() {
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(createMapStateToProps)(MovieIndexTableOptions);
|
||||
export default connect(createMapStateToProps)(IndexerIndexTableOptions);
|
||||
Reference in New Issue
Block a user