Fixed ternary condition for country and format in AlbumReleaseSelect

pull/3818/head
Bogdan 1 year ago
parent 17b32dd076
commit b71ecc4370

@ -10,7 +10,7 @@ import ModalBody from 'Components/Modal/ModalBody';
import ModalContent from 'Components/Modal/ModalContent';
import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader';
import { inputTypes } from 'Helpers/Props';
import { inputTypes, sizes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
class EditAlbumModalContent extends Component {
@ -59,7 +59,7 @@ class EditAlbumModalContent extends Component {
<Form
{...otherProps}
>
<FormGroup>
<FormGroup size={sizes.MEDIUM}>
<FormLabel>
{translate('Monitored')}
</FormLabel>
@ -73,7 +73,7 @@ class EditAlbumModalContent extends Component {
/>
</FormGroup>
<FormGroup>
<FormGroup size={sizes.MEDIUM}>
<FormLabel>
{translate('AutomaticallySwitchRelease')}
</FormLabel>
@ -87,7 +87,7 @@ class EditAlbumModalContent extends Component {
/>
</FormGroup>
<FormGroup>
<FormGroup size={sizes.MEDIUM}>
<FormLabel>
{translate('Release')}
</FormLabel>

@ -13,13 +13,23 @@ function createMapStateToProps() {
(albumReleases) => {
const values = _.map(albumReleases.value, (albumRelease) => {
const {
foreignReleaseId,
title,
disambiguation,
mediumCount,
trackCount,
country,
format
} = albumRelease;
return {
key: albumRelease.foreignReleaseId,
value: `${albumRelease.title}` +
`${albumRelease.disambiguation ? ' (' : ''}${titleCase(albumRelease.disambiguation)}${albumRelease.disambiguation ? ')' : ''}` +
`, ${albumRelease.mediumCount} med, ${albumRelease.trackCount} tracks` +
`${albumRelease.country.length > 0 ? ', ' : ''}${shortenList(albumRelease.country)}` +
`${albumRelease.format ? ', [' : ''}${albumRelease.format}${albumRelease.format ? ']' : ''}`
key: foreignReleaseId,
value: `${title}` +
`${disambiguation ? ' (' : ''}${titleCase(disambiguation)}${disambiguation ? ')' : ''}` +
`, ${mediumCount} med, ${trackCount} tracks` +
`${country && country.length > 0 ? `, ${shortenList(country)}` : ''}` +
`${format ? `, [${format}]` : ''}`
};
});

Loading…
Cancel
Save