diff --git a/ui/package-lock.json b/ui/package-lock.json index cc11b0f..379da05 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ui", - "version": "1.15.0", + "version": "1.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ui", - "version": "1.15.0", + "version": "1.16.0", "dependencies": { "@dagrejs/dagre": "^1.1.4", "@hey-api/client-fetch": "^0.10.0", diff --git a/ui/src/app/tools/[toolUuid]/page.tsx b/ui/src/app/tools/[toolUuid]/page.tsx index 97e0a13..17a9b3d 100644 --- a/ui/src/app/tools/[toolUuid]/page.tsx +++ b/ui/src/app/tools/[toolUuid]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { ArrowLeft, Code, Loader2, Save } from "lucide-react"; +import { ArrowLeft, Code, ExternalLink, Loader2, Save } from "lucide-react"; import { useParams, useRouter } from "next/navigation"; import { useCallback, useEffect, useState } from "react"; @@ -20,6 +20,7 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Skeleton } from "@/components/ui/skeleton"; +import { TOOL_DOCUMENTATION_URLS } from "@/constants/documentation"; import { useAuth } from "@/lib/auth"; import { @@ -439,6 +440,17 @@ const data = await response.json();`; View Code )} + {TOOL_DOCUMENTATION_URLS[tool.category] && ( + + Docs + + + )} diff --git a/ui/src/components/flow/nodes/AgentNode.tsx b/ui/src/components/flow/nodes/AgentNode.tsx index f327878..62779e4 100644 --- a/ui/src/components/flow/nodes/AgentNode.tsx +++ b/ui/src/components/flow/nodes/AgentNode.tsx @@ -14,6 +14,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Textarea } from "@/components/ui/textarea"; +import { NODE_DOCUMENTATION_URLS } from "@/constants/documentation"; import { NodeContent } from "./common/NodeContent"; import { NodeEditDialog } from "./common/NodeEditDialog"; @@ -203,6 +204,7 @@ export const AgentNode = memo(({ data, selected, id }: AgentNodeProps) => { title="Edit Agent" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.agent} > {open && ( { title="End Call" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.endCall} > {open && ( { title="Edit Global Node" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.global} > {open && ( { title="Edit QA Analysis" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.qaAnalysis} > {open && ( { title="Start Call" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.startCall} > {open && ( { title="Edit API Trigger" onSave={handleSave} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.apiTrigger} > {open && ( { onSave={handleSave} error={endpointError || jsonError} isDirty={isDirty} + documentationUrl={NODE_DOCUMENTATION_URLS.webhook} > {open && ( void; error?: string | null; isDirty?: boolean; + documentationUrl?: string; } export const NodeEditDialog = ({ @@ -34,7 +35,8 @@ export const NodeEditDialog = ({ children, onSave, error, - isDirty = false + isDirty = false, + documentationUrl, }: NodeEditDialogProps) => { const [showDiscardAlert, setShowDiscardAlert] = useState(false); @@ -84,7 +86,20 @@ export const NodeEditDialog = ({ style={{ maxWidth: "1200px", width: "95vw" }} > - {title} + + {title} + {documentationUrl && ( + + Docs + + + )} + Configure the settings for this node in your workflow. diff --git a/ui/src/constants/documentation.ts b/ui/src/constants/documentation.ts new file mode 100644 index 0000000..92e29f1 --- /dev/null +++ b/ui/src/constants/documentation.ts @@ -0,0 +1,17 @@ +const DOCS_BASE = "https://docs.dograh.com"; + +export const NODE_DOCUMENTATION_URLS: Record = { + startCall: `${DOCS_BASE}/voice-agent/start-call`, + endCall: `${DOCS_BASE}/voice-agent/end-call`, + agent: `${DOCS_BASE}/voice-agent/agent`, + global: `${DOCS_BASE}/voice-agent/global`, + apiTrigger: `${DOCS_BASE}/voice-agent/api-trigger`, + webhook: `${DOCS_BASE}/voice-agent/webhook`, + qaAnalysis: `${DOCS_BASE}/getting-started`, +}; + +export const TOOL_DOCUMENTATION_URLS: Record = { + http_api: `${DOCS_BASE}/voice-agent/tools/http-api`, + end_call: `${DOCS_BASE}/voice-agent/tools/end-call`, + transfer_call: `${DOCS_BASE}/voice-agent/tools/call-transfer`, +};