fix select for cache key in workflow run code view (#3627)
This commit is contained in:
@@ -153,18 +153,19 @@ function WorkflowRunCode(props?: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full flex-col items-end justify-center gap-2">
|
<div className="flex h-full w-full flex-col items-end justify-center gap-2">
|
||||||
<div className="flex w-full justify-end gap-4">
|
{cacheKeyValueSet.size > 0 ? (
|
||||||
<div className="flex items-center justify-around gap-2">
|
<div className="flex w-full justify-end gap-4">
|
||||||
<Label className="w-[7rem]">Code Key Value</Label>
|
<div className="flex items-center justify-around gap-2">
|
||||||
<HelpTooltip
|
<Label className="w-[7rem]">Code Key Value</Label>
|
||||||
content={
|
<HelpTooltip
|
||||||
!isFinalized
|
content={
|
||||||
? "The code key value the generated code is being stored under."
|
!isFinalized
|
||||||
: "Which generated (& cached) code to view."
|
? "The code key value the generated code is being stored under."
|
||||||
}
|
: "Which generated (& cached) code to view."
|
||||||
/>
|
}
|
||||||
</div>
|
/>
|
||||||
{cacheKeyValueSet.size > 0 ? (
|
</div>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
disabled={!isFinalized}
|
disabled={!isFinalized}
|
||||||
value={cacheKeyValue}
|
value={cacheKeyValue}
|
||||||
@@ -176,22 +177,28 @@ function WorkflowRunCode(props?: Props) {
|
|||||||
<SelectContent>
|
<SelectContent>
|
||||||
{Array.from(cacheKeyValueSet)
|
{Array.from(cacheKeyValueSet)
|
||||||
.sort()
|
.sort()
|
||||||
.map((value) => {
|
.map((value, i) => {
|
||||||
|
const v = value
|
||||||
|
? value.length === 0
|
||||||
|
? "default"
|
||||||
|
: value
|
||||||
|
: "default";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectItem key={value} value={value}>
|
<SelectItem key={`${v}-${i}`} value={v}>
|
||||||
{value === cacheKeyValueForWorkflowRun &&
|
{value === cacheKeyValueForWorkflowRun &&
|
||||||
isFinalized === true ? (
|
isFinalized === true ? (
|
||||||
<span className="underline">{value}</span>
|
<span className="underline">{v}</span>
|
||||||
) : (
|
) : (
|
||||||
value
|
v
|
||||||
)}
|
)}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
) : null}
|
</div>
|
||||||
</div>
|
) : null}
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
className={cn("h-full w-full overflow-y-scroll", {
|
className={cn("h-full w-full overflow-y-scroll", {
|
||||||
"animate-pulse": isGeneratingCode,
|
"animate-pulse": isGeneratingCode,
|
||||||
|
|||||||
Reference in New Issue
Block a user