fix(projects): enable bulk backup/restore selection on project page

This commit is contained in:
Charles GTE
2026-07-05 13:50:33 +02:00
parent fe1d077754
commit 96c51a08c6
@@ -3,6 +3,7 @@ import { Page, PageContent, PageTitle } from "@/features/layout/components/page"
import { ButtonDeleteProject } from "@/features/projects/components/project-delete-button"; import { ButtonDeleteProject } from "@/features/projects/components/project-delete-button";
import { CardsWithPagination } from "@/components/common/cards-with-pagination"; import { CardsWithPagination } from "@/components/common/cards-with-pagination";
import { ProjectDatabaseCard } from "@/features/projects/components/project-database-card"; import { ProjectDatabaseCard } from "@/features/projects/components/project-database-card";
import { ProjectDatabaseSelection } from "@/features/projects/components/project-database-selection";
import { notFound, redirect } from "next/navigation"; import { notFound, redirect } from "next/navigation";
import { db } from "@/db"; import { db } from "@/db";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
@@ -87,20 +88,27 @@ export default async function RoutePage(
</div> </div>
<PageContent className="flex flex-col w-full h-full"> <PageContent className="flex flex-col w-full h-full">
{proj.databases.length > 0 ? ( {proj.databases.length > 0 ? (
<CardsWithPagination isMember ? (
data={[...proj.databases].sort( <CardsWithPagination
(a, b) => data={[...proj.databases].sort(
new Date(b.createdAt).getTime() - (a, b) =>
new Date(a.createdAt).getTime(), new Date(b.createdAt).getTime() -
)} new Date(a.createdAt).getTime(),
organizationSlug={organization.slug} )}
// @ts-ignore organizationSlug={organization.slug}
cardItem={ProjectDatabaseCard} // @ts-ignore
cardsPerPage={20} cardItem={ProjectDatabaseCard}
numberOfColumns={3} cardsPerPage={20}
pageSizeOptions={[10, 20, 50]} numberOfColumns={3}
extendedProps={proj} pageSizeOptions={[10, 20, 50]}
/> extendedProps={proj}
/>
) : (
<ProjectDatabaseSelection
projectId={proj.id}
databases={proj.databases}
/>
)
) : ( ) : (
<div className="flex flex-col items-center justify-center h-full text-muted-foreground py-20"> <div className="flex flex-col items-center justify-center h-full text-muted-foreground py-20">
<p className="text-lg font-medium">No databases found</p> <p className="text-lg font-medium">No databases found</p>