From 26a216ce4696d491f7366b896b6733767647a58a Mon Sep 17 00:00:00 2001 From: Michael Baudis Date: Fri, 2 Aug 2024 10:00:25 +0200 Subject: [PATCH] tree labels fix --- .../classificationTree/SubsetsTree.js | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/classificationTree/SubsetsTree.js b/src/components/classificationTree/SubsetsTree.js index 299e04e..6019808 100644 --- a/src/components/classificationTree/SubsetsTree.js +++ b/src/components/classificationTree/SubsetsTree.js @@ -6,7 +6,7 @@ import { FaAngleDown, FaAngleRight } from "react-icons/fa" import Tippy from "@tippyjs/react" import { FixedSizeTree as VTree } from "react-vtree" import useDebounce from "../../hooks/debounce" -import { min } from "lodash" +// import { min } from "lodash" import { filterNode } from "./tree" const ROW_HEIGHT = 30 @@ -86,7 +86,7 @@ export function SubsetsTree({ )} {checkedSubsets.map((subset) => (
  • - {subset.label} ({subset.count}) + {subset.label ? subset.label : subset.id} ({subset.count})
  • ))} @@ -179,7 +179,7 @@ function Node({ style, setOpen }) { - const isSearchPossible = subset && canSearch(subset) + const isSearchPossible = true // subset && canSearch(subset) const even = index % 2 === 0 const detailsPage = "subset" return ( @@ -221,17 +221,21 @@ function Node({ )} - + <> {(subset?.label && ( - {subset.label} + + {subset.label}: {subsetId} - )) ||  } - + )) + || + + + {subsetId}: {subsetId} + + } + - : {subsetId} {isSearchPossible ? ( hp.depth)) - : 999 - return minDepth >= 2 -} +// function canSearch(subset) { +// // Only necessary for NCIT +// if (!subset.id.includes("NCIT:")) return true +// const minDepth = subset.hierarchyPaths +// ? min(subset.hierarchyPaths?.map((hp) => hp.depth)) +// : 999 +// return minDepth >= 2 +// }