Merge pull request #2151 from makeplane/sync/ce-ee

Sync: Community Changes
This commit is contained in:
pushya22
2025-01-08 15:46:12 +05:30
committed by GitHub
5 changed files with 26 additions and 5 deletions

View File

@@ -1 +0,0 @@
export const ENABLE_MOVE_PAGE = false;

View File

@@ -0,0 +1,14 @@
export type TPageFlagHookArgs = {
workspaceSlug: string;
};
export type TPageFlagHookReturnType = {
isMovePageEnabled: boolean;
};
export const usePageFlag = (args: TPageFlagHookArgs): TPageFlagHookReturnType => {
const {} = args;
return {
isMovePageEnabled: false,
};
};

View File

@@ -2,6 +2,7 @@
import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import {
ArchiveRestoreIcon,
Copy,
@@ -28,8 +29,8 @@ import { cn } from "@/helpers/common.helper";
import { usePageOperations } from "@/hooks/use-page-operations";
// plane web components
import { MovePageModal } from "@/plane-web/components/pages";
// plane web constants
import { ENABLE_MOVE_PAGE } from "@/plane-web/constants";
// plane web hooks
import { usePageFlag } from "@/plane-web/hooks/use-page-flag";
// store types
import { TPageInstance } from "@/store/pages/base-page";
@@ -60,6 +61,12 @@ export const PageActions: React.FC<Props> = observer((props) => {
// states
const [deletePageModal, setDeletePageModal] = useState(false);
const [movePageModal, setMovePageModal] = useState(false);
// params
const { workspaceSlug } = useParams();
// page flag
const { isMovePageEnabled } = usePageFlag({
workspaceSlug: workspaceSlug?.toString() ?? "",
});
// page operations
const { pageOperations } = usePageOperations({
editorRef,
@@ -134,7 +141,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
action: () => setMovePageModal(true),
title: "Move",
icon: FileOutput,
shouldRender: canCurrentUserMovePage && ENABLE_MOVE_PAGE,
shouldRender: canCurrentUserMovePage && isMovePageEnabled,
},
];
if (extraOptions) {
@@ -146,6 +153,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
archived_at,
extraOptions,
is_locked,
isMovePageEnabled,
canCurrentUserArchivePage,
canCurrentUserChangeAccess,
canCurrentUserDeletePage,

View File

@@ -1 +0,0 @@
export const ENABLE_MOVE_PAGE = true;

View File

@@ -0,0 +1 @@
export * from "ce/hooks/use-page-flag";