Misc History Improvements

This commit is contained in:
Qstick
2020-10-23 01:09:34 -04:00
parent eca9b87571
commit 4b66d99029
32 changed files with 280 additions and 904 deletions
@@ -0,0 +1,9 @@
.status {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
width: 60px;
}
.statusIcon {
width: 20px !important;
}
@@ -0,0 +1,44 @@
import PropTypes from 'prop-types';
import React from 'react';
import Icon from 'Components/Icon';
import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell';
import { icons } from 'Helpers/Props';
import styles from './IndexerStatusCell.css';
function IndexerStatusCell(props) {
const {
className,
enabled,
component: Component,
...otherProps
} = props;
return (
<Component
className={className}
{...otherProps}
>
{
!enabled &&
<Icon
className={styles.statusIcon}
name={icons.BLACKLIST}
title={enabled ? 'Indexer is Enabled' : 'Indexer is Disabled'}
/>
}
</Component>
);
}
IndexerStatusCell.propTypes = {
className: PropTypes.string.isRequired,
enabled: PropTypes.bool.isRequired,
component: PropTypes.elementType
};
IndexerStatusCell.defaultProps = {
className: styles.status,
component: VirtualTableRowCell
};
export default IndexerStatusCell;
@@ -10,6 +10,7 @@
flex: 4 0 110px;
}
.priority,
.privacy,
.protocol {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
@@ -17,6 +17,7 @@
flex: 4 0 110px;
}
.priority,
.protocol,
.privacy {
composes: cell;
@@ -5,11 +5,14 @@ import IconButton from 'Components/Link/IconButton';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
import { icons, kinds } from 'Helpers/Props';
import TagListConnector from 'Components/TagListConnector';
import { icons } from 'Helpers/Props';
import DeleteIndexerModal from 'Indexer/Delete/DeleteIndexerModal';
import EditIndexerModalConnector from 'Settings/Indexers/Indexers/EditIndexerModalConnector';
import titleCase from 'Utilities/String/titleCase';
import translate from 'Utilities/String/translate';
import CapabilitiesLabel from './CapabilitiesLabel';
import IndexerStatusCell from './IndexerStatusCell';
import ProtocolLabel from './ProtocolLabel';
import styles from './MovieIndexRow.css';
@@ -61,8 +64,10 @@ class MovieIndexRow extends Component {
enableRss,
enableAutomaticSearch,
enableInteractiveSearch,
tags,
protocol,
privacy,
priority,
added,
capabilities,
columns,
@@ -103,28 +108,13 @@ class MovieIndexRow extends Component {
if (column.name === 'status') {
return (
<VirtualTableRowCell
<IndexerStatusCell
key={column.name}
className={styles[column.name]}
>
{
enableRss || enableAutomaticSearch || enableInteractiveSearch ?
<Label kind={kinds.SUCCESS}>
{'Enabled'}
</Label>:
null
}
{
!enableRss && !enableAutomaticSearch && !enableInteractiveSearch ?
<Label
kind={kinds.DISABLED}
outline={true}
>
{translate('Disabled')}
</Label> :
null
}
</VirtualTableRowCell>
enabled={enableRss || enableAutomaticSearch || enableInteractiveSearch}
status={status}
component={VirtualTableRowCell}
/>
);
}
@@ -146,12 +136,23 @@ class MovieIndexRow extends Component {
className={styles[column.name]}
>
<Label>
{privacy}
{titleCase(privacy)}
</Label>
</VirtualTableRowCell>
);
}
if (column.name === 'priority') {
return (
<VirtualTableRowCell
key={column.name}
className={styles[column.name]}
>
{priority}
</VirtualTableRowCell>
);
}
if (column.name === 'protocol') {
return (
<VirtualTableRowCell
@@ -189,6 +190,19 @@ class MovieIndexRow extends Component {
);
}
if (column.name === 'tags') {
return (
<VirtualTableRowCell
key={column.name}
className={styles[column.name]}
>
<TagListConnector
tags={tags}
/>
</VirtualTableRowCell>
);
}
if (column.name === 'actions') {
return (
<VirtualTableRowCell
@@ -234,6 +248,7 @@ MovieIndexRow.propTypes = {
id: PropTypes.number.isRequired,
protocol: PropTypes.string.isRequired,
privacy: PropTypes.string.isRequired,
priority: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
enableRss: PropTypes.bool.isRequired,
enableAutomaticSearch: PropTypes.bool.isRequired,
@@ -248,4 +263,8 @@ MovieIndexRow.propTypes = {
onSelectedChange: PropTypes.func.isRequired
};
MovieIndexRow.defaultProps = {
tags: []
};
export default MovieIndexRow;