mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix(projects): enable bulk backup/restore selection on project page
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user