mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix linting errors
This commit is contained in:
@@ -18,7 +18,7 @@ const nextConfig = {
|
||||
// TODO: Re-enable TypeScript checks once current issues are resolved
|
||||
typescript: {
|
||||
ignoreBuildErrors: true,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default withSentryConfig(nextConfig, {
|
||||
|
||||
@@ -17,7 +17,10 @@ import { Separator } from "@/components/ui/separator";
|
||||
import AutoGPTServerAPIServerSide from "@/lib/autogpt-server-api";
|
||||
import { Metadata } from "next";
|
||||
import { createServerClient } from "@/lib/supabase/server";
|
||||
import { StoreAgentsResponse, CreatorsResponse } from "@/lib/autogpt-server-api/types";
|
||||
import {
|
||||
StoreAgentsResponse,
|
||||
CreatorsResponse,
|
||||
} from "@/lib/autogpt-server-api/types";
|
||||
|
||||
async function getStoreData() {
|
||||
try {
|
||||
@@ -33,12 +36,36 @@ async function getStoreData() {
|
||||
);
|
||||
|
||||
// Add error handling and default values
|
||||
let featuredAgents: StoreAgentsResponse = { agents: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } };
|
||||
let topAgents: StoreAgentsResponse = { agents: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } };
|
||||
let featuredCreators: CreatorsResponse = { creators: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } };
|
||||
let featuredAgents: StoreAgentsResponse = {
|
||||
agents: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
};
|
||||
let topAgents: StoreAgentsResponse = {
|
||||
agents: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
};
|
||||
let featuredCreators: CreatorsResponse = {
|
||||
creators: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
[featuredAgents, topAgents, featuredCreators] = await Promise.all([
|
||||
[featuredAgents, topAgents, featuredCreators] = await Promise.all([
|
||||
api.getStoreAgents({ featured: true }),
|
||||
api.getStoreAgents({ sorted_by: "runs" }),
|
||||
api.getStoreCreators({ featured: true, sorted_by: "num_agents" }),
|
||||
@@ -55,9 +82,33 @@ async function getStoreData() {
|
||||
} catch (error) {
|
||||
console.error("Error in getStoreData:", error);
|
||||
return {
|
||||
featuredAgents: { agents: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } },
|
||||
topAgents: { agents: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } },
|
||||
featuredCreators: { creators: [], pagination: { total_items: 0, total_pages: 0, current_page: 0, page_size: 0 } },
|
||||
featuredAgents: {
|
||||
agents: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
},
|
||||
topAgents: {
|
||||
agents: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
},
|
||||
featuredCreators: {
|
||||
creators: [],
|
||||
pagination: {
|
||||
total_items: 0,
|
||||
total_pages: 0,
|
||||
current_page: 0,
|
||||
page_size: 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ export const Sizes: Story = {
|
||||
await expect(buttons).toHaveLength(5);
|
||||
const sizeClasses = [
|
||||
"h-8 px-3 py-1.5 text-xs",
|
||||
"h-10 px-4 py-2 text-sm",
|
||||
"h-10 px-4 py-2 text-sm",
|
||||
"h-12 px-5 py-2.5 text-lg",
|
||||
"h-10 w-28",
|
||||
"h-10 w-10",
|
||||
@@ -132,7 +132,7 @@ export const Sizes: Story = {
|
||||
for (let i = 0; i < buttons.length; i++) {
|
||||
await expect(buttons[i]).toHaveAttribute(
|
||||
"class",
|
||||
expect.stringContaining(sizeClasses[i])
|
||||
expect.stringContaining(sizeClasses[i]),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -75,7 +75,7 @@ export const PublishAgentPopout: React.FC<PublishAgentPopoutProps> = ({
|
||||
setOpen(openPopout);
|
||||
setStep(inputStep);
|
||||
setPublishData(submissionData);
|
||||
}, [openPopout]);
|
||||
}, [openPopout]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
React.useEffect(() => {
|
||||
console.log("LoadMyAgents Effect");
|
||||
@@ -91,7 +91,7 @@ export const PublishAgentPopout: React.FC<PublishAgentPopoutProps> = ({
|
||||
|
||||
loadMyAgents();
|
||||
}
|
||||
}, [open]);
|
||||
}, [open, api]);
|
||||
|
||||
const handleClose = () => {
|
||||
setStep("select");
|
||||
|
||||
@@ -3,7 +3,13 @@ import { NextResponse, type NextRequest } from "next/server";
|
||||
import { LOCALES } from "@/lib/utils";
|
||||
|
||||
// TODO: Update the protected pages list
|
||||
const PROTECTED_PAGES = ["/monitor", "/build", "/store/profile", "/store/settings", "/store/dashboard"];
|
||||
const PROTECTED_PAGES = [
|
||||
"/monitor",
|
||||
"/build",
|
||||
"/store/profile",
|
||||
"/store/settings",
|
||||
"/store/dashboard",
|
||||
];
|
||||
const ADMIN_PAGES = ["/admin"];
|
||||
|
||||
export async function updateSession(request: NextRequest, locale: string) {
|
||||
|
||||
@@ -244,7 +244,7 @@ export function getBehaveAs(): BehaveAs {
|
||||
: BehaveAs.LOCAL;
|
||||
}
|
||||
|
||||
export const LOCALES = process.env.NEXT_PUBLIC_LOCALES
|
||||
export const LOCALES = process.env.NEXT_PUBLIC_LOCALES
|
||||
? process.env.NEXT_PUBLIC_LOCALES.split(",").filter(Boolean)
|
||||
: ["en"];
|
||||
export const DEFAULT_LOCALE = process.env.NEXT_PUBLIC_DEFAULT_LOCALE || "en";
|
||||
|
||||
Reference in New Issue
Block a user