mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(frontend): Update "Edit a copy" modal and buttons (#9876)
Update "Edit a copy" modal text when copying marketplace agent in Library. Update agent action buttons to reflect the design accurately. ### Changes 🏗️ - Update modal text - Disable copying owned agents (only marketplace allowed) - `Open in Builder` -> `Customize agent` - Disabled `Customize agent` instead of hiding - Change `Delete agent` to non-destructive design ### Checklist 📋 #### For code changes: - [ ] I have clearly listed my changes in the PR description - [ ] I have made a test plan - [ ] I have tested my changes according to the test plan: - [ ] ...
This commit is contained in:
committed by
GitHub
parent
0675a41e42
commit
11a69170b5
@@ -268,22 +268,22 @@ export default function AgentRunsPage(): React.ReactElement {
|
||||
|
||||
const agentActions: ButtonAction[] = useMemo(
|
||||
() => [
|
||||
...(agent?.can_access_graph
|
||||
{
|
||||
label: "Customize agent",
|
||||
href: `/build?flowID=${agent?.graph_id}&flowVersion=${agent?.graph_version}`,
|
||||
disabled: !agent?.can_access_graph,
|
||||
},
|
||||
{ label: "Export agent to file", callback: downloadGraph },
|
||||
...(!agent?.can_access_graph
|
||||
? [
|
||||
{
|
||||
label: "Open graph in builder",
|
||||
href: `/build?flowID=${agent.graph_id}&flowVersion=${agent.graph_version}`,
|
||||
label: "Edit a copy",
|
||||
callback: () => setCopyAgentDialogOpen(true),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{ label: "Export agent to file", callback: downloadGraph },
|
||||
{
|
||||
label: "Edit a copy",
|
||||
callback: () => setCopyAgentDialogOpen(true),
|
||||
},
|
||||
{
|
||||
label: "Delete agent",
|
||||
variant: "destructive",
|
||||
callback: () => setAgentDeleteDialogOpen(true),
|
||||
},
|
||||
],
|
||||
@@ -381,10 +381,11 @@ export default function AgentRunsPage(): React.ReactElement {
|
||||
<DialogHeader>
|
||||
<DialogTitle>You're making an editable copy</DialogTitle>
|
||||
<DialogDescription className="pt-2">
|
||||
We'll save a new version of this agent to your library so
|
||||
you can customize it however you'd like. You'll still
|
||||
have the original from the marketplace too — it won't be
|
||||
changed and can't be edited.
|
||||
The original Marketplace agent stays the same and cannot be
|
||||
edited. We'll save a new version of this agent to your
|
||||
Library. From there, you can customize it however you'd
|
||||
like by clicking "Customize agent" — this will open
|
||||
the builder where you can see and modify the inner workings.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter className="justify-end">
|
||||
|
||||
@@ -22,6 +22,7 @@ export default function ActionButtonGroup({
|
||||
<Button
|
||||
key={i}
|
||||
variant={action.variant ?? "outline"}
|
||||
disabled={action.disabled}
|
||||
onClick={action.callback}
|
||||
>
|
||||
{action.label}
|
||||
@@ -29,7 +30,11 @@ export default function ActionButtonGroup({
|
||||
) : (
|
||||
<Link
|
||||
key={i}
|
||||
className={buttonVariants({ variant: action.variant })}
|
||||
className={cn(
|
||||
buttonVariants({ variant: action.variant }),
|
||||
action.disabled &&
|
||||
"pointer-events-none border-zinc-400 text-zinc-400",
|
||||
)}
|
||||
href={action.href}
|
||||
>
|
||||
{action.label}
|
||||
|
||||
@@ -4,4 +4,5 @@ import React from "react";
|
||||
export type ButtonAction = {
|
||||
label: React.ReactNode;
|
||||
variant?: ButtonProps["variant"];
|
||||
disabled?: boolean;
|
||||
} & ({ callback: () => void } | { href: string });
|
||||
|
||||
Reference in New Issue
Block a user