New: (UI) Show indexer id as hint in IndexerSelect

pull/1787/head
Bogdan 1 year ago
parent a5d83459e9
commit a26aa4bd1e

@ -37,7 +37,7 @@ function HintedSelectInputOption(props) {
{ {
hint != null && hint != null &&
<div className={styles.hintText}> <div className={styles.hintText} title={hint}>
{hint} {hint}
</div> </div>
} }

@ -1,4 +1,4 @@
import _ from 'lodash'; import { groupBy, map } from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
@ -12,7 +12,7 @@ function createMapStateToProps() {
(state) => state.indexers, (state) => state.indexers,
(value, indexers) => { (value, indexers) => {
const values = []; const values = [];
const groupedIndexers = _.map(_.groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val })); const groupedIndexers = map(groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));
groupedIndexers.forEach((element) => { groupedIndexers.forEach((element) => {
values.push({ values.push({
@ -25,6 +25,7 @@ function createMapStateToProps() {
values.push({ values.push({
key: indexer.id, key: indexer.id,
value: indexer.name, value: indexer.name,
hint: `(${indexer.id})`,
isDisabled: !indexer.enable, isDisabled: !indexer.enable,
parentKey: element.protocol === 'usenet' ? -1 : -2 parentKey: element.protocol === 'usenet' ? -1 : -2
}); });
@ -50,7 +51,6 @@ class IndexersSelectInputConnector extends Component {
// Render // Render
render() { render() {
return ( return (
<EnhancedSelectInput <EnhancedSelectInput
{...this.props} {...this.props}

Loading…
Cancel
Save