fix: seo fixes

This commit is contained in:
sriram veeraghanta 2023-08-30 16:51:13 +05:30
parent 061717f0af
commit 91910d106c
11 changed files with 157 additions and 127 deletions

View File

@ -15,7 +15,7 @@ import { RootStore } from "store/root";
export const NavbarTheme = observer(() => { export const NavbarTheme = observer(() => {
const store: RootStore = useMobxStore(); const store: RootStore = useMobxStore();
const { setTheme, theme } = useTheme(); const { setTheme, theme = "light" } = useTheme();
const handleTheme = () => { const handleTheme = () => {
store?.theme?.setTheme(store?.theme?.theme === "light" ? "dark" : "light"); store?.theme?.setTheme(store?.theme?.theme === "light" ? "dark" : "light");

View File

@ -0,0 +1,66 @@
import { useRouter } from "next/router";
import { observer } from "mobx-react-lite";
// components
import { IssueListView } from "components/issues/board-views/list";
import { IssueKanbanView } from "components/issues/board-views/kanban";
import { IssueCalendarView } from "components/issues/board-views/calendar";
import { IssueSpreadsheetView } from "components/issues/board-views/spreadsheet";
import { IssueGanttView } from "components/issues/board-views/gantt";
import { IssuePeekOverview } from "components/issues/peek-overview";
// mobx store
import { RootStore } from "store/root";
import { useMobxStore } from "lib/mobx/store-provider";
export const ProjectDetailsView = () => {
const router = useRouter();
const { workspace_slug } = router.query;
const store: RootStore = useMobxStore();
const activeIssueId = store.issue.activePeekOverviewIssueId;
return (
<div className="relative w-full h-full overflow-hidden">
{workspace_slug && (
<IssuePeekOverview
isOpen={Boolean(activeIssueId)}
onClose={() => store.issue.setActivePeekOverviewIssueId(null)}
issue={store?.issue?.issues?.find((_issue) => _issue.id === activeIssueId) || null}
workspaceSlug={workspace_slug.toString()}
/>
)}
{store?.issue?.loader && !store.issue.issues ? (
<div className="text-sm text-center py-10 text-custom-text-100">Loading...</div>
) : (
<>
{store?.issue?.error ? (
<div className="text-sm text-center py-10 bg-custom-background-200 text-custom-text-100">
Something went wrong.
</div>
) : (
store?.issue?.currentIssueBoardView && (
<>
{store?.issue?.currentIssueBoardView === "list" && (
<div className="relative w-full h-full overflow-y-auto">
<div className="mx-auto px-4">
<IssueListView />
</div>
</div>
)}
{store?.issue?.currentIssueBoardView === "kanban" && (
<div className="relative w-full h-full mx-auto px-9 py-5">
<IssueKanbanView />
</div>
)}
{store?.issue?.currentIssueBoardView === "calendar" && <IssueCalendarView />}
{store?.issue?.currentIssueBoardView === "spreadsheet" && <IssueSpreadsheetView />}
{store?.issue?.currentIssueBoardView === "gantt" && <IssueGanttView />}
</>
)
)}
</>
)}
</div>
);
};

View File

@ -1,8 +1,7 @@
export const SITE_NAME = "Plane | Simple, extensible, open-source project management tool."; export const SITE_NAME = "Plane Deploy | Make your Plane boards and roadmaps pubic with just one-click. ";
export const SITE_TITLE = "Plane | Simple, extensible, open-source project management tool."; export const SITE_TITLE = "Plane Deploy | Make your Plane boards public with one-click";
export const SITE_DESCRIPTION = export const SITE_DESCRIPTION = "Plane Deploy is a customer feedback management tool built on top of plane.so";
"Open-source project management tool to manage issues, sprints, and product roadmaps with peace of mind.";
export const SITE_KEYWORDS = export const SITE_KEYWORDS =
"software development, plan, ship, software, accelerate, code management, release management, project management, issue tracking, agile, scrum, kanban, collaboration"; "software development, customer feedback, software, accelerate, code management, release management, project management, issue tracking, agile, scrum, kanban, collaboration";
export const SITE_URL = "https://app.plane.so/"; export const SITE_URL = "https://app.plane.so/";
export const TWITTER_USER_NAME = "Plane | Simple, extensible, open-source project management tool."; export const TWITTER_USER_NAME = "planepowers";

View File

@ -1,27 +1,19 @@
import { useEffect, useState } from "react"; import { useEffect } from "react";
import type { GetServerSideProps } from "next";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
// mobx import Head from "next/head";
import { observer } from "mobx-react-lite";
// components
import { IssueListView } from "components/issues/board-views/list";
import { IssueKanbanView } from "components/issues/board-views/kanban";
import { IssueCalendarView } from "components/issues/board-views/calendar";
import { IssueSpreadsheetView } from "components/issues/board-views/spreadsheet";
import { IssueGanttView } from "components/issues/board-views/gantt";
import { IssuePeekOverview } from "components/issues/peek-overview";
// mobx store
import { RootStore } from "store/root";
import { useMobxStore } from "lib/mobx/store-provider";
// types // types
import { TIssueBoardKeys } from "store/types"; import { TIssueBoardKeys } from "store/types";
import ProjectLayout from "layouts/project-layout"; import ProjectLayout from "layouts/project-layout";
import { ProjectDetailsView } from "components/views/project-details";
const WorkspaceProjectPage = () => { const WorkspaceProjectPage = (props: any) => {
const store: RootStore = useMobxStore(); console.log("props", props);
const SITE_TITLE = props?.project_settings?.project_details?.name || "Plane | Deploy";
const router = useRouter(); const router = useRouter();
const activeIssueId = store.issue.activePeekOverviewIssueId; // const activeIssueId = store.issue.activePeekOverviewIssueId;
const { workspace_slug, project_slug, board, states, labels, priorities } = router.query as { const { workspace_slug, project_slug, board, states, labels, priorities } = router.query as {
workspace_slug: string; workspace_slug: string;
@ -33,124 +25,96 @@ const WorkspaceProjectPage = () => {
}; };
// updating default board view when we are in the issues page // updating default board view when we are in the issues page
useEffect(() => { // useEffect(() => {
if (workspace_slug && project_slug && store?.project?.workspaceProjectSettings) { // if (workspace_slug && project_slug && store?.project?.workspaceProjectSettings) {
const workspacePRojectSettingViews = store?.project?.workspaceProjectSettings?.views; // const workspaceProjectSettingViews = store?.project?.workspaceProjectSettings?.views;
const userAccessViews: TIssueBoardKeys[] = []; // const userAccessViews: TIssueBoardKeys[] = [];
Object.keys(workspacePRojectSettingViews).filter((_key) => { // Object.keys(workspaceProjectSettingViews).filter((_key) => {
if (_key === "list" && workspacePRojectSettingViews.list === true) userAccessViews.push(_key); // if (_key === "list" && workspaceProjectSettingViews.list === true) userAccessViews.push(_key);
if (_key === "kanban" && workspacePRojectSettingViews.kanban === true) userAccessViews.push(_key); // if (_key === "kanban" && workspaceProjectSettingViews.kanban === true) userAccessViews.push(_key);
if (_key === "calendar" && workspacePRojectSettingViews.calendar === true) userAccessViews.push(_key); // if (_key === "calendar" && workspaceProjectSettingViews.calendar === true) userAccessViews.push(_key);
if (_key === "spreadsheet" && workspacePRojectSettingViews.spreadsheet === true) userAccessViews.push(_key); // if (_key === "spreadsheet" && workspaceProjectSettingViews.spreadsheet === true) userAccessViews.push(_key);
if (_key === "gantt" && workspacePRojectSettingViews.gantt === true) userAccessViews.push(_key); // if (_key === "gantt" && workspaceProjectSettingViews.gantt === true) userAccessViews.push(_key);
}); // });
let url = `/${workspace_slug}/${project_slug}`; // let url = `/${workspace_slug}/${project_slug}`;
let _board = board; // let _board = board;
if (userAccessViews && userAccessViews.length > 0) { // if (userAccessViews && userAccessViews.length > 0) {
if (!board) { // if (!board) {
store.issue.setCurrentIssueBoardView(userAccessViews[0]); // store.issue.setCurrentIssueBoardView(userAccessViews[0]);
_board = userAccessViews[0]; // _board = userAccessViews[0];
} else { // } else {
if (userAccessViews.includes(board)) { // if (userAccessViews.includes(board)) {
if (store.issue.currentIssueBoardView === null) store.issue.setCurrentIssueBoardView(board); // if (store.issue.currentIssueBoardView === null) store.issue.setCurrentIssueBoardView(board);
else { // else {
if (board === store.issue.currentIssueBoardView) { // if (board === store.issue.currentIssueBoardView) {
_board = board; // _board = board;
} else { // } else {
_board = board; // _board = board;
store.issue.setCurrentIssueBoardView(board); // store.issue.setCurrentIssueBoardView(board);
} // }
} // }
} else { // } else {
store.issue.setCurrentIssueBoardView(userAccessViews[0]); // store.issue.setCurrentIssueBoardView(userAccessViews[0]);
_board = userAccessViews[0]; // _board = userAccessViews[0];
} // }
} // }
} // }
_board = _board || "list"; // _board = _board || "list";
url = `${url}?board=${_board}`; // url = `${url}?board=${_board}`;
if (states) url = `${url}&states=${states}`; // if (states) url = `${url}&states=${states}`;
if (labels) url = `${url}&labels=${labels}`; // if (labels) url = `${url}&labels=${labels}`;
if (priorities) url = `${url}&priorities=${priorities}`; // if (priorities) url = `${url}&priorities=${priorities}`;
url = decodeURIComponent(url); // url = decodeURIComponent(url);
router.replace(url); // router.replace(url);
} // }
}, [ // }, [
workspace_slug, // workspace_slug,
project_slug, // project_slug,
board, // board,
router, // router,
store?.issue, // store?.issue,
store?.project?.workspaceProjectSettings, // store?.project?.workspaceProjectSettings,
states, // states,
labels, // labels,
priorities, // priorities,
]); // ]);
useEffect(() => { // useEffect(() => {
if (!workspace_slug || !project_slug) return; // if (!workspace_slug || !project_slug) return;
const params = { // const params = {
state: states || null, // state: states || null,
labels: labels || null, // labels: labels || null,
priority: priorities || null, // priority: priorities || null,
}; // };
store?.project?.getProjectSettingsAsync(workspace_slug, project_slug); // store?.project?.getProjectSettingsAsync(workspace_slug, project_slug);
store?.issue?.getIssuesAsync(workspace_slug, project_slug, params); // store?.issue?.getIssuesAsync(workspace_slug, project_slug, params);
}, [workspace_slug, project_slug, store?.project, store?.issue, states, labels, priorities]); // }, [workspace_slug, project_slug, store?.project, store?.issue, states, labels, priorities]);
return ( return (
<ProjectLayout> <ProjectLayout>
<div className="relative w-full h-full overflow-hidden"> <Head>
<IssuePeekOverview <title>{SITE_TITLE}</title>
isOpen={Boolean(activeIssueId)} </Head>
onClose={() => store.issue.setActivePeekOverviewIssueId(null)} <ProjectDetailsView />
issue={store?.issue?.issues?.find((_issue) => _issue.id === activeIssueId) || null}
workspaceSlug={workspace_slug}
/>
{store?.issue?.loader && !store.issue.issues ? (
<div className="text-sm text-center py-10 text-custom-text-100">Loading...</div>
) : (
<>
{store?.issue?.error ? (
<div className="text-sm text-center py-10 bg-custom-background-200 text-custom-text-100">
Something went wrong.
</div>
) : (
store?.issue?.currentIssueBoardView && (
<>
{store?.issue?.currentIssueBoardView === "list" && (
<div className="relative w-full h-full overflow-y-auto">
<div className="mx-auto px-4">
<IssueListView />
</div>
</div>
)}
{store?.issue?.currentIssueBoardView === "kanban" && (
<div className="relative w-full h-full mx-auto px-9 py-5">
<IssueKanbanView />
</div>
)}
{store?.issue?.currentIssueBoardView === "calendar" && <IssueCalendarView />}
{store?.issue?.currentIssueBoardView === "spreadsheet" && <IssueSpreadsheetView />}
{store?.issue?.currentIssueBoardView === "gantt" && <IssueGanttView />}
</>
)
)}
</>
)}
</div>
</ProjectLayout> </ProjectLayout>
); );
}; };
export default observer(WorkspaceProjectPage); export const getServerSideProps: GetServerSideProps<any> = async ({ query: { workspace_slug, project_slug } }) => {
const res = await fetch(
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/workspaces/${workspace_slug}/project-boards/${project_slug}/settings/`
);
const project_settings = await res.json();
return { props: { project_settings } };
};
export default WorkspaceProjectPage;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

View File

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}