Skip to content

Commit 57c08f5

Browse files
authored
Use alphabetic ordering when displaying a flattened list of eda entities (#1323)
1 parent 90471ab commit 57c08f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/libs/eda/src/lib/core/utils/study-metadata.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { keyBy } from 'lodash';
2-
import { find } from '@veupathdb/wdk-client/lib/Utils/IterableUtils';
2+
import { find, Seq } from '@veupathdb/wdk-client/lib/Utils/IterableUtils';
33
import {
44
CollectionVariableTreeNode,
55
MultiFilterVariable,
@@ -13,7 +13,9 @@ import {
1313
import { preorder } from '@veupathdb/wdk-client/lib/Utils/TreeUtils';
1414

1515
export function entityTreeToArray(rootEntity: StudyEntity): StudyEntity[] {
16-
return Array.from(preorder(rootEntity, (e) => e.children ?? []));
16+
return Seq.from(preorder(rootEntity, (e) => e.children ?? []))
17+
.orderBy((node) => node.displayName)
18+
.toArray();
1719
}
1820

1921
export interface EntityAndVariable {

0 commit comments

Comments
 (0)