Fixed: Banner not growing when most columns are hidden

This commit is contained in:
Mark McDowall 2019-02-07 18:43:43 -08:00
parent 2ce3cd4c2a
commit 551fa7fe10
5 changed files with 36 additions and 4 deletions

View File

@ -14,6 +14,10 @@
flex: 0 0 379px;
}
.bannerGrow {
flex-grow: 1;
}
.seriesType {
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';

View File

@ -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}

View File

@ -27,6 +27,10 @@
flex: 0 0 379px;
}
.bannerGrow {
flex-grow: 1;
}
.link {
composes: link from 'Components/Link/Link.css';

View File

@ -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

View 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;
});
}