Skip to content

Commit

Permalink
Merge pull request #1681 from nextstrain/fix-blank-metadata
Browse files Browse the repository at this point in the history
download: use the `node.shell.inView` property
  • Loading branch information
jameshadfield authored Aug 20, 2023
2 parents 84485a1 + 8304cdf commit 337c28e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/download/downloadButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Button({name, description, icon, onClick}) {

function getNumUniqueAuthors(nodes, nodeVisibilities) {
const authors = new Set(nodes
.filter((n, i) => nodeVisibilities[i] === NODE_VISIBLE && n.inView)
.filter((n, i) => nodeVisibilities[i] === NODE_VISIBLE && n.shell.inView)
.map((n) => getFullAuthorInfoFromNode(n))
.filter((a) => a && a.value)
.map((a) => a.value)
Expand Down
8 changes: 4 additions & 4 deletions src/components/download/helperFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const treeToNewick = (tree, temporal, internalNodeNames=false, nodeAnnotation=()
const getXVal = temporal ? (n) => getTraitFromNode(n, "num_date") : getDivFromNode;

function recurse(node, parentX) {
if (!node.inView || tree.visibility[node.arrayIdx]!==NODE_VISIBLE) {
if (!node.shell.inView || tree.visibility[node.arrayIdx]!==NODE_VISIBLE) {
return "";
}
if (node.hasChildren) {
Expand Down Expand Up @@ -176,7 +176,7 @@ export const authorTSV = (dispatch, filePrefix, tree) => {
const UNKNOWN = "unknown";
const info = {};
tree.nodes
.filter((n, i) => tree.visibility[i] === NODE_VISIBLE && n.inView)
.filter((n, i) => tree.visibility[i] === NODE_VISIBLE && n.shell.inView)
.filter((n) => !n.hasChildren).forEach((n) => {
const author = getFullAuthorInfoFromNode(n);
if (!author) return;
Expand Down Expand Up @@ -221,7 +221,7 @@ export const strainTSV = (dispatch, filePrefix, nodes, nodeVisibilities) => {
for (const [i, node] of nodes.entries()) {
if (node.hasChildren) continue; /* we only consider tips */

if (nodeVisibilities[i] !== NODE_VISIBLE || !node.inView) {
if (nodeVisibilities[i] !== NODE_VISIBLE || !node.shell.inView) {
continue;
}

Expand Down Expand Up @@ -313,7 +313,7 @@ export const acknowledgmentsTSV = (dispatch, filePrefix, nodes, nodeVisibilities
for (const [i, node] of nodes.entries()) {
if (node.hasChildren) continue; /* we only consider tips */

if (nodeVisibilities[i] !== NODE_VISIBLE || !node.inView) {
if (nodeVisibilities[i] !== NODE_VISIBLE || !node.shell.inView) {
continue;
}

Expand Down

0 comments on commit 337c28e

Please sign in to comment.