mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Simplify categories in History Table
This commit is contained in:
@@ -4,30 +4,22 @@
|
|||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.elapsedTime,
|
||||||
.indexer {
|
.indexer {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.categories,
|
||||||
|
.source,
|
||||||
|
.date,
|
||||||
.releaseGroup {
|
.releaseGroup {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
width: 110px;
|
width: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.categories {
|
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
|
||||||
|
|
||||||
width: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.source {
|
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
|
||||||
|
|
||||||
width: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details {
|
.details {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo
|
|||||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||||
import TableRow from 'Components/Table/TableRow';
|
import TableRow from 'Components/Table/TableRow';
|
||||||
import { icons } from 'Helpers/Props';
|
import { icons } from 'Helpers/Props';
|
||||||
|
import CapabilitiesLabel from 'Indexer/Index/Table/CapabilitiesLabel';
|
||||||
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
||||||
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
||||||
import HistoryRowParameter from './HistoryRowParameter';
|
import HistoryRowParameter from './HistoryRowParameter';
|
||||||
@@ -254,7 +255,10 @@ class HistoryRow extends Component {
|
|||||||
>
|
>
|
||||||
{
|
{
|
||||||
data.categories ?
|
data.categories ?
|
||||||
data.categories :
|
<CapabilitiesLabel
|
||||||
|
capabilities={indexer.capabilities}
|
||||||
|
categoryFilter={data.categories.split(',').map(Number)}
|
||||||
|
/> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
@@ -291,7 +295,7 @@ class HistoryRow extends Component {
|
|||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
key={name}
|
key={name}
|
||||||
className={styles.indexer}
|
className={styles.elapsedTime}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
data.elapsedTime ?
|
data.elapsedTime ?
|
||||||
@@ -307,6 +311,7 @@ class HistoryRow extends Component {
|
|||||||
<RelativeDateCellConnector
|
<RelativeDateCellConnector
|
||||||
key={name}
|
key={name}
|
||||||
date={date}
|
date={date}
|
||||||
|
className={styles.date}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
.info {
|
.info {
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
|
@@ -3,16 +3,26 @@ import React from 'react';
|
|||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
|
|
||||||
function CapabilitiesLabel(props) {
|
function CapabilitiesLabel(props) {
|
||||||
|
const {
|
||||||
|
categoryFilter
|
||||||
|
} = props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
categories
|
categories
|
||||||
} = props.capabilities;
|
} = props.capabilities;
|
||||||
|
|
||||||
const filteredList = categories.filter((item) => item.id < 100000).map((item) => item.name).sort();
|
let filteredList = categories.filter((item) => item.id < 100000);
|
||||||
|
|
||||||
|
if (categoryFilter.length > 0) {
|
||||||
|
filteredList = filteredList.filter((item) => categoryFilter.includes(item.id));
|
||||||
|
}
|
||||||
|
|
||||||
|
const nameList = filteredList.map((item) => item.name).sort();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{
|
{
|
||||||
filteredList.map((category) => {
|
nameList.map((category) => {
|
||||||
return (
|
return (
|
||||||
<Label key={category}>
|
<Label key={category}>
|
||||||
{category}
|
{category}
|
||||||
@@ -33,13 +43,15 @@ function CapabilitiesLabel(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CapabilitiesLabel.propTypes = {
|
CapabilitiesLabel.propTypes = {
|
||||||
capabilities: PropTypes.object.isRequired
|
capabilities: PropTypes.object.isRequired,
|
||||||
|
categoryFilter: PropTypes.arrayOf(PropTypes.number).isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
CapabilitiesLabel.defaultProps = {
|
CapabilitiesLabel.defaultProps = {
|
||||||
capabilities: {
|
capabilities: {
|
||||||
categories: []
|
categories: []
|
||||||
}
|
},
|
||||||
|
categoryFilter: []
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CapabilitiesLabel;
|
export default CapabilitiesLabel;
|
||||||
|
Reference in New Issue
Block a user