mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
029a0e4e20
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
import React, { Component, Fragment } from 'react';
|
|
import { icons } from 'Helpers/Props';
|
|
import PageContent from 'Components/Page/PageContent';
|
|
import PageContentBodyConnector from 'Components/Page/PageContentBodyConnector';
|
|
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
|
|
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
|
|
import SettingsToolbarConnector from 'Settings/SettingsToolbarConnector';
|
|
import ImportListsConnector from './ImportLists/ImportListsConnector';
|
|
|
|
class ImportListSettings extends Component {
|
|
|
|
//
|
|
// Lifecycle
|
|
|
|
constructor(props, context) {
|
|
super(props, context);
|
|
|
|
this.state = {
|
|
hasPendingChanges: false
|
|
};
|
|
}
|
|
|
|
//
|
|
// Listeners
|
|
|
|
setListOptionsRef = (ref) => {
|
|
this._listOptions = ref;
|
|
}
|
|
|
|
onHasPendingChange = (hasPendingChanges) => {
|
|
this.setState({
|
|
hasPendingChanges
|
|
});
|
|
}
|
|
|
|
onSavePress = () => {
|
|
this._listOptions.getWrappedInstance().save();
|
|
}
|
|
|
|
//
|
|
// Render
|
|
|
|
render() {
|
|
const {
|
|
isTestingAll,
|
|
dispatchTestAllImportLists
|
|
} = this.props;
|
|
|
|
const {
|
|
isSaving,
|
|
hasPendingChanges
|
|
} = this.state;
|
|
|
|
return (
|
|
<PageContent title="Import List Settings">
|
|
<SettingsToolbarConnector
|
|
isSaving={isSaving}
|
|
hasPendingChanges={hasPendingChanges}
|
|
additionalButtons={
|
|
<Fragment>
|
|
<PageToolbarSeparator />
|
|
|
|
<PageToolbarButton
|
|
label="Test All Lists"
|
|
iconName={icons.TEST}
|
|
isSpinning={isTestingAll}
|
|
onPress={dispatchTestAllImportLists}
|
|
/>
|
|
</Fragment>
|
|
}
|
|
onSavePress={this.onSavePress}
|
|
/>
|
|
|
|
<PageContentBodyConnector>
|
|
<ImportListsConnector />
|
|
</PageContentBodyConnector>
|
|
</PageContent>
|
|
);
|
|
}
|
|
}
|
|
|
|
ImportListSettings.propTypes = {
|
|
isTestingAll: PropTypes.bool.isRequired,
|
|
dispatchTestAllImportLists: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default ImportListSettings;
|