Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

James/second tree dropdown #1795

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noting the possible options can vary depending on the server! Prompted me to review how auspice does it internally with findAvailableSecondTreeOptions and how nextstrain.org uses convertManifestJsonToAvailableDatasetList.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this whole area needs to be rethought at some stage -- the current hierarchical dropdown for changing datasets, the available second trees, how it relates to snapshots etc. There's some design work around but nothing concrete.



## version 2.55.1 - 2024/06/25


Expand Down
3 changes: 3 additions & 0 deletions src/components/controls/choose-second-tree.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code used .filter in a rather strange way!

git blame just out of bootcamp Jover from ~5 years ago 🙈

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I assumed it was me! Progress from each of us 😃

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