Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: page link construction (#6312)

Aaryan Khandelwal24cc69fd7bea
diff --git a/web/core/hooks/use-page-operations.ts b/web/core/hooks/use-page-operations.ts
index efe973ad7d..93d8b8ad28 100644
--- a/web/core/hooks/use-page-operations.ts
+++ b/web/core/hooks/use-page-operations.ts
@@ -1,5 +1,4 @@
import { useMemo } from "react";
-import { useParams } from "next/navigation";
// plane editor
import { EditorRefApi } from "@plane/editor";
// plane types
@@ -34,15 +33,22 @@ export const usePageOperations = (
pageOperations: TPageOperations;
} => {
const { page } = props;
- // params
- const { workspaceSlug, projectId } = useParams();
// derived values
- const { access, addToFavorites, archived_at, duplicate, id, is_favorite, is_locked, removePageFromFavorites } = page;
+ const {
+ access,
+ addToFavorites,
+ archived_at,
+ duplicate,
+ is_favorite,
+ is_locked,
+ getRedirectionLink,
+ removePageFromFavorites,
+ } = page;
// collaborative actions
const { executeCollaborativeAction } = useCollaborativePageActions(props);
// page operations
const pageOperations: TPageOperations = useMemo(() => {
- const pageLink = projectId ? `${workspaceSlug}/projects/${projectId}/pages/${id}` : `${workspaceSlug}/pages/${id}`;
+ const pageLink = getRedirectionLink();
return {
copyLink: () => {
@@ -184,12 +190,10 @@ export const usePageOperations = (
archived_at,
duplicate,
executeCollaborativeAction,
- id,
+ getRedirectionLink,
is_favorite,
is_locked,
- projectId,
removePageFromFavorites,
- workspaceSlug,
]);
return {
pageOperations,