code cache icon button instead of dropdown (#3322)
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
import { getClient } from "@/api/AxiosClient";
|
import { getClient } from "@/api/AxiosClient";
|
||||||
import { Handle, Node, NodeProps, Position, useReactFlow } from "@xyflow/react";
|
import { Handle, Node, NodeProps, Position, useReactFlow } from "@xyflow/react";
|
||||||
import type { StartNode } from "./types";
|
import type { StartNode } from "./types";
|
||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from "@/components/ui/tooltip";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
AccordionContent,
|
AccordionContent,
|
||||||
@@ -25,7 +32,6 @@ import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "../Taskv2Node/types";
|
|||||||
import { KeyValueInput } from "@/components/KeyValueInput";
|
import { KeyValueInput } from "@/components/KeyValueInput";
|
||||||
import { OrgWalled } from "@/components/Orgwalled";
|
import { OrgWalled } from "@/components/Orgwalled";
|
||||||
import { placeholders } from "@/routes/workflows/editor/helpContent";
|
import { placeholders } from "@/routes/workflows/editor/helpContent";
|
||||||
import { NodeActionMenu } from "@/routes/workflows/editor/nodes/NodeActionMenu";
|
|
||||||
import { useToggleScriptForNodeCallback } from "@/routes/workflows/hooks/useToggleScriptForNodeCallback";
|
import { useToggleScriptForNodeCallback } from "@/routes/workflows/hooks/useToggleScriptForNodeCallback";
|
||||||
import { useWorkflowSettingsStore } from "@/store/WorkflowSettingsStore";
|
import { useWorkflowSettingsStore } from "@/store/WorkflowSettingsStore";
|
||||||
import {
|
import {
|
||||||
@@ -37,6 +43,7 @@ import { useRerender } from "@/hooks/useRerender";
|
|||||||
import { useBlockScriptStore } from "@/store/BlockScriptStore";
|
import { useBlockScriptStore } from "@/store/BlockScriptStore";
|
||||||
import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
|
import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";
|
||||||
import { cn } from "@/util/utils";
|
import { cn } from "@/util/utils";
|
||||||
|
import { LightningBoltIcon } from "@radix-ui/react-icons";
|
||||||
|
|
||||||
function StartNode({ id, data }: NodeProps<StartNode>) {
|
function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||||
const workflowSettingsStore = useWorkflowSettingsStore();
|
const workflowSettingsStore = useWorkflowSettingsStore();
|
||||||
@@ -153,19 +160,23 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div className="absolute right-0 top-0">
|
<div className="absolute right-[-0.5rem] top-[-0.25rem]">
|
||||||
<div>
|
<div>
|
||||||
<div className="rounded p-1 hover:bg-muted">
|
<OrgWalled className="p-0">
|
||||||
<NodeActionMenu
|
<Button variant="link" size="icon" onClick={showAllScripts}>
|
||||||
isDeletable={false}
|
<TooltipProvider>
|
||||||
isScriptable={true}
|
<Tooltip>
|
||||||
showScriptText="Show All Code"
|
<TooltipTrigger asChild>
|
||||||
onShowScript={showAllScripts}
|
<LightningBoltIcon className="h-4 w-4 text-[gold]" />
|
||||||
/>
|
</TooltipTrigger>
|
||||||
</div>
|
<TooltipContent>Show all code</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
</Button>
|
||||||
|
</OrgWalled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<header className="mb-4">Start</header>
|
<header className="mb-6 mt-2">Start</header>
|
||||||
<Separator />
|
<Separator />
|
||||||
<Accordion
|
<Accordion
|
||||||
type="single"
|
type="single"
|
||||||
|
|||||||
Reference in New Issue
Block a user