AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Revert "feat(platform): add ability to reject approved agents in admin dashboard"
Nicholas Tindle483c399812ac
diff --git a/autogpt_platform/backend/backend/server/v2/store/db.py b/autogpt_platform/backend/backend/server/v2/store/db.pyindex 7eeafe69e3..f8eced49c1 100644--- a/autogpt_platform/backend/backend/server/v2/store/db.py+++ b/autogpt_platform/backend/backend/server/v2/store/db.py@@ -1096,13 +1096,6 @@ async def review_store_submission(detail=f"Store listing version {store_listing_version_id} not found",)- # Check if we're rejecting an already approved agent- is_rejecting_approved = (- not is_approved- and store_listing_version.submissionStatus- == prisma.enums.SubmissionStatus.APPROVED- )-# If approving, update the listing to indicate it has an approved versionif is_approved and store_listing_version.AgentGraph:heading = f"Sub-graph of {store_listing_version.name}v{store_listing_version.agentGraphVersion}"@@ -1133,37 +1126,6 @@ async def review_store_submission(},)- # If rejecting an approved agent, update the StoreListing accordingly- if is_rejecting_approved:- # Check if there are other approved versions- other_approved = (- await prisma.models.StoreListingVersion.prisma().find_first(- where={- "storeListingId": store_listing_version.StoreListing.id,- "id": {"not": store_listing_version_id},- "submissionStatus": prisma.enums.SubmissionStatus.APPROVED,- }- )- )-- if not other_approved:- # No other approved versions, update hasApprovedVersion to False- await prisma.models.StoreListing.prisma().update(- where={"id": store_listing_version.StoreListing.id},- data={- "hasApprovedVersion": False,- "ActiveVersion": {"disconnect": True},- },- )- else:- # Set the most recent other approved version as active- await prisma.models.StoreListing.prisma().update(- where={"id": store_listing_version.StoreListing.id},- data={- "ActiveVersion": {"connect": {"id": other_approved.id}},- },- )-submission_status = (prisma.enums.SubmissionStatus.APPROVEDif is_approveddiff --git a/autogpt_platform/frontend/src/components/admin/marketplace/approve-reject-buttons.tsx b/autogpt_platform/frontend/src/components/admin/marketplace/approve-reject-buttons.tsxindex 7b6313a316..b0e6b1d9d6 100644--- a/autogpt_platform/frontend/src/components/admin/marketplace/approve-reject-buttons.tsx+++ b/autogpt_platform/frontend/src/components/admin/marketplace/approve-reject-buttons.tsx@@ -13,7 +13,7 @@ import {} from "@/components/ui/dialog";import { Label } from "@/components/ui/label";import { Textarea } from "@/components/ui/textarea";-import type { StoreSubmission, SubmissionStatus } from "@/lib/autogpt-server-api/types";+import type { StoreSubmission } from "@/lib/autogpt-server-api/types";import { useRouter } from "next/navigation";import {approveAgent,@@ -28,8 +28,6 @@ export function ApproveRejectButtons({const router = useRouter();const [isApproveDialogOpen, setIsApproveDialogOpen] = useState(false);const [isRejectDialogOpen, setIsRejectDialogOpen] = useState(false);-- const isApproved = version.status === "APPROVED";const handleApproveSubmit = async (formData: FormData) => {setIsApproveDialogOpen(false);@@ -53,20 +51,18 @@ export function ApproveRejectButtons({return (<>- {!isApproved && (- <Button- size="sm"- variant="outline"- className="text-green-600 hover:bg-green-50 hover:text-green-700"- onClick={(e) => {- e.stopPropagation();- setIsApproveDialogOpen(true);- }}- >- <CheckCircle className="mr-2 h-4 w-4" />- Approve- </Button>- )}+ <Button+ size="sm"+ variant="outline"+ className="text-green-600 hover:bg-green-50 hover:text-green-700"+ onClick={(e) => {+ e.stopPropagation();+ setIsApproveDialogOpen(true);+ }}+ >+ <CheckCircle className="mr-2 h-4 w-4" />+ Approve+ </Button><Buttonsize="sm"variant="outline"@@ -77,7 +73,7 @@ export function ApproveRejectButtons({}}><XCircle className="mr-2 h-4 w-4" />- {isApproved ? "Revoke" : "Reject"}+ Reject</Button>{/* Approve Dialog */}@@ -128,11 +124,9 @@ export function ApproveRejectButtons({<Dialog open={isRejectDialogOpen} onOpenChange={setIsRejectDialogOpen}><DialogContent><DialogHeader>- <DialogTitle>{isApproved ? "Revoke Approved Agent" : "Reject Agent"}</DialogTitle>+ <DialogTitle>Reject Agent</DialogTitle><DialogDescription>- {isApproved- ? "Are you sure you want to revoke approval for this agent? This will remove it from the marketplace."- : "Please provide feedback on why this agent is being rejected."}+ Please provide feedback on why this agent is being rejected.</DialogDescription></DialogHeader>@@ -173,7 +167,7 @@ export function ApproveRejectButtons({Cancel</Button><Button type="submit" variant="destructive">- {isApproved ? "Revoke" : "Reject"}+ Reject</Button></DialogFooter></form>diff --git a/autogpt_platform/frontend/src/components/admin/marketplace/expandable-row.tsx b/autogpt_platform/frontend/src/components/admin/marketplace/expandable-row.tsxindex e1f936da5b..569bdc7eaf 100644--- a/autogpt_platform/frontend/src/components/admin/marketplace/expandable-row.tsx+++ b/autogpt_platform/frontend/src/components/admin/marketplace/expandable-row.tsx@@ -83,8 +83,7 @@ export function ExpandableRow({/>)}- {(latestVersion?.status === SubmissionStatus.PENDING ||- latestVersion?.status === SubmissionStatus.APPROVED) && (+ {latestVersion?.status === SubmissionStatus.PENDING && (<ApproveRejectButtons version={latestVersion} />)}</div>@@ -189,8 +188,7 @@ export function ExpandableRow({}/>)}- {(version.status === SubmissionStatus.PENDING ||- version.status === SubmissionStatus.APPROVED) && (+ {version.status === SubmissionStatus.PENDING && (<ApproveRejectButtons version={version} />)}</div>