New: Ability to test all Indexers, Lists, Clients

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick
2018-10-19 23:03:56 -04:00
parent 6103afcc09
commit 029a0e4e20
17 changed files with 304 additions and 48 deletions
@@ -3,12 +3,15 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { fetchHealth } from 'Store/Actions/systemActions';
import { testAllDownloadClients, testAllIndexers } from 'Store/Actions/settingsActions';
import Health from './Health';
function createMapStateToProps() {
return createSelector(
(state) => state.system.health,
(health) => {
(state) => state.settings.downloadClients.isTestingAll,
(state) => state.settings.indexers.isTestingAll,
(health, isTestingAllDownloadClients, isTestingAllIndexers) => {
const {
isFetching,
isPopulated,
@@ -18,14 +21,18 @@ function createMapStateToProps() {
return {
isFetching,
isPopulated,
items
items,
isTestingAllDownloadClients,
isTestingAllIndexers
};
}
);
}
const mapDispatchToProps = {
fetchHealth
dispatchFetchHealth: fetchHealth,
dispatchTestAllDownloadClients: testAllDownloadClients,
dispatchTestAllIndexers: testAllIndexers
};
class HealthConnector extends Component {
@@ -34,23 +41,28 @@ class HealthConnector extends Component {
// Lifecycle
componentDidMount() {
this.props.fetchHealth();
this.props.dispatchFetchHealth();
}
//
// Render
render() {
const {
dispatchFetchHealth,
...otherProps
} = this.props;
return (
<Health
{...this.props}
{...otherProps}
/>
);
}
}
HealthConnector.propTypes = {
fetchHealth: PropTypes.func.isRequired
dispatchFetchHealth: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(HealthConnector);