fix: Display users alphabetically in board memberships popup (#1334)

This commit is contained in:
Miklós Márton
2025-09-08 23:14:34 +02:00
committed by GitHub
parent 2c716a53c9
commit 9a81c83f03
@@ -3,6 +3,7 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md * Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/ */
import orderBy from 'lodash/orderBy';
import React, { useEffect, useMemo } from 'react'; import React, { useEffect, useMemo } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -31,10 +32,13 @@ const PureBoardMembershipsStep = React.memo(
const filteredItems = useMemo( const filteredItems = useMemo(
() => () =>
items.filter( orderBy(
({ user }) => items.filter(
user.name.toLowerCase().includes(cleanSearch) || ({ user }) =>
(user.username && user.username.includes(cleanSearch)), user.name.toLowerCase().includes(cleanSearch) ||
(user.username && user.username.includes(cleanSearch)),
),
({ user }) => user.name.toLowerCase(),
), ),
[items, cleanSearch], [items, cleanSearch],
); );