|
|
@ -1,18 +1,22 @@
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import ArtistMonitoringOptionsPopoverContent from 'AddArtist/ArtistMonitoringOptionsPopoverContent';
|
|
|
|
import Alert from 'Components/Alert';
|
|
|
|
import Alert from 'Components/Alert';
|
|
|
|
import Form from 'Components/Form/Form';
|
|
|
|
import Form from 'Components/Form/Form';
|
|
|
|
import FormGroup from 'Components/Form/FormGroup';
|
|
|
|
import FormGroup from 'Components/Form/FormGroup';
|
|
|
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
|
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
|
|
import FormLabel from 'Components/Form/FormLabel';
|
|
|
|
import FormLabel from 'Components/Form/FormLabel';
|
|
|
|
|
|
|
|
import Icon from 'Components/Icon';
|
|
|
|
import Button from 'Components/Link/Button';
|
|
|
|
import Button from 'Components/Link/Button';
|
|
|
|
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
|
|
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
|
|
import ModalBody from 'Components/Modal/ModalBody';
|
|
|
|
import ModalBody from 'Components/Modal/ModalBody';
|
|
|
|
import ModalContent from 'Components/Modal/ModalContent';
|
|
|
|
import ModalContent from 'Components/Modal/ModalContent';
|
|
|
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
|
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
|
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
|
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
|
|
import { inputTypes, kinds } from 'Helpers/Props';
|
|
|
|
import Popover from 'Components/Tooltip/Popover';
|
|
|
|
|
|
|
|
import { icons, inputTypes, kinds, tooltipPositions } from 'Helpers/Props';
|
|
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
|
|
|
|
import styles from './MonitoringOptionsModalContent.css';
|
|
|
|
|
|
|
|
|
|
|
|
const NO_CHANGE = 'noChange';
|
|
|
|
const NO_CHANGE = 'noChange';
|
|
|
|
|
|
|
|
|
|
|
@ -51,8 +55,7 @@ class MonitoringOptionsModalContent extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
onSavePress = () => {
|
|
|
|
onSavePress = () => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
onSavePress,
|
|
|
|
onSavePress
|
|
|
|
isSaving
|
|
|
|
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
monitor
|
|
|
|
monitor
|
|
|
@ -61,14 +64,6 @@ class MonitoringOptionsModalContent extends Component {
|
|
|
|
if (monitor !== NO_CHANGE) {
|
|
|
|
if (monitor !== NO_CHANGE) {
|
|
|
|
onSavePress({ monitor });
|
|
|
|
onSavePress({ monitor });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!isSaving) {
|
|
|
|
|
|
|
|
this.onModalClose();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onModalClose = () => {
|
|
|
|
|
|
|
|
this.props.onModalClose();
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -89,19 +84,31 @@ class MonitoringOptionsModalContent extends Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ModalContent onModalClose={onModalClose}>
|
|
|
|
<ModalContent onModalClose={onModalClose}>
|
|
|
|
<ModalHeader>
|
|
|
|
<ModalHeader>
|
|
|
|
{translate('MonitorAlbum')}
|
|
|
|
{translate('MonitorArtist')}
|
|
|
|
</ModalHeader>
|
|
|
|
</ModalHeader>
|
|
|
|
|
|
|
|
|
|
|
|
<ModalBody>
|
|
|
|
<ModalBody>
|
|
|
|
<Alert kind={kinds.INFO}>
|
|
|
|
<Alert kind={kinds.INFO} className={styles.message}>
|
|
|
|
<div>
|
|
|
|
{translate('MonitorAlbumExistingOnlyWarning')}
|
|
|
|
{translate('MonitorAlbumExistingOnlyWarning')}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Alert>
|
|
|
|
</Alert>
|
|
|
|
|
|
|
|
|
|
|
|
<Form {...otherProps}>
|
|
|
|
<Form {...otherProps}>
|
|
|
|
<FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<FormLabel>{translate('Monitoring')}</FormLabel>
|
|
|
|
<FormLabel>
|
|
|
|
|
|
|
|
{translate('MonitorExistingAlbums')}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
|
|
anchor={
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
className={styles.labelIcon}
|
|
|
|
|
|
|
|
name={icons.INFO}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
title={translate('MonitoringOptions')}
|
|
|
|
|
|
|
|
body={<ArtistMonitoringOptionsPopoverContent />}
|
|
|
|
|
|
|
|
position={tooltipPositions.RIGHT}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</FormLabel>
|
|
|
|
|
|
|
|
|
|
|
|
<FormInputGroup
|
|
|
|
<FormInputGroup
|
|
|
|
type={inputTypes.MONITOR_ALBUMS_SELECT}
|
|
|
|
type={inputTypes.MONITOR_ALBUMS_SELECT}
|
|
|
@ -134,7 +141,7 @@ class MonitoringOptionsModalContent extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MonitoringOptionsModalContent.propTypes = {
|
|
|
|
MonitoringOptionsModalContent.propTypes = {
|
|
|
|
authorId: PropTypes.number.isRequired,
|
|
|
|
artistId: PropTypes.number.isRequired,
|
|
|
|
saveError: PropTypes.object,
|
|
|
|
saveError: PropTypes.object,
|
|
|
|
isSaving: PropTypes.bool.isRequired,
|
|
|
|
isSaving: PropTypes.bool.isRequired,
|
|
|
|
onInputChange: PropTypes.func.isRequired,
|
|
|
|
onInputChange: PropTypes.func.isRequired,
|
|
|
|