From a1927e1e0f88715637f07303b5f45cd038b9f327 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 29 Jul 2023 13:48:10 +0300 Subject: [PATCH] Sort indexers by name in search footer dropdown --- frontend/src/Components/Form/IndexersSelectInputConnector.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/Form/IndexersSelectInputConnector.js b/frontend/src/Components/Form/IndexersSelectInputConnector.js index f2bdf8810..a36650726 100644 --- a/frontend/src/Components/Form/IndexersSelectInputConnector.js +++ b/frontend/src/Components/Form/IndexersSelectInputConnector.js @@ -3,13 +3,15 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; +import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector'; +import sortByName from 'Utilities/Array/sortByName'; import titleCase from 'Utilities/String/titleCase'; import EnhancedSelectInput from './EnhancedSelectInput'; function createMapStateToProps() { return createSelector( (state, { value }) => value, - (state) => state.indexers, + createSortedSectionSelector('indexers', sortByName), (value, indexers) => { const values = []; const groupedIndexers = map(groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));