File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
packages/libs/eda/src/lib/core
components/variableSelectors Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { ClearSelectionButton } from './VariableTreeDropdown';
1414import { VariableLinkConfig } from '../VariableLink' ;
1515import { useHistory } from 'react-router' ;
1616import { useMemo } from 'react' ;
17+ import { orderBy } from 'lodash' ;
1718
1819export interface VariableTreeProps {
1920 starredVariables ?: VariableDescriptor [ ] ;
@@ -44,7 +45,7 @@ export default function VariableTree({
4445 scope,
4546 asDropdown,
4647} : VariableTreeProps ) {
47- const entities = useStudyEntities ( ) ;
48+ const entities = orderBy ( useStudyEntities ( ) , 'displayName' ) ;
4849 const valuesMap = useValuesMap ( entities ) ;
4950 const flattenedFields = useFlattenedFields ( entities , scope ) ;
5051 const fieldsByTerm = useFlattenFieldsByTerm ( flattenedFields ) ;
Original file line number Diff line number Diff line change @@ -13,9 +13,7 @@ import {
1313import { preorder } from '@veupathdb/wdk-client/lib/Utils/TreeUtils' ;
1414
1515export function entityTreeToArray ( rootEntity : StudyEntity ) : StudyEntity [ ] {
16- return Seq . from ( preorder ( rootEntity , ( e ) => e . children ?? [ ] ) )
17- . orderBy ( ( node ) => node . displayName )
18- . toArray ( ) ;
16+ return Array . from ( preorder ( rootEntity , ( e ) => e . children ?? [ ] ) ) ;
1917}
2018
2119export interface EntityAndVariable {
You can’t perform that action at this time.
0 commit comments