Skip to content

Commit cd53261

Browse files
committed
cleanup vial grid
1 parent a7dbccd commit cd53261

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

app/__tests__/unit/root.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("root loader", () => {
99
params: {},
1010
context: {},
1111
});
12-
const data = await response.json();
12+
const data = await response;
1313
expect(data).toEqual({
1414
theme: "dark",
1515
ENV: {
@@ -29,7 +29,7 @@ describe("root loader", () => {
2929
params: {},
3030
context: {},
3131
});
32-
const data = await response.json();
32+
const data = await response;
3333
expect(data.theme).toEqual("light");
3434
});
3535
});

app/components/VialGrid.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const DataTable = ({
99
}: {
1010
id: string;
1111
vialIndex: number;
12-
data: { [key: string]: number | null };
12+
data: { [key: string]: number };
1313
excludedProperties?: string[];
1414
}) => {
1515
return (
@@ -26,7 +26,7 @@ const DataTable = ({
2626
</thead>
2727
<tbody>
2828
{Object.keys(data).map((mainKey) =>
29-
Object.keys(data[mainKey]).map((subKey, subIndex) => {
29+
Object.keys(data[mainKey]).map((subKey: string, subIndex) => {
3030
let renderSubKey = true;
3131
if (excludedProperties.includes(subKey)) {
3232
renderSubKey = false;
@@ -58,9 +58,8 @@ const DataTable = ({
5858
)}
5959
{renderSubKey && (
6060
<td>
61-
{data[mainKey][subKey] !== null &&
62-
data[mainKey][subKey].toString()}
63-
{data[mainKey][subKey] == null && "-"}
61+
{data[mainKey][subKey]}
62+
{!data[mainKey][subKey] && "-"}
6463
</td>
6564
)}
6665
</tr>
@@ -116,14 +115,12 @@ export function VialGrid({
116115
<span className="block text-[5vw] leading-none">{index}</span>
117116
</div>
118117
{hasData && (
119-
<div className="relative z-10">
120-
<DataTable
121-
data={data}
122-
id={id}
123-
vialIndex={index}
124-
excludedProperties={excludedProperties}
125-
/>
126-
</div>
118+
<DataTable
119+
data={data}
120+
id={id}
121+
vialIndex={index}
122+
excludedProperties={excludedProperties}
123+
/>
127124
)}
128125
</div>
129126
);

app/routes/devices.$id.hardware.$hardware_name.calibrate.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,17 @@ const CalibrationProcedureControls = ({
346346

347347
export function ErrorBoundary() {
348348
return (
349-
<div className="flex flex-col gap-4 bg-base-300 rounded-box">
350-
<WrenchScrewdriverIcon className="w-10 h-10" />
351-
<div>
349+
<div>
350+
<div className="flex flex-col gap-4">
351+
<CalibrationProcedureControls started={false} />
352+
</div>
353+
<div className="flex flex-col gap-4 bg-base-300 rounded-box">
354+
<WrenchScrewdriverIcon className="w-10 h-10" />
352355
<div>
353-
<h1 className="font-mono">{`The calibration procedure encountered an error.
356+
<div>
357+
<h1 className="font-mono">{`The calibration procedure encountered an error.
354358
Make sure there is a procedure defined on the hardware in the config and the procedure has been started`}</h1>
359+
</div>
355360
</div>
356361
</div>
357362
</div>

0 commit comments

Comments
 (0)