mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Renames in Frontend
This commit is contained in:
@@ -10,11 +10,11 @@ import ModalBody from 'Components/Modal/ModalBody';
|
||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||
import Alert from 'Components/Alert';
|
||||
|
||||
function formatAlbumFiles(items, album) {
|
||||
function formatBookFiles(items, book) {
|
||||
|
||||
return (
|
||||
<div key={album.id}>
|
||||
<b> {album.title} </b>
|
||||
<div key={book.id}>
|
||||
<b> {book.title} </b>
|
||||
<ul>
|
||||
{
|
||||
_.sortBy(items, 'path').map((item) => {
|
||||
@@ -54,7 +54,7 @@ class ConfirmImportModalContent extends Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
albums,
|
||||
books,
|
||||
items,
|
||||
onConfirmImportPress,
|
||||
onModalClose,
|
||||
@@ -87,14 +87,14 @@ class ConfirmImportModalContent extends Component {
|
||||
!isFetching && isPopulated &&
|
||||
<div>
|
||||
<Alert>
|
||||
You already have files imported for the albums listed below. If you continue, the existing files <b>will be deleted</b> and the new files imported in their place.
|
||||
You already have files imported for the books listed below. If you continue, the existing files <b>will be deleted</b> and the new files imported in their place.
|
||||
|
||||
To avoid deleting existing files, press 'Cancel' and use the 'Combine with existing files' option.
|
||||
</Alert>
|
||||
|
||||
{ _.chain(items)
|
||||
.groupBy('bookId')
|
||||
.mapValues((value, key) => formatAlbumFiles(value, _.find(albums, (a) => a.id === parseInt(key))))
|
||||
.mapValues((value, key) => formatBookFiles(value, _.find(books, (a) => a.id === parseInt(key))))
|
||||
.values()
|
||||
.value() }
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@ class ConfirmImportModalContent extends Component {
|
||||
}
|
||||
|
||||
ConfirmImportModalContent.propTypes = {
|
||||
albums: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
books: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
isFetching: PropTypes.bool.isRequired,
|
||||
isPopulated: PropTypes.bool.isRequired,
|
||||
|
||||
@@ -2,22 +2,22 @@ import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { fetchInteractiveImportTrackFiles, clearInteractiveImportTrackFiles } from 'Store/Actions/interactiveImportActions';
|
||||
import { fetchInteractiveImportBookFiles, clearInteractiveImportBookFiles } from 'Store/Actions/interactiveImportActions';
|
||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||
import ConfirmImportModalContent from './ConfirmImportModalContent';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createClientSideCollectionSelector('interactiveImport.trackFiles'),
|
||||
(trackFiles) => {
|
||||
return trackFiles;
|
||||
createClientSideCollectionSelector('interactiveImport.bookFiles'),
|
||||
(bookFiles) => {
|
||||
return bookFiles;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
fetchInteractiveImportTrackFiles,
|
||||
clearInteractiveImportTrackFiles
|
||||
fetchInteractiveImportBookFiles,
|
||||
clearInteractiveImportBookFiles
|
||||
};
|
||||
|
||||
class ConfirmImportModalContentConnector extends Component {
|
||||
@@ -27,14 +27,14 @@ class ConfirmImportModalContentConnector extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
const {
|
||||
albums
|
||||
books
|
||||
} = this.props;
|
||||
|
||||
this.props.fetchInteractiveImportTrackFiles({ bookId: albums.map((x) => x.id) });
|
||||
this.props.fetchInteractiveImportBookFiles({ bookId: books.map((x) => x.id) });
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.clearInteractiveImportTrackFiles();
|
||||
this.props.clearInteractiveImportBookFiles();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -50,10 +50,10 @@ class ConfirmImportModalContentConnector extends Component {
|
||||
}
|
||||
|
||||
ConfirmImportModalContentConnector.propTypes = {
|
||||
albums: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
books: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
fetchInteractiveImportTrackFiles: PropTypes.func.isRequired,
|
||||
clearInteractiveImportTrackFiles: PropTypes.func.isRequired,
|
||||
fetchInteractiveImportBookFiles: PropTypes.func.isRequired,
|
||||
clearInteractiveImportBookFiles: PropTypes.func.isRequired,
|
||||
onModalClose: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user