Improve run workflow form (#1032)

This commit is contained in:
Shuchang Zheng
2024-10-23 07:12:36 -07:00
committed by GitHub
parent 96c807e949
commit 426acbc3e5
5 changed files with 155 additions and 162 deletions

View File

@@ -16,11 +16,14 @@ function WorkflowParameterInput({ type, value, onChange }: Props) {
if (type === "json") {
return (
<CodeEditor
className="w-full"
language="json"
onChange={(value) => onChange(value)}
value={
typeof value === "string" ? value : JSON.stringify(value, null, 2)
}
minHeight="96px"
maxHeight="500px"
/>
);
}
@@ -37,7 +40,7 @@ function WorkflowParameterInput({ type, value, onChange }: Props) {
if (type === "integer") {
return (
<Input
value={value as number}
value={value === null ? "" : Number(value)}
onChange={(e) => onChange(parseInt(e.target.value))}
type="number"
/>
@@ -47,7 +50,7 @@ function WorkflowParameterInput({ type, value, onChange }: Props) {
if (type === "float") {
return (
<Input
value={value as number}
value={value === null ? "" : Number(value)}
onChange={(e) => onChange(parseFloat(e.target.value))}
type="number"
step="any"