From 2e353773be22f8c83bd604424d4a464d069f4cbb Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 3 Nov 2024 14:01:15 -0800 Subject: [PATCH] New: Monitor New Seasons column for series list Closes #7311 --- frontend/src/Series/Index/Table/SeriesIndexRow.css | 6 ++++++ .../src/Series/Index/Table/SeriesIndexRow.css.d.ts | 1 + frontend/src/Series/Index/Table/SeriesIndexRow.tsx | 11 +++++++++++ .../src/Series/Index/Table/SeriesIndexTableHeader.css | 6 ++++++ .../Index/Table/SeriesIndexTableHeader.css.d.ts | 1 + frontend/src/Store/Actions/seriesIndexActions.js | 10 ++++++++++ 6 files changed, 35 insertions(+) diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.css b/frontend/src/Series/Index/Table/SeriesIndexRow.css index 1ad943161..7098911d6 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexRow.css +++ b/frontend/src/Series/Index/Table/SeriesIndexRow.css @@ -148,6 +148,12 @@ flex: 0 0 145px; } +.monitorNewItems { + composes: cell; + + flex: 0 0 175px; +} + .actions { composes: cell; diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.css.d.ts b/frontend/src/Series/Index/Table/SeriesIndexRow.css.d.ts index 0d507efd4..e07bb3cac 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexRow.css.d.ts +++ b/frontend/src/Series/Index/Table/SeriesIndexRow.css.d.ts @@ -14,6 +14,7 @@ interface CssExports { 'genres': string; 'latestSeason': string; 'link': string; + 'monitorNewItems': string; 'network': string; 'nextAiring': string; 'originalLanguage': string; diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.tsx b/frontend/src/Series/Index/Table/SeriesIndexRow.tsx index 0e6548535..727e5b4d0 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexRow.tsx +++ b/frontend/src/Series/Index/Table/SeriesIndexRow.tsx @@ -55,6 +55,7 @@ function SeriesIndexRow(props: SeriesIndexRowProps) { const { title, monitored, + monitorNewItems, status, path, titleSlug, @@ -450,6 +451,16 @@ function SeriesIndexRow(props: SeriesIndexRowProps) { ); } + if (name === 'monitorNewItems') { + return ( + + {monitorNewItems === 'all' + ? translate('SeasonsMonitoredAll') + : translate('SeasonsMonitoredNone')} + + ); + } + if (name === 'actions') { return ( diff --git a/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css b/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css index dc8a171c1..8e3b8f751 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css +++ b/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css @@ -109,6 +109,12 @@ flex: 0 0 145px; } +.monitorNewItems { + composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css'; + + flex: 0 0 175px; +} + .actions { composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css'; diff --git a/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css.d.ts b/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css.d.ts index 208fa4a20..5cff4a8ec 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css.d.ts +++ b/frontend/src/Series/Index/Table/SeriesIndexTableHeader.css.d.ts @@ -10,6 +10,7 @@ interface CssExports { 'episodeProgress': string; 'genres': string; 'latestSeason': string; + 'monitorNewItems': string; 'network': string; 'nextAiring': string; 'originalLanguage': string; diff --git a/frontend/src/Store/Actions/seriesIndexActions.js b/frontend/src/Store/Actions/seriesIndexActions.js index cc1d7c574..90451afc9 100644 --- a/frontend/src/Store/Actions/seriesIndexActions.js +++ b/frontend/src/Store/Actions/seriesIndexActions.js @@ -194,6 +194,12 @@ export const defaultState = { isSortable: true, isVisible: false }, + { + name: 'monitorNewItems', + label: () => translate('MonitorNewSeasons'), + isSortable: true, + isVisible: false + }, { name: 'actions', columnLabel: () => translate('Actions'), @@ -274,6 +280,10 @@ export const defaultState = { const { ratings = {} } = item; return ratings.value; + }, + + monitorNewItems: function(item) { + return item.monitorNewItems === 'all' ? 1 : 0; } },