From 8ca2c1aaab866b4807bb6c5a2ca5bf2ce256cfe4 Mon Sep 17 00:00:00 2001 From: jrmartin Date: Mon, 25 Sep 2023 07:58:21 -0700 Subject: [PATCH] Fixing bugs with datasets not showing --- src/components/DatasetsListViewer/DatasetsListDialog.js | 2 +- src/components/NodeDetailView/NodeDetailView.js | 2 +- src/components/Sidebar/TreeView/InstancesTreeView.js | 2 +- src/utils/Splinter.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/DatasetsListViewer/DatasetsListDialog.js b/src/components/DatasetsListViewer/DatasetsListDialog.js index bfd7dcb..b63ef04 100644 --- a/src/components/DatasetsListViewer/DatasetsListDialog.js +++ b/src/components/DatasetsListViewer/DatasetsListDialog.js @@ -30,6 +30,7 @@ const DatasetsListDialog = (props) => { const dispatch = useDispatch(); const { open, handleClose } = props; const [searchField, setSearchField] = React.useState(""); + const [selectedIndex, setSelectedIndex] = React.useState(undefined); const datasets = useSelector((state) => state.sdsState.available_datasets); const [filteredDatasets, setFilteredDatasets] = React.useState(datasets); const PUBLISHED = "PUBLISHED"; @@ -37,7 +38,6 @@ const DatasetsListDialog = (props) => { let turtle_url = ""; let json_url = ""; let splinter = undefined; - let selectedIndex = selectedIndex; const handleListItemClick = (event, index) => { setSelectedIndex(index); }; diff --git a/src/components/NodeDetailView/NodeDetailView.js b/src/components/NodeDetailView/NodeDetailView.js index b8f135e..1791097 100644 --- a/src/components/NodeDetailView/NodeDetailView.js +++ b/src/components/NodeDetailView/NodeDetailView.js @@ -22,7 +22,7 @@ const NodeDetailView = (props) => { } }; var path = [] - if (nodeSelected.tree_node !== undefined && nodeSelected.tree_node !== null) { + if (nodeSelected.tree_node.path !== undefined && nodeSelected.tree_node !== null) { path = [...nodeSelected.tree_node.path] path.shift(); otherDetails = path.reverse().map( singleNode => { diff --git a/src/components/Sidebar/TreeView/InstancesTreeView.js b/src/components/Sidebar/TreeView/InstancesTreeView.js index 6ccfed4..48bb1bc 100644 --- a/src/components/Sidebar/TreeView/InstancesTreeView.js +++ b/src/components/Sidebar/TreeView/InstancesTreeView.js @@ -25,7 +25,7 @@ const InstancesTreeView = (props) => { dispatch(selectInstance({ dataset_id: dataset_id, graph_node: node?.graph_reference?.id, - tree_node: node.id, + tree_node: node?.id, source: TREE_SOURCE })); if (widgets[dataset_id] !== undefined) { diff --git a/src/utils/Splinter.js b/src/utils/Splinter.js index 2203ac6..087f0cf 100644 --- a/src/utils/Splinter.js +++ b/src/utils/Splinter.js @@ -941,7 +941,7 @@ class Splinter { var children = this.tree_parents_map.get(tree_root?.remote_id); this.tree_parents_map?.delete(tree_root?.remote_id); this.tree = this.generateLeaf(tree_root); - children.forEach(leaf => { + children?.forEach(leaf => { this.build_leaf(leaf, this.tree); });