Skip to content

Commit

Permalink
wip: improving dataset list
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Mar 5, 2024
1 parent 7e7935c commit 2ea1912
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
30 changes: 26 additions & 4 deletions apps/nar-v3/src/components/DatasetList.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
import { Link as RouterLink } from "react-router-dom";
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableContainer from '@mui/material/TableContainer';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';

import { uuidFromUri } from "../utility";

function DatasetList(props) {
return (
<ul>
<Table>
<TableHead>
<TableRow>
<TableCell component="th">Name</TableCell>
<TableCell component="th">Subjects</TableCell>
<TableCell component="th">Activities</TableCell>
</TableRow>
</TableHead>
<TableBody>
{props.datasets.map((dataset) => (
<li key={dataset.id}>
<TableRow key={dataset.id}><TableCell>
<RouterLink to={uuidFromUri(dataset.id)}>
{dataset.fullName || dataset.isVersionOf.fullName}
</RouterLink>
</li>
</TableCell>
<TableCell>
{dataset.studiedSpecimen.length}
</TableCell>
<TableCell>
{dataset.activities.length}
</TableCell>
</TableRow>
))}
</ul>
</TableBody>
</Table>
);
}

Expand Down
4 changes: 3 additions & 1 deletion apps/nar-v3/src/routes/datasets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const query = buildKGQuery(
S("versionIdentifier"),
R("isVersionOf", "hasVersion", [S("fullName"), S("description"), S("shortName")]),
L("accessibility/name", [], {filter: "free access", required: true}),
L("experimentalApproach/name", [], {filter: "electrophysiology", required: true})
L("experimentalApproach/name", [], {filter: "electrophysiology", required: true}),
L("studiedSpecimen", [S("lookupLabel")], { type: "core/Subject", expectSingle: false }),
R("activities", "isPartOf", [S("@type")], {expectSingle: false})
]
)

Expand Down

0 comments on commit 2ea1912

Please sign in to comment.