Skip to content

Commit

Permalink
ensure datasets without in-depth metadata display without error
Browse files Browse the repository at this point in the history
apdavison committed Mar 8, 2024
1 parent 933e528 commit ea40b47
Showing 2 changed files with 33 additions and 33 deletions.
36 changes: 18 additions & 18 deletions apps/nar-v3/src/components/CellPatchingCard.jsx
Original file line number Diff line number Diff line change
@@ -28,25 +28,25 @@ import { formatQuant, formatSolution } from "../utility";
function CellPatchingCard(props) {
const activity = props.activity;

const data = {
"Electrode description": activity.device[0].device.description,
"Pipette solution": formatSolution(activity.device[0].pipetteSolution),
"Seal resistance": activity.device[0].sealResistance.value
.map((item) => formatQuant(item))
.join(", "),
"Series resistance": activity.device[0].seriesResistance.value
.map((item) => formatQuant(item))
.join(", "),
"Holding potential": activity.device[0].holdingPotential.value
.map((item) => formatQuant(item))
.join(", "),
"Bath solution": formatSolution(activity.tissueBathSolution),
"Bath temperature": formatQuant(activity.bathTemperature),
Description: activity.description,
Type: activity.variation,
};

if (activity) {
const data = {
"Electrode description": activity.device[0].device.description,
"Pipette solution": formatSolution(activity.device[0].pipetteSolution),
"Seal resistance": activity.device[0].sealResistance.value
.map((item) => formatQuant(item))
.join(", "),
"Series resistance": activity.device[0].seriesResistance.value
.map((item) => formatQuant(item))
.join(", "),
"Holding potential": activity.device[0].holdingPotential.value
.map((item) => formatQuant(item))
.join(", "),
"Bath solution": formatSolution(activity.tissueBathSolution),
"Bath temperature": formatQuant(activity.bathTemperature),
Description: activity.description,
Type: activity.variation,
};

return (
<>
<Connection />
30 changes: 15 additions & 15 deletions apps/nar-v3/src/components/DataFileCard.jsx
Original file line number Diff line number Diff line change
@@ -27,22 +27,22 @@ import styles from "../styles";
function DataFileCard(props) {
const fileObj = props.fileObj;

const data = {
"Data type": fileObj.dataType ? fileObj.dataType.name : "unknown",
Format: fileObj.format ? fileObj.format.name : "unknown",
Hash: (
<>
{fileObj.hash.map((item) => (
<span key={item.algorithm}>
{item.algorithm}: {item.digest}&nbsp;
</span>
))}
</>
),
Size: formatQuant(fileObj.storageSize),
};

if (fileObj) {
const data = {
"Data type": fileObj.dataType ? fileObj.dataType.name : "unknown",
Format: fileObj.format ? fileObj.format.name : "unknown",
Hash: (
<>
{fileObj.hash.map((item) => (
<span key={item.algorithm}>
{item.algorithm}: {item.digest}&nbsp;
</span>
))}
</>
),
Size: formatQuant(fileObj.storageSize),
};

return (
<>
<Connection />

0 comments on commit ea40b47

Please sign in to comment.