UI Updates (Cancel Import, Move Artist, Manual Import from Artist)

Ability to cancel an import lookup/search at any point.
Ability to move artist path from Artist Edit or bulk move from Mass Editor.
Trigger manual import for Artist path from Artist Detail page.
Pulled from Sonarr
This commit is contained in:
Qstick 2017-12-29 22:23:04 -05:00
parent 5fae202760
commit d8c89f5bbd
79 changed files with 1075 additions and 376 deletions

View file

@ -109,8 +109,17 @@ class Modal extends Component {
}
onBackdropEndPress = (event) => {
if (this._isBackdropPressed && this._isBackdropTarget(event)) {
this.props.onModalClose();
const {
closeOnBackgroundClick,
onModalClose
} = this.props;
if (
this._isBackdropPressed &&
this._isBackdropTarget(event) &&
closeOnBackgroundClick
) {
onModalClose();
}
this._isBackdropPressed = false;
@ -187,13 +196,15 @@ Modal.propTypes = {
size: PropTypes.oneOf(sizes.all),
children: PropTypes.node,
isOpen: PropTypes.bool.isRequired,
closeOnBackgroundClick: PropTypes.bool.isRequired,
onModalClose: PropTypes.func.isRequired
};
Modal.defaultProps = {
className: styles.modal,
backdropClassName: styles.modalBackdrop,
size: sizes.LARGE
size: sizes.LARGE,
closeOnBackgroundClick: true
};
export default Modal;

View file

@ -9,6 +9,7 @@ function ModalContent(props) {
const {
className,
children,
showCloseButton,
onModalClose,
...otherProps
} = props;
@ -18,15 +19,18 @@ function ModalContent(props) {
className={className}
{...otherProps}
>
<Link
className={styles.closeButton}
onPress={onModalClose}
>
<Icon
name={icons.CLOSE}
size={18}
/>
</Link>
{
showCloseButton &&
<Link
className={styles.closeButton}
onPress={onModalClose}
>
<Icon
name={icons.CLOSE}
size={18}
/>
</Link>
}
{children}
</div>
@ -36,11 +40,13 @@ function ModalContent(props) {
ModalContent.propTypes = {
className: PropTypes.string,
children: PropTypes.node,
showCloseButton: PropTypes.bool.isRequired,
onModalClose: PropTypes.func.isRequired
};
ModalContent.defaultProps = {
className: styles.modalContent
className: styles.modalContent,
showCloseButton: true
};
export default ModalContent;