feat(base): page renderer dispatches to base view when page.isBase

- Add isBase to page repo baseFields so it is always selected
- Add isBase to sidebar pages query select list
- Add isBase to client IPage type
- In PageContent, render <BaseTable pageId={page.id} /> when page.isBase
  is true instead of the TipTap editor path
This commit is contained in:
Philipinho
2026-04-27 01:49:54 +01:00
parent 060bd1048f
commit 19821d3aeb
4 changed files with 16 additions and 0 deletions
@@ -12,6 +12,7 @@ export interface IPage {
spaceId: string;
workspaceId: string;
isLocked: boolean;
isBase: boolean;
lastUpdatedById: string;
createdAt: Date;
updatedAt: Date;
+13
View File
@@ -13,6 +13,7 @@ import { IconAlertTriangle, IconFileOff } from "@tabler/icons-react";
import { Button } from "@mantine/core";
import { Link } from "react-router-dom";
import { ErrorBoundary } from "react-error-boundary";
import { BaseTable } from "@/features/base/components/base-table";
const MemoizedFullEditor = React.memo(FullEditor);
const MemoizedPageHeader = React.memo(PageHeader);
const MemoizedHistoryModal = React.memo(HistoryModal);
@@ -90,6 +91,18 @@ function PageContent({ pageSlug }: { pageSlug: string | undefined }) {
return <></>;
}
if (page?.isBase) {
return (
<div style={{ display: "flex", flexDirection: "column", height: "100%" }}>
<Helmet>
<title>{`${page?.icon || ""} ${page?.title || t("untitled")}`}</title>
</Helmet>
<MemoizedPageHeader readOnly={!canEdit} />
<BaseTable pageId={page.id} />
</div>
);
}
return (
page && (
<div>