Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function WarningModal({
submitClassname = "btn",
children,
active = true,
showProcedureFileInput = false,
onProcedureFileChange,
}: {
onClick: () => void;
warningTitle?: string;
Expand All @@ -19,6 +21,8 @@ export function WarningModal({
submitClassname?: string | ReactNode;
children: ReactNode;
active?: boolean;
showProcedureFileInput?: boolean;
onProcedureFileChange?: (value: string) => void;
}) {
return (
<div>
Expand All @@ -36,6 +40,20 @@ export function WarningModal({
</form>
<h3 className="text-lg">{warningTitle}</h3>
<p className="py-4">{warningMessage}</p>
{showProcedureFileInput && (
<div className="flex flex-col gap-4 form-control w-full">
<label className="label" htmlFor="procedureFileInput">
<span className="label-text">procedure_file name</span>
</label>
<input
id="procedureFileInput"
type="text"
placeholder="enter procedure_file name"
className="input input-bordered w-full"
onChange={(e) => onProcedureFileChange?.(e.target.value)}
/>
</div>
)}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an input field for the procedure_file

<div className="modal-action">
<form method="dialog">
<button className={submitClassname} onClick={onClick}>
Expand Down
18 changes: 11 additions & 7 deletions app/components/VialGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const DataTable = ({
<thead>
<tr>
<th>
<Link to={`/devices/${id}/${name}/hardware`}>hardware</Link>{" "}
<Link
className={"font-mono text-primary"}
to={`/devices/${id}/${name}/hardware`}
>
{vialIndex}
</Link>{" "}
</th>
<th></th>
<th></th>
Expand All @@ -41,7 +46,7 @@ const DataTable = ({
{subIndex === 0 && (
<td
rowSpan={Object.keys(data[mainKey]).length}
className="text-center"
className="text-center font-mono"
>
<Link
className="link"
Expand All @@ -54,7 +59,7 @@ const DataTable = ({
{renderSubKey && (
<td>
<Link
className="link"
className="link font-mono"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style tweaks

to={`/devices/${id}/${name}/hardware/${mainKey}/history?properties=${subKey}&vials=${vialIndex}`}
>
{subKey}
Expand All @@ -64,7 +69,9 @@ const DataTable = ({
{renderSubKey && (
<td>
{typeof data[mainKey][subKey] === "number"
? data[mainKey][subKey].toFixed(3)
? Number(data[mainKey][subKey].toFixed(3)) % 1 === 0
? data[mainKey][subKey].toFixed(0)
: data[mainKey][subKey].toFixed(3)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Js doesnt differentiate int and float. Dynamically roll floats up to ints if they qualify..

: data[mainKey][subKey] || "-"}
</td>
)}
Expand Down Expand Up @@ -202,9 +209,6 @@ export function FilterableVialGrid({
hasData && "border-4 border-primary",
)}
>
<div className="absolute font-mono opacity-5">
<span className="block text-[10vw] leading-none">{index}</span>
</div>
{hasData && (
<DataTable
data={data}
Expand Down
Loading