Skip to content

Commit

Permalink
[second tree control] show only when available
Browse files Browse the repository at this point in the history
Don't display the sidebar UI if we're just going to display an empty
dropdown!

See <https://bedfordlab.slack.com/archives/C0K3GS3J8/p1719424903252149>
for context
  • Loading branch information
jameshadfield committed Jun 27, 2024
1 parent 5f94111 commit e626f99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

* We no longer show the "second tree" sidebar dropdown when there are no available options. The possible options are defined by [the charon/getAvailable API](https://docs.nextstrain.org/projects/auspice/en/stable/server/api.html) response and as such vary depending on the server in use. ([#1795](https://github.com/nextstrain/auspice/pull/1795))


## version 2.55.1 - 2024/06/25


Expand Down
3 changes: 3 additions & 0 deletions src/components/controls/choose-second-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ChooseSecondTree extends React.Component {
.filter((opt) => !!opt) // .secondTreeOptions is not required
)]

// Don't display the sidebar UI if we're just going to display an empty dropdown!
if (!options.length) return null;

if (this.props.showTreeToo) options.unshift("REMOVE");

const selectOptions = options.map((opt) => ({value: opt, label: opt}));
Expand Down

0 comments on commit e626f99

Please sign in to comment.