Fix an issue with the language on status labels for inCinemas and added translation to the movieStatus variable (#4986)

Fix issue where status text was not consistent across all 3 index views and the details
pull/4997/head
nitsua 4 years ago committed by GitHub
parent df96203914
commit 7019c8587b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,7 +25,7 @@ function getMovieStatus(hasFile, isMonitored, isAvailable, queueDetails = false)
return translate('Missing');
}
return translate('Unreleased');
return translate('NotAvailable');
}
function MovieStatusLabel(props) {

@ -92,6 +92,7 @@ class MovieIndexOverview extends Component {
overview,
monitored,
hasFile,
isAvailable,
status,
titleSlug,
images,
@ -169,6 +170,7 @@ class MovieIndexOverview extends Component {
<MovieIndexProgressBar
monitored={monitored}
hasFile={hasFile}
isAvailable={isAvailable}
status={status}
posterWidth={posterWidth}
detailedProgressBar={overviewOptions.detailedProgressBar}
@ -281,6 +283,7 @@ MovieIndexOverview.propTypes = {
overview: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -87,6 +87,7 @@ class MovieIndexPoster extends Component {
title,
monitored,
hasFile,
isAvailable,
status,
titleSlug,
images,
@ -228,6 +229,7 @@ class MovieIndexPoster extends Component {
detailedProgressBar={detailedProgressBar}
queueStatus={queueStatus}
queueState={queueState}
isAvailable={isAvailable}
/>
{
@ -282,6 +284,7 @@ MovieIndexPoster.propTypes = {
title: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -4,7 +4,6 @@ import ProgressBar from 'Components/ProgressBar';
import { sizes } from 'Helpers/Props';
import getProgressBarKind from 'Utilities/Movie/getProgressBarKind';
import getQueueStatusText from 'Utilities/Movie/getQueueStatusText';
import titleCase from 'Utilities/String/titleCase';
import translate from 'Utilities/String/translate';
import styles from './MovieIndexProgressBar.css';
@ -13,6 +12,7 @@ function MovieIndexProgressBar(props) {
monitored,
status,
hasFile,
isAvailable,
posterWidth,
detailedProgressBar,
queueStatus,
@ -24,21 +24,17 @@ function MovieIndexProgressBar(props) {
let movieStatus = (status === 'released' && hasFile) ? 'downloaded' : status;
if (movieStatus === 'deleted') {
movieStatus = 'announced';
movieStatus = 'Missing';
if (hasFile) {
movieStatus = 'downloaded';
} else {
movieStatus = 'released';
movieStatus = 'Downloaded';
}
}
if (movieStatus === 'announced') {
movieStatus = translate('NotAvailable');
}
if (movieStatus === 'released') {
movieStatus = translate('Missing');
} else if (hasFile) {
movieStatus = 'Downloaded';
} else if (isAvailable && !hasFile) {
movieStatus = 'Missing';
} else {
movieStatus = 'NotAvailable';
}
return (
@ -46,11 +42,11 @@ function MovieIndexProgressBar(props) {
className={styles.progressBar}
containerClassName={styles.progress}
progress={progress}
kind={getProgressBarKind(status, monitored, hasFile, queueStatusText)}
kind={getProgressBarKind(status, monitored, hasFile, isAvailable, queueStatusText)}
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
showText={detailedProgressBar}
width={posterWidth}
text={(queueStatusText) ? queueStatusText.shortText : titleCase(movieStatus)}
text={(queueStatusText) ? queueStatusText.shortText : translate(movieStatus)}
/>
);
}
@ -58,6 +54,7 @@ function MovieIndexProgressBar(props) {
MovieIndexProgressBar.propTypes = {
monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
posterWidth: PropTypes.number.isRequired,
detailedProgressBar: PropTypes.bool.isRequired,

@ -57,7 +57,7 @@ function MovieFileStatus(props) {
title={translate('NotMonitored')}
kind={kinds.WARNING}
>
Not Monitored
{translate('NotMonitored')}
</Label>
</div>
);
@ -70,7 +70,7 @@ function MovieFileStatus(props) {
title={translate('MovieAvailableButMissing')}
kind={kinds.DANGER}
>
Missing
{translate('Missing')}
</Label>
</div>
);
@ -82,7 +82,7 @@ function MovieFileStatus(props) {
title={translate('NotAvailable')}
kind={kinds.INFO}
>
Not Available
{translate('NotAvailable')}
</Label>
</div>
);

@ -1,14 +1,10 @@
import { kinds } from 'Helpers/Props';
function getProgressBarKind(status, monitored, hasFile, queue = false) {
function getProgressBarKind(status, monitored, hasFile, isAvailable, queue = false) {
if (queue) {
return kinds.QUEUE;
}
if (status === 'announced') {
return kinds.PRIMARY;
}
if (hasFile && monitored) {
return kinds.SUCCESS;
}
@ -17,11 +13,15 @@ function getProgressBarKind(status, monitored, hasFile, queue = false) {
return kinds.DEFAULT;
}
if (monitored) {
if (isAvailable) {
return kinds.DANGER;
}
return kinds.WARNING;
if (!monitored) {
return kinds.WARNING;
}
return kinds.PRIMARY;
}
export default getProgressBarKind;

Loading…
Cancel
Save