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: project publish redirection (#5004)

Aaryan Khandelwal86464c1d6f25
diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/header.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/header.tsx
index 351d5cc4ab..b4d7d4bcd3 100644
--- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/header.tsx
+++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/header.tsx
@@ -22,7 +22,7 @@ import {
} from "@/constants/issue";
import { EUserProjectRoles } from "@/constants/project";
// helpers
-import { SPACE_BASE_URL } from "@/helpers/common.helper";
+import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@/helpers/common.helper";
import { calculateTotalFilters } from "@/helpers/filter.helper";
// hooks
import {
@@ -107,8 +107,8 @@ export const ProjectIssuesHeader = observer(() => {
},
[workspaceSlug, projectId, updateFilters]
);
-
- const publishedURL = `${SPACE_BASE_URL}/issues/${currentProjectDetails?.anchor}`;
+ const SPACE_APP_URL = (SPACE_BASE_URL.trim() === "" ? window.location.origin : SPACE_BASE_URL) + SPACE_BASE_PATH;
+ const publishedURL = `${SPACE_APP_URL}/issues/${currentProjectDetails?.anchor}`;
const canUserCreateIssue =
currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole);
diff --git a/web/core/components/project/publish-project/modal.tsx b/web/core/components/project/publish-project/modal.tsx
index 97385c0c63..5496e69939 100644
--- a/web/core/components/project/publish-project/modal.tsx
+++ b/web/core/components/project/publish-project/modal.tsx
@@ -10,7 +10,7 @@ import { IProject, TProjectPublishLayouts, TProjectPublishSettings } from "@plan
// ui
import { Button, Loader, ToggleSwitch, TOAST_TYPE, setToast, CustomSelect, ModalCore, EModalWidth } from "@plane/ui";
// helpers
-import { SPACE_BASE_URL } from "@/helpers/common.helper";
+import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@/helpers/common.helper";
import { copyTextToClipboard } from "@/helpers/string.helper";
// hooks
import { useProjectPublish } from "@/hooks/store";
@@ -156,7 +156,8 @@ export const PublishProjectModal: React.FC<Props> = observer((props) => {
});
}, [projectPublishSettings, reset]);
- const publishLink = `${SPACE_BASE_URL}/issues/${projectPublishSettings?.anchor}`;
+ const SPACE_APP_URL = (SPACE_BASE_URL.trim() === "" ? window.location.origin : SPACE_BASE_URL) + SPACE_BASE_PATH;
+ const publishLink = `${SPACE_APP_URL}/issues/${projectPublishSettings?.anchor}`;
const handleCopyLink = () =>
copyTextToClipboard(publishLink).then(() =>