From fd89e88d4097e444f4d472b100800f175b408937 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 26 Jul 2019 18:10:02 -0700 Subject: [PATCH] Fixed: Manage Episodes not showing whether language/quality meets cutoff --- .../EpisodeFileEditorModalContentConnector.js | 2 ++ .../EpisodeFile/Editor/EpisodeFileEditorRow.js | 13 ++++++++++--- frontend/src/Store/Actions/episodeFileActions.js | 15 ++++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/frontend/src/EpisodeFile/Editor/EpisodeFileEditorModalContentConnector.js b/frontend/src/EpisodeFile/Editor/EpisodeFileEditorModalContentConnector.js index e87ba6e0f..79c96d1c0 100644 --- a/frontend/src/EpisodeFile/Editor/EpisodeFileEditorModalContentConnector.js +++ b/frontend/src/EpisodeFile/Editor/EpisodeFileEditorModalContentConnector.js @@ -72,6 +72,8 @@ function createMapStateToProps() { relativePath: episodeFile.relativePath, language: episodeFile.language, quality: episodeFile.quality, + languageCutoffNotMet: episodeFile.languageCutoffNotMet, + qualityCutoffNotMet: episodeFile.qualityCutoffNotMet, ...episode }; }); diff --git a/frontend/src/EpisodeFile/Editor/EpisodeFileEditorRow.js b/frontend/src/EpisodeFile/Editor/EpisodeFileEditorRow.js index 62cedb8af..0e3119fc4 100644 --- a/frontend/src/EpisodeFile/Editor/EpisodeFileEditorRow.js +++ b/frontend/src/EpisodeFile/Editor/EpisodeFileEditorRow.js @@ -6,6 +6,7 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo import TableRow from 'Components/Table/TableRow'; import TableRowCell from 'Components/Table/Cells/TableRowCell'; import TableSelectCell from 'Components/Table/Cells/TableSelectCell'; +import EpisodeLanguage from 'Episode/EpisodeLanguage'; import EpisodeQuality from 'Episode/EpisodeQuality'; import styles from './EpisodeFileEditorRow'; @@ -20,6 +21,8 @@ function EpisodeFileEditorRow(props) { airDateUtc, language, quality, + qualityCutoffNotMet, + languageCutoffNotMet, isSelected, onSelectedChange } = props; @@ -52,14 +55,16 @@ function EpisodeFileEditorRow(props) { /> - + @@ -76,6 +81,8 @@ EpisodeFileEditorRow.propTypes = { airDateUtc: PropTypes.string.isRequired, language: PropTypes.object.isRequired, quality: PropTypes.object.isRequired, + qualityCutoffNotMet: PropTypes.bool.isRequired, + languageCutoffNotMet: PropTypes.bool.isRequired, isSelected: PropTypes.bool, onSelectedChange: PropTypes.func.isRequired }; diff --git a/frontend/src/Store/Actions/episodeFileActions.js b/frontend/src/Store/Actions/episodeFileActions.js index 3ab92fb0b..e4a0cc951 100644 --- a/frontend/src/Store/Actions/episodeFileActions.js +++ b/frontend/src/Store/Actions/episodeFileActions.js @@ -148,30 +148,35 @@ export const actionHandlers = handleThunks({ dispatch(set({ section, isSaving: true })); - const data = { + const requestData = { episodeFileIds }; if (language) { - data.language = language; + requestData.language = language; } if (quality) { - data.quality = quality; + requestData.quality = quality; } const promise = createAjaxRequest({ url: '/episodeFile/editor', method: 'PUT', dataType: 'json', - data: JSON.stringify(data) + data: JSON.stringify(requestData) }).request; - promise.done(() => { + promise.done((data) => { dispatch(batchActions([ ...episodeFileIds.map((id) => { const props = {}; + const episodeFile = data.find((file) => file.id === id); + + props.qualityCutoffNotMet = episodeFile.qualityCutoffNotMet; + props.languageCutoffNotMet = episodeFile.languageCutoffNotMet; + if (language) { props.language = language; }