mirror of
https://github.com/docmost/docmost.git
synced 2026-07-25 09:34:49 +10:00
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:
@@ -12,6 +12,7 @@ export interface IPage {
|
||||
spaceId: string;
|
||||
workspaceId: string;
|
||||
isLocked: boolean;
|
||||
isBase: boolean;
|
||||
lastUpdatedById: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user