mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
fix: type errors
This commit is contained in:
@@ -24,6 +24,8 @@ import { EPageAccess } from "@/constants/page";
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// plane web components
|
||||
import { MovePageModal } from "@/plane-web/components/pages";
|
||||
// store types
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
export type TPageActions =
|
||||
| "full-screen"
|
||||
@@ -64,13 +66,13 @@ type Props = {
|
||||
extraOptions?: (TContextMenuItem & { key: TPageActions })[];
|
||||
optionsOrder: TPageActions[];
|
||||
pageConfig: TPageConfig;
|
||||
pageId: string;
|
||||
page: IPage;
|
||||
pageOperations: TPageOperations;
|
||||
parentRef?: React.RefObject<HTMLElement>;
|
||||
};
|
||||
|
||||
export const PageActions: React.FC<Props> = observer((props) => {
|
||||
const { extraOptions, optionsOrder, pageConfig, pageId, pageOperations, parentRef } = props;
|
||||
const { extraOptions, optionsOrder, pageConfig, page, pageOperations, parentRef } = props;
|
||||
// states
|
||||
const [deletePageModal, setDeletePageModal] = useState(false);
|
||||
const [movePageModal, setMovePageModal] = useState(false);
|
||||
@@ -147,8 +149,8 @@ export const PageActions: React.FC<Props> = observer((props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<MovePageModal isOpen={movePageModal} onClose={() => setMovePageModal(false)} pageId={pageId} />
|
||||
<DeletePageModal isOpen={deletePageModal} onClose={() => setDeletePageModal(false)} pageId={pageId} />
|
||||
<MovePageModal isOpen={movePageModal} onClose={() => setMovePageModal(false)} page={page} />
|
||||
<DeletePageModal isOpen={deletePageModal} onClose={() => setDeletePageModal(false)} pageId={page.id ?? ""} />
|
||||
{parentRef && <ContextMenu parentRef={parentRef} items={arrangedOptions} />}
|
||||
<CustomMenu placement="bottom-end" optionsClassName="max-h-[90vh]" ellipsis closeOnSelect>
|
||||
{arrangedOptions.map((item) => {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { ArrowUpToLine, Clipboard, History } from "lucide-react";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { ArrowUpToLine, Clipboard, History } from "lucide-react";
|
||||
// document editor
|
||||
import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor";
|
||||
// ui
|
||||
@@ -106,7 +106,7 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
|
||||
shouldRender: true,
|
||||
},
|
||||
],
|
||||
[editorRef, isFullWidth, router, updateQueryParams]
|
||||
[editorRef, handleFullWidth, isFullWidth, router, updateQueryParams]
|
||||
);
|
||||
|
||||
const pageOperations: TPageOperations = useMemo(() => {
|
||||
@@ -241,8 +241,8 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
|
||||
unlock,
|
||||
workspaceSlug,
|
||||
]);
|
||||
const pageConfig: TPageConfig = useMemo(() => {
|
||||
return {
|
||||
const pageConfig: TPageConfig = useMemo(
|
||||
() => ({
|
||||
canArchive: canCurrentUserArchivePage,
|
||||
canLock: canCurrentUserLockPage,
|
||||
canMove: canCurrentUserMovePage,
|
||||
@@ -252,15 +252,19 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
|
||||
isArchived: !!archived_at,
|
||||
isLocked: is_locked,
|
||||
pageAccess: access ?? 0,
|
||||
};
|
||||
}, [
|
||||
archived_at,
|
||||
canCurrentUserArchivePage,
|
||||
canCurrentUserChangeAccess,
|
||||
canCurrentUserDeletePage,
|
||||
canCurrentUserDuplicatePage,
|
||||
canCurrentUserLockPage,
|
||||
]);
|
||||
}),
|
||||
[
|
||||
access,
|
||||
archived_at,
|
||||
canCurrentUserArchivePage,
|
||||
canCurrentUserChangeAccess,
|
||||
canCurrentUserDeletePage,
|
||||
canCurrentUserDuplicatePage,
|
||||
canCurrentUserLockPage,
|
||||
canCurrentUserMovePage,
|
||||
is_locked,
|
||||
]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -284,7 +288,7 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
|
||||
"export",
|
||||
]}
|
||||
pageConfig={pageConfig}
|
||||
pageId={page.id ?? ""}
|
||||
page={page}
|
||||
pageOperations={pageOperations}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -279,7 +279,7 @@ export const BlockItemAction: FC<Props> = observer((props) => {
|
||||
"delete",
|
||||
]}
|
||||
pageConfig={pageConfig}
|
||||
pageId={pageId}
|
||||
page={page}
|
||||
pageOperations={pageOperations}
|
||||
parentRef={parentRef}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user