diff --git a/apps/nar-v3/src/components/CellPatchingCard.jsx b/apps/nar-v3/src/components/CellPatchingCard.jsx index 886860d..6346acf 100644 --- a/apps/nar-v3/src/components/CellPatchingCard.jsx +++ b/apps/nar-v3/src/components/CellPatchingCard.jsx @@ -23,14 +23,14 @@ import Paper from "@mui/material/Paper"; import Connection from "./Connection"; import KeyValueTable from "./KeyValueTable"; import styles from "../styles"; -import { formatQuant } from "../utility"; +import { formatQuant, formatSolution } from "../utility"; function CellPatchingCard(props) { const activity = props.activity; const data = { "Electrode description": activity.device[0].device.description, - "Pipette solution (more details to come)": activity.device[0].pipetteSolution.name, + "Pipette solution": formatSolution(activity.device[0].pipetteSolution.hasPart), "Seal resistance": activity.device[0].sealResistance.value .map((item) => formatQuant(item)) .join(", "), @@ -40,7 +40,7 @@ function CellPatchingCard(props) { "Holding potential": activity.device[0].holdingPotential.value .map((item) => formatQuant(item)) .join(", "), - "Bath solution (more details to come)": activity.tissueBathSolution.name, + "Bath solution": formatSolution(activity.tissueBathSolution.hasPart), "Bath temperature": formatQuant(activity.bathTemperature), Description: activity.description, Type: activity.variation, diff --git a/apps/nar-v3/src/components/DatasetCard.jsx b/apps/nar-v3/src/components/DatasetCard.jsx index fe502b6..85f5289 100644 --- a/apps/nar-v3/src/components/DatasetCard.jsx +++ b/apps/nar-v3/src/components/DatasetCard.jsx @@ -78,8 +78,6 @@ function DatasetCard(props) { const slices = getSlices(subjectIndex); if (slices) { const slice = slices[sliceIndex]; - console.log("cell patching:"); - console.log(slice.cellPatching[0]); return slice.cellPatching[0]; } else { return null; @@ -89,8 +87,6 @@ function DatasetCard(props) { const getPatchedCell = (subjectIndex, sliceIndex) => { const cellPatching = getCellPatching(subjectIndex, sliceIndex); if (cellPatching) { - console.log("patched cell:"); - console.log(cellPatching.output[0]); return cellPatching.output[0]; } else { return null; diff --git a/apps/nar-v3/src/components/KeyValueTable.jsx b/apps/nar-v3/src/components/KeyValueTable.jsx index e7d6415..cf08161 100644 --- a/apps/nar-v3/src/components/KeyValueTable.jsx +++ b/apps/nar-v3/src/components/KeyValueTable.jsx @@ -33,9 +33,9 @@ function KeyValueTable(props) { } return ( - - {rows} -
+ + {rows} +
); } diff --git a/apps/nar-v3/src/components/SlicePreparationCard.jsx b/apps/nar-v3/src/components/SlicePreparationCard.jsx index 5a19cfb..57f3100 100644 --- a/apps/nar-v3/src/components/SlicePreparationCard.jsx +++ b/apps/nar-v3/src/components/SlicePreparationCard.jsx @@ -20,7 +20,7 @@ limitations under the License. import Box from "@mui/material/Box"; import Paper from "@mui/material/Paper"; -import { formatQuant } from "../utility"; +import { formatQuant, formatSolution } from "../utility"; import Connection from "./Connection"; import KeyValueTable from "./KeyValueTable"; import styles from "../styles"; @@ -39,7 +39,7 @@ function SlicePreparationCard(props) { "Slicing plane": activity.device[0].slicingPlane, "Study targets": activity.studyTarget.join(", "), Temperature: formatQuant(activity.temperature), - "Dissecting solution (full details to come)": activity.tissueBathSolution.name, + "Dissecting solution": formatSolution(activity.tissueBathSolution.hasPart), }; return ( <> diff --git a/apps/nar-v3/src/utility.js b/apps/nar-v3/src/utility.js index 7ffd089..f981664 100644 --- a/apps/nar-v3/src/utility.js +++ b/apps/nar-v3/src/utility.js @@ -28,6 +28,16 @@ function formatQuant(val) { } } +function formatSolution(components) { + const parts = []; + components.forEach((component) => { + const amount = formatQuant(component.amount); + const symbol = component.chemicalProduct ? component.chemicalProduct.name : "[missing]"; + parts.push(`${amount} ${symbol}`); + }); + return parts.join(", "); +} + function uuidFromUri(uri) { const parts = uri.split("/"); return parts[parts.length - 1]; @@ -38,4 +48,4 @@ function getKGSearchUrl(uri) { return `https://search.kg.ebrains.eu/instances/${uuid}`; } -export { formatQuant, formatUnits, uuidFromUri, getKGSearchUrl }; +export { formatQuant, formatUnits, formatSolution, uuidFromUri, getKGSearchUrl };