Skip to content

Commit

Permalink
Use alphabetic ordering when displaying a flattened list of eda entit…
Browse files Browse the repository at this point in the history
…ies (#1323)
  • Loading branch information
dmfalke authored Feb 6, 2025
1 parent 90471ab commit 57c08f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/libs/eda/src/lib/core/utils/study-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { keyBy } from 'lodash';
import { find } from '@veupathdb/wdk-client/lib/Utils/IterableUtils';
import { find, Seq } from '@veupathdb/wdk-client/lib/Utils/IterableUtils';
import {
CollectionVariableTreeNode,
MultiFilterVariable,
Expand All @@ -13,7 +13,9 @@ import {
import { preorder } from '@veupathdb/wdk-client/lib/Utils/TreeUtils';

export function entityTreeToArray(rootEntity: StudyEntity): StudyEntity[] {
return Array.from(preorder(rootEntity, (e) => e.children ?? []));
return Seq.from(preorder(rootEntity, (e) => e.children ?? []))
.orderBy((node) => node.displayName)
.toArray();
}

export interface EntityAndVariable {
Expand Down

0 comments on commit 57c08f5

Please sign in to comment.