Skip to content

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.

fix(frontend): release test fixes — scheduler time picker, unpublished banner (#12376)

Otto81c7685a8254
diff --git a/autogpt_platform/backend/backend/api/features/library/model.py b/autogpt_platform/backend/backend/api/features/library/model.py
index 2c2f9df061..7211a7ebfe 100644
--- a/autogpt_platform/backend/backend/api/features/library/model.py
+++ b/autogpt_platform/backend/backend/api/features/library/model.py
@@ -165,7 +165,6 @@ class LibraryAgent(pydantic.BaseModel):
id: str
graph_id: str
graph_version: int
- owner_user_id: str
image_url: str | None
@@ -206,7 +205,9 @@ class LibraryAgent(pydantic.BaseModel):
default_factory=list,
description="List of recent executions with status, score, and summary",
)
- can_access_graph: bool
+ can_access_graph: bool = pydantic.Field(
+ description="Indicates whether the same user owns the corresponding graph"
+ )
is_latest_version: bool
is_favorite: bool
folder_id: str | None = None
@@ -324,7 +325,6 @@ class LibraryAgent(pydantic.BaseModel):
id=agent.id,
graph_id=agent.agentGraphId,
graph_version=agent.agentGraphVersion,
- owner_user_id=agent.userId,
image_url=agent.imageUrl,
creator_name=creator_name,
creator_image_url=creator_image_url,
diff --git a/autogpt_platform/backend/backend/api/features/library/routes_test.py b/autogpt_platform/backend/backend/api/features/library/routes_test.py
index be1faf2779..935d9ec378 100644
--- a/autogpt_platform/backend/backend/api/features/library/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/library/routes_test.py
@@ -42,7 +42,6 @@ async def test_get_library_agents_success(
id="test-agent-1",
graph_id="test-agent-1",
graph_version=1,
- owner_user_id=test_user_id,
name="Test Agent 1",
description="Test Description 1",
image_url=None,
@@ -67,7 +66,6 @@ async def test_get_library_agents_success(
id="test-agent-2",
graph_id="test-agent-2",
graph_version=1,
- owner_user_id=test_user_id,
name="Test Agent 2",
description="Test Description 2",
image_url=None,
@@ -131,7 +129,6 @@ async def test_get_favorite_library_agents_success(
id="test-agent-1",
graph_id="test-agent-1",
graph_version=1,
- owner_user_id=test_user_id,
name="Favorite Agent 1",
description="Test Favorite Description 1",
image_url=None,
@@ -184,7 +181,6 @@ def test_add_agent_to_library_success(
id="test-library-agent-id",
graph_id="test-agent-1",
graph_version=1,
- owner_user_id=test_user_id,
name="Test Agent 1",
description="Test Description 1",
image_url=None,
diff --git a/autogpt_platform/backend/snapshots/lib_agts_search b/autogpt_platform/backend/snapshots/lib_agts_search
index 0d2331e73d..ae1d6ce7fd 100644
--- a/autogpt_platform/backend/snapshots/lib_agts_search
+++ b/autogpt_platform/backend/snapshots/lib_agts_search
@@ -4,7 +4,6 @@
"id": "test-agent-1",
"graph_id": "test-agent-1",
"graph_version": 1,
- "owner_user_id": "3e53486c-cf57-477e-ba2a-cb02dc828e1a",
"image_url": null,
"creator_name": "Test Creator",
"creator_image_url": "",
@@ -51,7 +50,6 @@
"id": "test-agent-2",
"graph_id": "test-agent-2",
"graph_version": 1,
- "owner_user_id": "3e53486c-cf57-477e-ba2a-cb02dc828e1a",
"image_url": null,
"creator_name": "Test Creator",
"creator_image_url": "",
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/components/CronScheduler/CronScheduler.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/components/CronScheduler/CronScheduler.tsx
index 1d56d79a80..7148752ddd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/components/CronScheduler/CronScheduler.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/components/CronScheduler/CronScheduler.tsx
@@ -260,7 +260,7 @@ export function CronScheduler({
)}
{frequency !== "hourly" &&
- !(frequency === "custom" && customInterval.unit === "hours") && (
+ !(frequency === "custom" && customInterval.unit !== "days") && (
<TimeAt
value={selectedTime}
onChange={setSelectedTime}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useMarketplaceUpdate.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useMarketplaceUpdate.ts
index b9c6cb5811..2e937f6cd5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useMarketplaceUpdate.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useMarketplaceUpdate.ts
@@ -47,7 +47,7 @@ export function useMarketplaceUpdate({ agent }: UseMarketplaceUpdateProps) {
{
query: {
// Only fetch if user is the creator
- enabled: !!(user?.id && agent?.owner_user_id === user.id),
+ enabled: !!(user?.id && agent?.can_access_graph),
},
},
);
@@ -90,7 +90,7 @@ export function useMarketplaceUpdate({ agent }: UseMarketplaceUpdateProps) {
};
}
- const isUserCreator = agent?.owner_user_id === user?.id;
+ const isUserCreator = !!(agent?.can_access_graph && user?.id);
const submissionsResponse = okData(submissionsData) as any;
const agentSubmissions =
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index 9020b68c23..172c326b08 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -9711,7 +9711,6 @@
"id": { "type": "string", "title": "Id" },
"graph_id": { "type": "string", "title": "Graph Id" },
"graph_version": { "type": "integer", "title": "Graph Version" },
- "owner_user_id": { "type": "string", "title": "Owner User Id" },
"image_url": {
"anyOf": [{ "type": "string" }, { "type": "null" }],
"title": "Image Url"
@@ -9799,7 +9798,8 @@
},
"can_access_graph": {
"type": "boolean",
- "title": "Can Access Graph"
+ "title": "Can Access Graph",
+ "description": "Indicates whether the same user owns the corresponding graph"
},
"is_latest_version": {
"type": "boolean",
@@ -9831,7 +9831,6 @@
"id",
"graph_id",
"graph_version",
- "owner_user_id",
"image_url",
"creator_name",
"creator_image_url",
diff --git a/autogpt_platform/frontend/src/components/contextual/CronScheduler/cron-scheduler.tsx b/autogpt_platform/frontend/src/components/contextual/CronScheduler/cron-scheduler.tsx
index a0e1b9f1b3..5a84837010 100644
--- a/autogpt_platform/frontend/src/components/contextual/CronScheduler/cron-scheduler.tsx
+++ b/autogpt_platform/frontend/src/components/contextual/CronScheduler/cron-scheduler.tsx
@@ -478,16 +478,17 @@ export function CronScheduler({
</div>
)}
- {frequency !== "hourly" && (
- <div className="flex items-center gap-4 space-y-2">
- <Label className="pt-2">At</Label>
- <Input
- type="time"
- value={selectedTime}
- onChange={(e) => setSelectedTime(e.target.value)}
- />
- </div>
- )}
+ {frequency !== "hourly" &&
+ !(frequency === "custom" && customInterval.unit !== "days") && (
+ <div className="flex items-center gap-4 space-y-2">
+ <Label className="pt-2">At</Label>
+ <Input
+ type="time"
+ value={selectedTime}
+ onChange={(e) => setSelectedTime(e.target.value)}
+ />
+ </div>
+ )}
</div>
);
}