From f7a3df2be700201f3ff38bb281cc5282c17e40cb Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Fri, 1 Mar 2024 17:18:36 +0100 Subject: [PATCH] wip --- apps/nar-v3/src/components/DatasetCard.jsx | 3 ++ apps/nar-v3/src/components/DatasetList.jsx | 22 ++++++++----- .../components/PatchClampRecordingList.jsx | 25 ++++++++------- apps/nar-v3/src/routes/dataset.jsx | 32 ++++++++++++++++--- apps/nar-v3/src/routes/datasets.jsx | 4 +-- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/apps/nar-v3/src/components/DatasetCard.jsx b/apps/nar-v3/src/components/DatasetCard.jsx index dde08c1..782203d 100644 --- a/apps/nar-v3/src/components/DatasetCard.jsx +++ b/apps/nar-v3/src/components/DatasetCard.jsx @@ -363,6 +363,9 @@ function DatasetCard(props) { } }; + console.log("Rendering dataset in DatasetCard.jsx"); + console.log(dataset); + return (

{dataset.fullName}

diff --git a/apps/nar-v3/src/components/DatasetList.jsx b/apps/nar-v3/src/components/DatasetList.jsx index 4250d1d..c948b7c 100644 --- a/apps/nar-v3/src/components/DatasetList.jsx +++ b/apps/nar-v3/src/components/DatasetList.jsx @@ -1,13 +1,19 @@ +import { Link as RouterLink } from "react-router-dom"; - +import { uuidFromUri } from "../utility"; function DatasetList(props) { - - return ; + return ( + + ); } -export default DatasetList; \ No newline at end of file +export default DatasetList; diff --git a/apps/nar-v3/src/components/PatchClampRecordingList.jsx b/apps/nar-v3/src/components/PatchClampRecordingList.jsx index d1e823c..9864ecc 100644 --- a/apps/nar-v3/src/components/PatchClampRecordingList.jsx +++ b/apps/nar-v3/src/components/PatchClampRecordingList.jsx @@ -1,19 +1,22 @@ - import { Link as RouterLink } from "react-router-dom"; - function uuidFromUri(uri) { - const parts = uri.split("/"); - return parts[parts.length - 1]; + const parts = uri.split("/"); + return parts[parts.length - 1]; } function PatchClampRecordingList(props) { - - return ; + return ( + + ); } -export default PatchClampRecordingList; \ No newline at end of file +export default PatchClampRecordingList; diff --git a/apps/nar-v3/src/routes/dataset.jsx b/apps/nar-v3/src/routes/dataset.jsx index 6a3b12b..3d3848f 100644 --- a/apps/nar-v3/src/routes/dataset.jsx +++ b/apps/nar-v3/src/routes/dataset.jsx @@ -1,12 +1,25 @@ import React from "react"; import { Await, defer, useLoaderData } from "react-router-dom"; +import { buildKGQuery, simpleProperty as S, linkProperty as L, reverseLinkProperty as R } from "../queries"; import { datastore } from "../datastore"; -//import Navigation from "../components/Navigation"; +import { uuidFromUri } from "../utility.js"; +import Navigation from "../components/Navigation"; import DatasetCard from "../components/DatasetCard"; import ProgressIndicator from "../components/ProgressIndicator"; -const query = null; +const query = buildKGQuery("core/DatasetVersion", [ + S("@id"), + S("fullName"), + S("description"), + S("shortName"), + S("versionIdentifier"), + R("isVersionOf", "hasVersion", [ + S("fullName"), + S("description"), + S("shortName"), + ]), +]); export async function loader({ params }) { const datasetPromise = datastore.getKGItem( @@ -23,14 +36,23 @@ function Dataset(props) { return (
- {/* */} - }> Error loading dataset.

} > - {(dataset) => } + {(dataset) => { + console.log("Resolving dataset in dataset.jsx"); + console.log(dataset); + return ( + <> + + + + ); + }}
diff --git a/apps/nar-v3/src/routes/datasets.jsx b/apps/nar-v3/src/routes/datasets.jsx index ef3cb77..d26c6a3 100644 --- a/apps/nar-v3/src/routes/datasets.jsx +++ b/apps/nar-v3/src/routes/datasets.jsx @@ -3,7 +3,7 @@ import { Await, defer, useLoaderData } from "react-router-dom"; import { buildKGQuery, simpleProperty as S, linkProperty as L, reverseLinkProperty as R } from "../queries"; import { datastore } from "../datastore"; -//import Navigation from "../components/Navigation"; +import Navigation from "../components/Navigation"; import DatasetList from "../components/DatasetList"; import ProgressIndicator from "../components/ProgressIndicator"; @@ -34,7 +34,7 @@ function Datasets(props) { return (
- {/* */} + }>