Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion web/ce/constants/page.ts

This file was deleted.

14 changes: 14 additions & 0 deletions web/ce/hooks/use-page-flag.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
14 changes: 11 additions & 3 deletions web/core/components/pages/dropdowns/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import {
ArchiveRestoreIcon,
Copy,
Expand All @@ -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";

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand All @@ -146,6 +153,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
archived_at,
extraOptions,
is_locked,
isMovePageEnabled,
canCurrentUserArchivePage,
canCurrentUserChangeAccess,
canCurrentUserDeletePage,
Expand Down
1 change: 0 additions & 1 deletion web/ee/constants/page.ts

This file was deleted.

1 change: 1 addition & 0 deletions web/ee/hooks/use-page-flag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "ce/hooks/use-page-flag";
Loading