New: Upstream Updates

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick
2019-08-30 22:50:03 -04:00
parent bfc467dd96
commit 23670bca12
109 changed files with 1060 additions and 712 deletions

View File

@@ -6,6 +6,12 @@ import FormGroup from 'Components/Form/FormGroup';
import FormLabel from 'Components/Form/FormLabel';
import FormInputGroup from 'Components/Form/FormInputGroup';
const logLevelOptions = [
{ key: 'info', value: 'Info' },
{ key: 'debug', value: 'Debug' },
{ key: 'trace', value: 'Trace' }
];
function LoggingSettings(props) {
const {
settings,
@@ -16,12 +22,6 @@ function LoggingSettings(props) {
logLevel
} = settings;
const logLevelOptions = [
{ key: 'info', value: 'Info' },
{ key: 'debug', value: 'Debug' },
{ key: 'trace', value: 'Trace' }
];
return (
<FieldSet legend="Logging">
<FormGroup>

View File

@@ -12,6 +12,7 @@ import FormLabel from 'Components/Form/FormLabel';
import FormInputGroup from 'Components/Form/FormInputGroup';
import RootFoldersConnector from 'RootFolder/RootFoldersConnector';
import NamingConnector from './Naming/NamingConnector';
import AddRootFolderConnector from './RootFolder/AddRootFolderConnector';
const rescanAfterRefreshOptions = [
{ key: 'always', value: 'Always' },
@@ -135,6 +136,23 @@ class MediaManagement extends Component {
</FormGroup>
}
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
size={sizes.MEDIUM}
>
<FormLabel>Minimum Free Space</FormLabel>
<FormInputGroup
type={inputTypes.NUMBER}
unit='MB'
name="minimumFreeSpaceWhenImporting"
helpText="Prevent import if it would leave less than this amount of disk space available"
onChange={onInputChange}
{...settings.minimumFreeSpaceWhenImporting}
/>
</FormGroup>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
@@ -281,6 +299,23 @@ class MediaManagement extends Component {
{...settings.recycleBin}
/>
</FormGroup>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Recycling Bin Cleanup</FormLabel>
<FormInputGroup
type={inputTypes.NUMBER}
name="recycleBinCleanupDays"
helpText="Set to 0 to disable automatic cleanup"
helpTextWarning="Files in the recycle bin older than the selected number of days will be cleaned up automatically"
min={0}
onChange={onInputChange}
{...settings.recycleBinCleanupDays}
/>
</FormGroup>
</FieldSet>
{
@@ -374,6 +409,7 @@ class MediaManagement extends Component {
<FieldSet legend="Root Folders">
<RootFoldersConnector />
<AddRootFolderConnector />
</FieldSet>
</PageContentBodyConnector>
</PageContent>

View File

@@ -0,0 +1,7 @@
.addRootFolderButtonContainer {
margin-top: 20px;
}
.importButtonIcon {
margin-right: 8px;
}

View File

@@ -0,0 +1,71 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { icons, kinds, sizes } from 'Helpers/Props';
import Button from 'Components/Link/Button';
import Icon from 'Components/Icon';
import FileBrowserModal from 'Components/FileBrowser/FileBrowserModal';
import styles from './AddRootFolder.css';
class AddRootFolder extends Component {
//
// Lifecycle
constructor(props, context) {
super(props, context);
this.state = {
isAddNewRootFolderModalOpen: false
};
}
//
// Lifecycle
onAddNewRootFolderPress = () => {
this.setState({ isAddNewRootFolderModalOpen: true });
}
onNewRootFolderSelect = ({ value }) => {
this.props.onNewRootFolderSelect(value);
}
onAddRootFolderModalClose = () => {
this.setState({ isAddNewRootFolderModalOpen: false });
}
//
// Render
render() {
return (
<div className={styles.addRootFolderButtonContainer}>
<Button
kind={kinds.PRIMARY}
size={sizes.LARGE}
onPress={this.onAddNewRootFolderPress}
>
<Icon
className={styles.importButtonIcon}
name={icons.DRIVE}
/>
Add Root Folder
</Button>
<FileBrowserModal
isOpen={this.state.isAddNewRootFolderModalOpen}
name="rootFolderPath"
value=""
onChange={this.onNewRootFolderSelect}
onModalClose={this.onAddRootFolderModalClose}
/>
</div>
);
}
}
AddRootFolder.propTypes = {
onNewRootFolderSelect: PropTypes.func.isRequired
};
export default AddRootFolder;

View File

@@ -0,0 +1,13 @@
import { connect } from 'react-redux';
import AddRootFolder from './AddRootFolder';
import { addRootFolder } from 'Store/Actions/rootFolderActions';
function createMapDispatchToProps(dispatch) {
return {
onNewRootFolderSelect(path) {
dispatch(addRootFolder({ path }));
}
};
}
export default connect(null, createMapDispatchToProps)(AddRootFolder);

View File

@@ -238,7 +238,11 @@ class EditQualityProfileModalContent extends Component {
id ?
<div
className={styles.deleteButtonContainer}
title={isInUse ? 'Can\'t delete a quality profile that is attached to a movie' : undefined}
title={
isInUse ?
'Can\'t delete a quality profile that is attached to a movie' :
undefined
}
>
<Button
kind={kinds.DANGER}

View File

@@ -147,6 +147,7 @@ function TagDetailsModalContent(props) {
<Button
className={styles.deleteButton}
kind={kinds.DANGER}
title={isTagUsed ? 'Cannot be deleted while in use' : undefined}
isDisabled={isTagUsed}
onPress={onDeleteTagPress}
>

View File

@@ -1,11 +1,12 @@
.tag {
composes: card from '~Components/Card.css';
width: 150px;
flex: 150px 0 1;
}
.label {
margin-bottom: 20px;
white-space: nowrap;
font-weight: 300;
font-size: 24px;
}