From 647e444a079619e3bf7c16c5f2d00fe401cc6c24 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 1 Jan 2019 17:38:21 -0800 Subject: [PATCH] New: Add root folder to media management settings --- .../ImportSeriesRootFolderRowConnector.js | 48 ----------- .../SelectFolder/ImportSeriesSelectFolder.js | 58 +++----------- .../ImportSeriesSelectFolderConnector.js | 9 +-- .../RootFolderRow.css} | 0 .../RootFolderRow.js} | 10 +-- .../src/RootFolder/RootFolderRowConnector.js | 13 +++ frontend/src/RootFolder/RootFolders.js | 80 +++++++++++++++++++ .../src/RootFolder/RootFoldersConnector.js | 46 +++++++++++ .../MediaManagement/MediaManagement.js | 15 +++- frontend/src/Settings/Settings.js | 2 +- 10 files changed, 168 insertions(+), 113 deletions(-) delete mode 100644 frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRowConnector.js rename frontend/src/{AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRow.css => RootFolder/RootFolderRow.css} (100%) rename frontend/src/{AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRow.js => RootFolder/RootFolderRow.js} (86%) create mode 100644 frontend/src/RootFolder/RootFolderRowConnector.js create mode 100644 frontend/src/RootFolder/RootFolders.js create mode 100644 frontend/src/RootFolder/RootFoldersConnector.js diff --git a/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRowConnector.js b/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRowConnector.js deleted file mode 100644 index f0fb03921..000000000 --- a/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesRootFolderRowConnector.js +++ /dev/null @@ -1,48 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { connect } from 'react-redux'; -import { createSelector } from 'reselect'; -import { deleteRootFolder } from 'Store/Actions/rootFolderActions'; -import ImportSeriesRootFolderRow from './ImportSeriesRootFolderRow'; - -function createMapStateToProps() { - return createSelector( - () => { - return { - }; - } - ); -} - -const mapDispatchToProps = { - deleteRootFolder -}; - -class ImportSeriesRootFolderRowConnector extends Component { - - // - // Listeners - - onDeletePress = () => { - this.props.deleteRootFolder({ id: this.props.id }); - } - - // - // Render - - render() { - return ( - - ); - } -} - -ImportSeriesRootFolderRowConnector.propTypes = { - id: PropTypes.number.isRequired, - deleteRootFolder: PropTypes.func.isRequired -}; - -export default connect(createMapStateToProps, mapDispatchToProps)(ImportSeriesRootFolderRowConnector); diff --git a/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesSelectFolder.js b/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesSelectFolder.js index 13b9d5f6d..67df490ea 100644 --- a/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesSelectFolder.js +++ b/frontend/src/AddSeries/ImportSeries/SelectFolder/ImportSeriesSelectFolder.js @@ -2,39 +2,15 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { icons, kinds, sizes } from 'Helpers/Props'; import Button from 'Components/Link/Button'; -import FieldSet from 'Components/FieldSet'; import Icon from 'Components/Icon'; +import FieldSet from 'Components/FieldSet'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import FileBrowserModal from 'Components/FileBrowser/FileBrowserModal'; import PageContent from 'Components/Page/PageContent'; import PageContentBodyConnector from 'Components/Page/PageContentBodyConnector'; -import Table from 'Components/Table/Table'; -import TableBody from 'Components/Table/TableBody'; -import ImportSeriesRootFolderRowConnector from './ImportSeriesRootFolderRowConnector'; +import RootFolders from 'RootFolder/RootFolders'; import styles from './ImportSeriesSelectFolder.css'; -const rootFolderColumns = [ - { - name: 'path', - label: 'Path', - isVisible: true - }, - { - name: 'freeSpace', - label: 'Free Space', - isVisible: true - }, - { - name: 'unmappedFolders', - label: 'Unmapped Folders', - isVisible: true - }, - { - name: 'actions', - isVisible: true - } -]; - class ImportSeriesSelectFolder extends Component { // @@ -110,26 +86,13 @@ class ImportSeriesSelectFolder extends Component { { items.length > 0 ?
-
- - - { - items.map((rootFolder) => { - return ( - - ); - }) - } - -
+
+