+
+ {
+ preferred.map((item) => {
+ const isPreferred = item.value >= 0;
+
+ return (
+
+ );
+ })
+ }
+
+
{
split(ignored).map((item) => {
@@ -111,28 +134,33 @@ class ReleaseProfile extends Component {
}
-
- {
- preferred.map((item) => {
- const isPreferred = item.value >= 0;
-
- return (
-
- );
- })
- }
-
-
+
+ {
+ !enabled &&
+
+ }
+
+ {
+ indexer &&
+
+ }
+
+
@@ -92,6 +94,7 @@ ReleaseProfiles.propTypes = {
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
+ indexerList: PropTypes.arrayOf(PropTypes.object).isRequired,
onConfirmDeleteReleaseProfile: PropTypes.func.isRequired
};
diff --git a/frontend/src/Settings/Profiles/Release/ReleaseProfilesConnector.js b/frontend/src/Settings/Profiles/Release/ReleaseProfilesConnector.js
index dd4b41171..3cca69efd 100644
--- a/frontend/src/Settings/Profiles/Release/ReleaseProfilesConnector.js
+++ b/frontend/src/Settings/Profiles/Release/ReleaseProfilesConnector.js
@@ -2,24 +2,28 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
-import { fetchReleaseProfiles, deleteReleaseProfile } from 'Store/Actions/settingsActions';
+import { fetchReleaseProfiles, deleteReleaseProfile, fetchIndexers } from 'Store/Actions/settingsActions';
import createTagsSelector from 'Store/Selectors/createTagsSelector';
import ReleaseProfiles from './ReleaseProfiles';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.releaseProfiles,
+ (state) => state.settings.indexers,
createTagsSelector(),
- (releaseProfiles, tagList) => {
+ (releaseProfiles, indexers, tagList) => {
return {
...releaseProfiles,
- tagList
+ tagList,
+ isIndexersPopulated: indexers.isPopulated,
+ indexerList: indexers.items
};
}
);
}
const mapDispatchToProps = {
+ fetchIndexers,
fetchReleaseProfiles,
deleteReleaseProfile
};
@@ -31,6 +35,9 @@ class ReleaseProfilesConnector extends Component {
componentDidMount() {
this.props.fetchReleaseProfiles();
+ if (!this.props.isIndexersPopulated) {
+ this.props.fetchIndexers();
+ }
}
//
@@ -54,8 +61,10 @@ class ReleaseProfilesConnector extends Component {
}
ReleaseProfilesConnector.propTypes = {
+ isIndexersPopulated: PropTypes.bool.isRequired,
fetchReleaseProfiles: PropTypes.func.isRequired,
- deleteReleaseProfile: PropTypes.func.isRequired
+ deleteReleaseProfile: PropTypes.func.isRequired,
+ fetchIndexers: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(ReleaseProfilesConnector);
diff --git a/frontend/src/Store/Selectors/createIndexerSelector.js b/frontend/src/Store/Selectors/createIndexerSelector.js
deleted file mode 100644
index f95eba24c..000000000
--- a/frontend/src/Store/Selectors/createIndexerSelector.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createSelector } from 'reselect';
-
-function createIndexerSelector() {
- return createSelector(
- (state, { indexerId }) => indexerId,
- (state) => state.settings.indexers.items,
- (indexerId, indexers) => {
- return indexers.find((profile) => {
- return profile.id === indexerId;
- });
- }
- );
-}
-
-export default createIndexerSelector;