diff --git a/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx b/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx index 5a86e6545313..a76987f2522a 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx @@ -17,6 +17,7 @@ import { } from "@/lib/autogpt-server-api"; import { useRouter } from "next/navigation"; import { useBackendAPI } from "@/lib/autogpt-server-api/context"; +import { useToast } from "@/components/ui/use-toast"; interface PublishAgentPopoutProps { trigger?: React.ReactNode; openPopout?: boolean; @@ -58,6 +59,8 @@ export const PublishAgentPopout: React.FC = ({ const router = useRouter(); const api = useBackendAPI(); + const { toast } = useToast(); + React.useEffect(() => { console.log("PublishAgentPopout Effect"); setOpen(openPopout); @@ -116,14 +119,20 @@ export const PublishAgentPopout: React.FC = ({ videoUrl: string, categories: string[], ) => { - if ( - !name || - !subHeading || - !description || - !imageUrls.length || - !categories.length - ) { - console.error("Missing required fields"); + const missingFields: string[] = []; + + if (!name) missingFields.push("Name"); + if (!subHeading) missingFields.push("Sub-heading"); + if (!description) missingFields.push("Description"); + if (!imageUrls.length) missingFields.push("Image"); + if (!categories.length) missingFields.push("Categories"); + + if (missingFields.length > 0) { + toast({ + title: "Missing Required Fields", + description: `Please fill in: ${missingFields.join(", ")}`, + duration: 3000, + }); return; } diff --git a/autogpt_platform/frontend/src/components/flow.css b/autogpt_platform/frontend/src/components/flow.css index cafd54659f15..abbee903b42c 100644 --- a/autogpt_platform/frontend/src/components/flow.css +++ b/autogpt_platform/frontend/src/components/flow.css @@ -1,9 +1,9 @@ /* flow.css or index.css */ body { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", - "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", - "Helvetica Neue", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; } code {