diff --git a/packages/types/src/project/projects.d.ts b/packages/types/src/project/projects.d.ts index ee974fd63..59ccf73b6 100644 --- a/packages/types/src/project/projects.d.ts +++ b/packages/types/src/project/projects.d.ts @@ -32,7 +32,7 @@ export interface IProject { estimate: string | null; id: string; identifier: string; - is_deployed: boolean; + anchor: string | null; is_favorite: boolean; is_member: boolean; logo_props: TLogoProps; diff --git a/web/components/headers/project-issues.tsx b/web/components/headers/project-issues.tsx index 7042d2c28..71d787148 100644 --- a/web/components/headers/project-issues.tsx +++ b/web/components/headers/project-issues.tsx @@ -15,7 +15,7 @@ import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelect import { EIssueFilterType, EIssuesStoreType, ISSUE_DISPLAY_FILTERS_BY_LAYOUT } from "@/constants/issue"; import { EUserProjectRoles } from "@/constants/project"; // helpers -import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@/helpers/common.helper"; +import { SPACE_BASE_URL } from "@/helpers/common.helper"; import { calculateTotalFilters } from "@/helpers/filter.helper"; // hooks import { @@ -100,7 +100,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => { [workspaceSlug, projectId, updateFilters] ); - const DEPLOY_URL = SPACE_BASE_URL + SPACE_BASE_PATH; + const publishedURL = `${SPACE_BASE_URL}/issues/${currentProjectDetails?.anchor}`; const canUserCreateIssue = currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole); @@ -159,9 +159,9 @@ export const ProjectIssuesHeader: React.FC = observer(() => { ) : null} - {currentProjectDetails?.is_deployed && DEPLOY_URL && ( + {currentProjectDetails?.anchor && ( = observer((props) => { workspaceSlug={workspaceSlug} issueId={issueId} activityOperations={activityOperations} - showAccessSpecifier={project.is_deployed} + showAccessSpecifier={!!project.anchor} disabled={disabled} /> {!disabled && ( @@ -150,7 +150,7 @@ export const IssueActivity: FC = observer((props) => { projectId={projectId} workspaceSlug={workspaceSlug} activityOperations={activityOperations} - showAccessSpecifier={project.is_deployed} + showAccessSpecifier={!!project.anchor} /> )} @@ -161,7 +161,7 @@ export const IssueActivity: FC = observer((props) => { workspaceSlug={workspaceSlug} issueId={issueId} activityOperations={activityOperations} - showAccessSpecifier={project.is_deployed} + showAccessSpecifier={!!project.anchor} disabled={disabled} /> {!disabled && ( @@ -170,7 +170,7 @@ export const IssueActivity: FC = observer((props) => { projectId={projectId} workspaceSlug={workspaceSlug} activityOperations={activityOperations} - showAccessSpecifier={project.is_deployed} + showAccessSpecifier={!!project.anchor} /> )} diff --git a/web/components/project/publish-project/modal.tsx b/web/components/project/publish-project/modal.tsx index 565775a55..bec4e7f17 100644 --- a/web/components/project/publish-project/modal.tsx +++ b/web/components/project/publish-project/modal.tsx @@ -143,7 +143,7 @@ export const PublishProjectModal: React.FC = observer((props) => { view_props: formData.view_props, }; - if (formData.id && project.is_deployed) await handleUpdatePublishSettings(payload); + if (formData.id && project.anchor) await handleUpdatePublishSettings(payload); else await handlePublishProject(payload); }; @@ -173,7 +173,7 @@ export const PublishProjectModal: React.FC = observer((props) => {
Publish page
- {project.is_deployed && ( + {project.anchor && ( @@ -190,7 +190,7 @@ export const PublishProjectModal: React.FC = observer((props) => { ) : (
- {project.is_deployed && projectPublishSettings && ( + {project.anchor && projectPublishSettings && ( <>
= observer((props) => { - {project.is_deployed ? ( + {project.anchor ? ( isDirty && (
)} diff --git a/web/store/project/project-publish.store.ts b/web/store/project/project-publish.store.ts index 6ae387ee7..4e08fd6c6 100644 --- a/web/store/project/project-publish.store.ts +++ b/web/store/project/project-publish.store.ts @@ -111,7 +111,7 @@ export class ProjectPublishStore implements IProjectPublishStore { const response = await this.projectPublishService.publishProject(workspaceSlug, projectID, data); runInAction(() => { set(this.publishSettingsMap, [projectID], response); - set(this.projectRootStore.project.projectMap, [projectID, "is_deployed"], true); + set(this.projectRootStore.project.projectMap, [projectID, "anchor"], response.anchor); this.generalLoader = false; }); return response; @@ -175,7 +175,7 @@ export class ProjectPublishStore implements IProjectPublishStore { const response = await this.projectPublishService.unpublishProject(workspaceSlug, projectID, projectPublishId); runInAction(() => { unset(this.publishSettingsMap, [projectID]); - set(this.projectRootStore.project.projectMap, [projectID, "is_deployed"], false); + set(this.projectRootStore.project.projectMap, [projectID, "anchor"], null); this.generalLoader = false; }); return response;