mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-17 21:26:13 -04:00
Fixed: Banner not growing when most columns are hidden
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
flex: 0 0 379px;
|
||||
}
|
||||
|
||||
.bannerGrow {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.seriesType {
|
||||
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import IconButton from 'Components/Link/IconButton';
|
||||
import VirtualTableHeader from 'Components/Table/VirtualTableHeader';
|
||||
import VirtualTableHeaderCell from 'Components/Table/VirtualTableHeaderCell';
|
||||
import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper';
|
||||
import hasGrowableColumns from './hasGrowableColumns';
|
||||
import SeriesIndexTableOptionsConnector from './SeriesIndexTableOptionsConnector';
|
||||
import styles from './SeriesIndexHeader.css';
|
||||
|
||||
@@ -60,7 +61,8 @@ function SeriesIndexHeader(props) {
|
||||
key={name}
|
||||
className={classNames(
|
||||
styles[name],
|
||||
name === 'sortTitle' && showBanners && styles.banner
|
||||
name === 'sortTitle' && showBanners && styles.banner,
|
||||
name === 'sortTitle' && showBanners && !hasGrowableColumns(columns) && styles.bannerGrow
|
||||
)}
|
||||
name={name}
|
||||
isSortable={isSortable}
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
flex: 0 0 379px;
|
||||
}
|
||||
|
||||
.bannerGrow {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.link {
|
||||
composes: link from 'Components/Link/Link.css';
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import SeriesTitleLink from 'Series/SeriesTitleLink';
|
||||
import EditSeriesModalConnector from 'Series/Edit/EditSeriesModalConnector';
|
||||
import DeleteSeriesModal from 'Series/Delete/DeleteSeriesModal';
|
||||
import SeriesBanner from 'Series/SeriesBanner';
|
||||
import hasGrowableColumns from './hasGrowableColumns';
|
||||
import SeriesStatusCell from './SeriesStatusCell';
|
||||
import styles from './SeriesIndexRow.css';
|
||||
|
||||
@@ -154,7 +155,8 @@ class SeriesIndexRow extends Component {
|
||||
key={name}
|
||||
className={classNames(
|
||||
styles[name],
|
||||
showBanners && styles.banner
|
||||
showBanners && styles.banner,
|
||||
showBanners && !hasGrowableColumns(columns) && styles.bannerGrow
|
||||
)}
|
||||
>
|
||||
{
|
||||
@@ -307,8 +309,10 @@ class SeriesIndexRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
const seasonStatistics = latestSeason.statistics;
|
||||
const progress = seasonStatistics.episodeCount ? seasonStatistics.episodeFileCount / seasonStatistics.episodeCount * 100 : 100;
|
||||
const seasonStatistics = latestSeason.statistics || {};
|
||||
const progress = seasonStatistics.episodeCount ?
|
||||
seasonStatistics.episodeFileCount / seasonStatistics.episodeCount * 100 :
|
||||
100;
|
||||
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
|
||||
18
frontend/src/Series/Index/Table/hasGrowableColumns.js
Normal file
18
frontend/src/Series/Index/Table/hasGrowableColumns.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const growableColumns = [
|
||||
'network',
|
||||
'qualityProfileId',
|
||||
'languageProfileId',
|
||||
'path',
|
||||
'tags'
|
||||
];
|
||||
|
||||
export default function hasGrowableColumns(columns) {
|
||||
return columns.some((column) => {
|
||||
const {
|
||||
name,
|
||||
isVisible
|
||||
} = column;
|
||||
|
||||
return growableColumns.includes(name) && isVisible;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user