Skip to content

Commit

Permalink
Handle missing cell patching activity properties
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Jul 25, 2024
1 parent 5cf3e7f commit cf5bd17
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions apps/nar-v3/src/components/CellPatchingCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,26 @@ import KeyValueTable from "./KeyValueTable";
import styles from "../styles";
import { formatQuant, formatSolution } from "../utility";


function formatQuantList(value) {
if (value) {
return value.map((item) => formatQuant(item)).join(", ")
} else {
return ""
}
}


function CellPatchingCard(props) {
const activity = props.activity;

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(", "),
"Seal resistance": formatQuantList(activity.device[0].sealResistance.value),
"Series resistance": formatQuantList(activity.device[0].seriesResistance.value),
"Holding potential": formatQuantList(activity.device[0].holdingPotential.value),
"Bath solution": formatSolution(activity.tissueBathSolution),
"Bath temperature": formatQuant(activity.bathTemperature),
Description: activity.description,
Expand Down

0 comments on commit cf5bd17

Please sign in to comment.