diff --git a/src/lib/api.ts b/src/lib/api.ts index ef5cd53..fa25f50 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -273,27 +273,23 @@ export type CoaCompatibilityStatus = | 'Blocked'; export interface PublicCatalogueItem { - id: string; + id: number; name: string; + full_name: string; owner: string; - repo: string; - description: string; html_url: string; - default_branch: string; + description: string; stars: number; forks: number; - open_issues: number; + default_branch: string; pushed_at?: string | null; - created_at?: string | null; updated_at?: string | null; + license?: string | null; topics: string[]; - category: string; - author_name?: string | null; - license_spdx?: string | null; coa_status: CoaCompatibilityStatus; - coa_notes?: string | null; + coa_status_source: string; conflict_reason?: string | null; - is_curated_coa: boolean; + is_coa_recommended: boolean; } export interface PublicCatalogueResponse { diff --git a/src/screens/ModulesPage.tsx b/src/screens/ModulesPage.tsx index a650935..1449d65 100644 --- a/src/screens/ModulesPage.tsx +++ b/src/screens/ModulesPage.tsx @@ -912,8 +912,8 @@ export function ModulesPage({ const filteredCommunityCatalog = (publicCatalog?.items ?? []) .filter((item) => { // Exclude items already curated in Group A - const slug = item.id.toLowerCase(); - if (verifiedRepoSlugs.has(slug) || verifiedRepoSlugs.has(item.repo.toLowerCase())) { + const slug = (item.full_name || item.name || "").toLowerCase(); + if (verifiedRepoSlugs.has(slug) || verifiedRepoSlugs.has(normalizeUrlSlug(item.html_url))) { return false; } @@ -934,21 +934,21 @@ export function ModulesPage({ if (!catalogQuery.trim()) return true; const q = catalogQuery.toLowerCase(); return ( - item.name.toLowerCase().includes(q) || - item.repo.toLowerCase().includes(q) || - item.owner.toLowerCase().includes(q) || - item.description.toLowerCase().includes(q) || - item.topics.some((t) => t.toLowerCase().includes(q)) + (item.name || "").toLowerCase().includes(q) || + (item.full_name || "").toLowerCase().includes(q) || + (item.owner || "").toLowerCase().includes(q) || + (item.description || "").toLowerCase().includes(q) || + (item.topics || []).some((t) => (t || "").toLowerCase().includes(q)) ); }) .sort((a, b) => { if (catalogSort === "stars") { - return b.stars - a.stars; + return (b.stars || 0) - (a.stars || 0); } if (catalogSort === "updated") { return (b.pushed_at || "").localeCompare(a.pushed_at || ""); } - return a.name.localeCompare(b.name); + return (a.name || "").localeCompare(b.name || ""); }); // Helper to check whether any module/plugin is installed @@ -1964,7 +1964,7 @@ export function ModulesPage({

{item.name}

- {item.id} + {item.full_name}

{item.description || (locale === "ru" ? "Нет описания репозитория." : "No description provided.")}

@@ -1986,15 +1986,9 @@ export function ModulesPage({ {item.forks} - {item.category && ( - - {item.category} - - )} - - {item.license_spdx && ( + {item.license && ( - {item.license_spdx} + {item.license} )} @@ -2005,10 +1999,6 @@ export function ModulesPage({ {item.conflict_reason} - ) : item.coa_notes ? ( -
- {item.coa_notes} -
) : item.topics.length > 0 ? (
{item.topics.slice(0, 3).map((topic) => ( @@ -2222,7 +2212,7 @@ export function ModulesPage({

{selectedPublicModule.name}

- {selectedPublicModule.id} + {selectedPublicModule.full_name}