From 26ba4d71c315bbaa6287168e844b8db0a0913b2a Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Mon, 29 May 2023 15:38:35 +0530 Subject: [PATCH] fix: order by last updated, cycles empty state alignment (#1151) * fix: order by last updated * fix: cycles empty space alignment, chore: new meta tags * chore: update meta tags --- .../auth-screens/not-authorized-view.tsx | 7 +- .../auth-screens/workspace/not-a-member.tsx | 60 +++++------- .../app/components/issues/sub-issues-list.tsx | 15 +-- apps/app/constants/issue.ts | 2 +- apps/app/constants/seo-variables.ts | 12 +-- .../project-authorization-wrapper.tsx | 16 +--- .../workspace-authorization-wrapper.tsx | 94 ++++++++----------- apps/app/layouts/container.tsx | 69 -------------- apps/app/layouts/default-layout/index.tsx | 21 +---- apps/app/pages/404.tsx | 7 +- .../[workspaceSlug]/me/profile/activity.tsx | 3 - .../[workspaceSlug]/me/profile/index.tsx | 3 - .../me/profile/preferences.tsx | 3 - .../projects/[projectId]/cycles/index.tsx | 3 - .../projects/[projectId]/modules/index.tsx | 3 - .../projects/[projectId]/pages/[pageId].tsx | 3 - .../projects/[projectId]/pages/index.tsx | 3 - .../projects/[projectId]/views/index.tsx | 3 - .../pages/[workspaceSlug]/settings/index.tsx | 3 - apps/app/pages/_app.tsx | 28 +++++- apps/app/pages/{_error.js => _error.tsx} | 29 +----- apps/app/pages/error.tsx | 7 +- apps/app/pages/invitations.tsx | 8 +- apps/app/pages/magic-sign-in.tsx | 6 +- apps/app/pages/signin.tsx | 6 +- apps/app/types/issues.d.ts | 2 +- 26 files changed, 119 insertions(+), 297 deletions(-) delete mode 100644 apps/app/layouts/container.tsx rename apps/app/pages/{_error.js => _error.tsx} (70%) diff --git a/apps/app/components/auth-screens/not-authorized-view.tsx b/apps/app/components/auth-screens/not-authorized-view.tsx index dc1db8a21..0ebc85fb4 100644 --- a/apps/app/components/auth-screens/not-authorized-view.tsx +++ b/apps/app/components/auth-screens/not-authorized-view.tsx @@ -21,12 +21,7 @@ export const NotAuthorizedView: React.FC = ({ actionButton, type }) => { const { asPath: currentPath } = useRouter(); return ( - +
{ - const router = useRouter(); - - return ( - -
-
-
-

Not Authorized!

-

- You{"'"}re not a member of this workspace. Please contact the workspace admin to get - an invitation or check your pending invitations. -

-
- +export const NotAWorkspaceMember = () => ( + +
+
+
+

Not Authorized!

+

+ You{"'"}re not a member of this workspace. Please contact the workspace admin to get an + invitation or check your pending invitations. +

+
+
- - ); -}; +
+
+); diff --git a/apps/app/components/issues/sub-issues-list.tsx b/apps/app/components/issues/sub-issues-list.tsx index 85f05a3c9..351bf47c5 100644 --- a/apps/app/components/issues/sub-issues-list.tsx +++ b/apps/app/components/issues/sub-issues-list.tsx @@ -165,15 +165,10 @@ export const SubIssuesList: FC = ({ parentIssue }) => { }); }; - const completedSubIssues = - subIssuesResponse && subIssuesResponse.state_distribution - ? (subIssuesResponse?.state_distribution.completed - ? subIssuesResponse?.state_distribution.completed - : 0) + - (subIssuesResponse?.state_distribution.cancelled - ? subIssuesResponse?.state_distribution.cancelled - : 0) - : 0; + const completedSubIssues = subIssuesResponse + ? subIssuesResponse?.state_distribution.completed + + subIssuesResponse?.state_distribution.cancelled + : 0; const totalSubIssues = subIssuesResponse && subIssuesResponse.sub_issues ? subIssuesResponse?.sub_issues.length : 0; @@ -278,7 +273,7 @@ export const SubIssuesList: FC = ({ parentIssue }) => { key={issue.id} href={`/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`} > - +
= [ { name: "Manual", key: "sort_order" }, { name: "Last created", key: "-created_at" }, - { name: "Last updated", key: "updated_at" }, + { name: "Last updated", key: "-updated_at" }, { name: "Priority", key: "priority" }, ]; diff --git a/apps/app/constants/seo-variables.ts b/apps/app/constants/seo-variables.ts index 2b2d876d2..aafd5f7a3 100644 --- a/apps/app/constants/seo-variables.ts +++ b/apps/app/constants/seo-variables.ts @@ -1,8 +1,8 @@ -export const SITE_NAME = "Plane"; -export const SITE_TITLE = "Plane | Accelerate software development with peace."; +export const SITE_NAME = "Plane | Simple, extensible, open-source project management tool."; +export const SITE_TITLE = "Plane | Simple, extensible, open-source project management tool."; export const SITE_DESCRIPTION = - "Plane accelerated the software development by order of magnitude for agencies and product companies."; + "Open-source project management tool to manage issues, sprints, and product roadmaps with peace of mind."; export const SITE_KEYWORDS = - "software development, plan, ship, software, accelerate, code management, release management"; -export const SITE_URL = "http://localhost:3000/"; -export const TWITTER_USER_NAME = "caravel"; + "software development, plan, ship, software, accelerate, code management, release management, project management, issue tracking, agile, scrum, kanban, collaboration"; +export const SITE_URL = "https://app.plane.so/"; +export const TWITTER_USER_NAME = "Plane | Simple, extensible, open-source project management tool."; diff --git a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx index eec8a8f2e..e19ea6b70 100644 --- a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx @@ -5,10 +5,7 @@ import { useRouter } from "next/router"; // contexts import { useProjectMyMembership, ProjectMemberProvider } from "contexts/project-member.context"; -// hooks -import useIssuesView from "hooks/use-issues-view"; // layouts -import Container from "layouts/container"; import AppHeader from "layouts/app-layout/app-header"; import AppSidebar from "layouts/app-layout/app-sidebar"; // components @@ -19,15 +16,7 @@ import { PrimaryButton, Spinner } from "components/ui"; // icons import { LayerDiagonalIcon } from "components/icons"; -type Meta = { - title?: string | null; - description?: string | null; - image?: string | null; - url?: string | null; -}; - type Props = { - meta?: Meta; children: React.ReactNode; noHeader?: boolean; bg?: "primary" | "secondary"; @@ -43,7 +32,6 @@ export const ProjectAuthorizationWrapper: React.FC = (props) => ( ); const ProjectAuthorizationWrapped: React.FC = ({ - meta, children, noHeader = false, bg = "primary", @@ -61,7 +49,7 @@ const ProjectAuthorizationWrapped: React.FC = ({ const settingsLayout = router.pathname.includes("/settings"); return ( - + <>
@@ -126,6 +114,6 @@ const ProjectAuthorizationWrapped: React.FC = ({ )}
-
+ ); }; diff --git a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx index 4bc5156b7..e67424758 100644 --- a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx @@ -8,7 +8,6 @@ import useSWR from "swr"; // services import workspaceServices from "services/workspace.service"; // layouts -import Container from "layouts/container"; import AppSidebar from "layouts/app-layout/app-sidebar"; import AppHeader from "layouts/app-layout/app-header"; import { UserAuthorizationLayout } from "./user-authorization-wrapper"; @@ -21,15 +20,7 @@ import { LayerDiagonalIcon } from "components/icons"; // fetch-keys import { WORKSPACE_MEMBERS_ME } from "constants/fetch-keys"; -type Meta = { - title?: string | null; - description?: string | null; - image?: string | null; - url?: string | null; -}; - type Props = { - meta?: Meta; children: React.ReactNode; noHeader?: boolean; bg?: "primary" | "secondary"; @@ -39,7 +30,6 @@ type Props = { }; export const WorkspaceAuthorizationLayout: React.FC = ({ - meta, children, noHeader = false, bg = "primary", @@ -88,50 +78,48 @@ export const WorkspaceAuthorizationLayout: React.FC = ({ return ( - - -
- - {settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? ( - - - - Go to workspace - - - - } - type="workspace" - /> - ) : ( -
- {!noHeader && ( - - )} -
-
- {children} -
+ +
+ + {settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? ( + + + + Go to workspace + + + + } + type="workspace" + /> + ) : ( +
+ {!noHeader && ( + + )} +
+
+ {children}
-
- )} -
- +
+
+ )} +
); }; diff --git a/apps/app/layouts/container.tsx b/apps/app/layouts/container.tsx deleted file mode 100644 index 5adf9430b..000000000 --- a/apps/app/layouts/container.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from "react"; -// next -import Head from "next/head"; -import { useRouter } from "next/router"; -// constants -import { - SITE_NAME, - SITE_DESCRIPTION, - SITE_URL, - TWITTER_USER_NAME, - SITE_KEYWORDS, - SITE_TITLE, -} from "constants/seo-variables"; - -type Meta = { - title?: string | null; - description?: string | null; - image?: string | null; - url?: string | null; -}; - -type Props = { - meta?: Meta; - children: React.ReactNode; - noPadding?: boolean; - bg?: "primary" | "secondary"; - noHeader?: boolean; - breadcrumbs?: JSX.Element; - left?: JSX.Element; - right?: JSX.Element; -}; - -const Container = ({ meta, children }: Props) => { - const router = useRouter(); - const image = meta?.image || "/site-image.png"; - const title = meta?.title || SITE_TITLE; - const url = meta?.url || `${SITE_URL}${router.asPath}`; - const description = meta?.description || SITE_DESCRIPTION; - - return ( - <> - - {title} - - - - - - - - - - - - - - {image && ( - - )} - - {children} - - ); -}; - -export default Container; diff --git a/apps/app/layouts/default-layout/index.tsx b/apps/app/layouts/default-layout/index.tsx index b615ab548..cce155906 100644 --- a/apps/app/layouts/default-layout/index.tsx +++ b/apps/app/layouts/default-layout/index.tsx @@ -1,15 +1,4 @@ -// layouts -import Container from "layouts/container"; - -type Meta = { - title?: string | null; - description?: string | null; - image?: string | null; - url?: string | null; -}; - type Props = { - meta?: Meta; children: React.ReactNode; noPadding?: boolean; bg?: "primary" | "secondary"; @@ -19,12 +8,10 @@ type Props = { right?: JSX.Element; }; -const DefaultLayout: React.FC = ({ meta, children }) => ( - -
- <>{children} -
-
+const DefaultLayout: React.FC = ({ children }) => ( +
+ <>{children} +
); export default DefaultLayout; diff --git a/apps/app/pages/404.tsx b/apps/app/pages/404.tsx index 2a136a164..a70bc2345 100644 --- a/apps/app/pages/404.tsx +++ b/apps/app/pages/404.tsx @@ -13,12 +13,7 @@ import Image404 from "public/404.svg"; import type { NextPage } from "next"; const PageNotFound: NextPage = () => ( - +
diff --git a/apps/app/pages/[workspaceSlug]/me/profile/activity.tsx b/apps/app/pages/[workspaceSlug]/me/profile/activity.tsx index 64e300ce0..db9b1e55b 100644 --- a/apps/app/pages/[workspaceSlug]/me/profile/activity.tsx +++ b/apps/app/pages/[workspaceSlug]/me/profile/activity.tsx @@ -18,9 +18,6 @@ const ProfileActivity = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/me/profile/index.tsx b/apps/app/pages/[workspaceSlug]/me/profile/index.tsx index b6c3d36b9..0d1782563 100644 --- a/apps/app/pages/[workspaceSlug]/me/profile/index.tsx +++ b/apps/app/pages/[workspaceSlug]/me/profile/index.tsx @@ -123,9 +123,6 @@ const Profile: NextPage = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx index 5ea79014d..6b48d9aa3 100644 --- a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx +++ b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx @@ -29,9 +29,6 @@ const ProfilePreferences = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 4573cd53c..0e56ad57e 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -89,9 +89,6 @@ const ProjectCycles: NextPage = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx index 3fa24e332..7e2cd1565 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx @@ -66,9 +66,6 @@ const ProjectModules: NextPage = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index d70559d3f..61b49a049 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -290,9 +290,6 @@ const SinglePage: NextPage = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx index 0d5d1252a..dba6cce54 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx @@ -100,9 +100,6 @@ const ProjectPages: NextPage = () => { handleClose={() => setCreateUpdatePageModal(false)} /> diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx index c796525f6..6d2798d87 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx @@ -60,9 +60,6 @@ const ProjectViews: NextPage = () => { return ( diff --git a/apps/app/pages/[workspaceSlug]/settings/index.tsx b/apps/app/pages/[workspaceSlug]/settings/index.tsx index 8ebf74aa3..0913b28ab 100644 --- a/apps/app/pages/[workspaceSlug]/settings/index.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/index.tsx @@ -146,9 +146,6 @@ const WorkspaceSettings: NextPage = () => { return ( diff --git a/apps/app/pages/_app.tsx b/apps/app/pages/_app.tsx index 0f50b3b8c..61788592a 100644 --- a/apps/app/pages/_app.tsx +++ b/apps/app/pages/_app.tsx @@ -10,8 +10,8 @@ import "styles/command-pallette.css"; import "styles/nprogress.css"; import "styles/react-datepicker.css"; -// router import Router from "next/router"; +import Head from "next/head"; // nprogress import NProgress from "nprogress"; @@ -24,6 +24,15 @@ import { ThemeContextProvider } from "contexts/theme.context"; import type { AppProps } from "next/app"; // constants import { THEMES } from "constants/themes"; +// constants +import { + SITE_NAME, + SITE_DESCRIPTION, + SITE_URL, + TWITTER_USER_NAME, + SITE_KEYWORDS, + SITE_TITLE, +} from "constants/seo-variables"; const CrispWithNoSSR = dynamic(() => import("constants/crisp"), { ssr: false }); @@ -39,7 +48,22 @@ function MyApp({ Component, pageProps }: AppProps) { - + {" "} + + {SITE_TITLE} + + + + + + + + + + + + + diff --git a/apps/app/pages/_error.js b/apps/app/pages/_error.tsx similarity index 70% rename from apps/app/pages/_error.js rename to apps/app/pages/_error.tsx index a615a24dc..0d1605484 100644 --- a/apps/app/pages/_error.js +++ b/apps/app/pages/_error.tsx @@ -1,21 +1,3 @@ -/** - * NOTE: This requires `@sentry/nextjs` version 7.3.0 or higher. - * - * NOTE: If using this with `next` version 12.2.0 or lower, uncomment the - * penultimate line in `CustomErrorComponent`. - * - * This page is loaded by Nextjs: - * - on the server, when data-fetching methods throw or reject - * - on the client, when `getInitialProps` throws or rejects - * - on the client, when a React lifecycle method throws or rejects, and it's - * caught by the built-in Nextjs error boundary - * - * See: - * - https://nextjs.org/docs/basic-features/data-fetching/overview - * - https://nextjs.org/docs/api-reference/data-fetching/get-initial-props - * - https://reactjs.org/docs/error-boundaries.html - */ - import * as Sentry from "@sentry/nextjs"; import { useRouter } from "next/router"; @@ -48,12 +30,7 @@ const CustomErrorComponent = () => { }; return ( - +
@@ -91,9 +68,7 @@ const CustomErrorComponent = () => { ); }; -CustomErrorComponent.getInitialProps = async (contextData) => { - // In case this is running in a serverless function, await this in order to give Sentry - // time to send the error before the lambda exits +CustomErrorComponent.getInitialProps = async (contextData: any) => { await Sentry.captureUnderscoreErrorException(contextData); const { res, err } = contextData; diff --git a/apps/app/pages/error.tsx b/apps/app/pages/error.tsx index 3909a1268..19663e68e 100644 --- a/apps/app/pages/error.tsx +++ b/apps/app/pages/error.tsx @@ -6,12 +6,7 @@ import DefaultLayout from "layouts/default-layout"; import type { NextPage } from "next"; const ErrorPage: NextPage = () => ( - +

Error!

diff --git a/apps/app/pages/invitations.tsx b/apps/app/pages/invitations.tsx index a288f87fb..21f6e25a7 100644 --- a/apps/app/pages/invitations.tsx +++ b/apps/app/pages/invitations.tsx @@ -80,13 +80,7 @@ const OnBoard: NextPage = () => { return ( - +
{user && (
diff --git a/apps/app/pages/magic-sign-in.tsx b/apps/app/pages/magic-sign-in.tsx index 521373685..f7308d1d2 100644 --- a/apps/app/pages/magic-sign-in.tsx +++ b/apps/app/pages/magic-sign-in.tsx @@ -48,11 +48,7 @@ const MagicSignIn: NextPage = () => { }, [password, key, mutateUser, router]); return ( - +
{isSigningIn ? (
diff --git a/apps/app/pages/signin.tsx b/apps/app/pages/signin.tsx index ee2469b86..26d6832f1 100644 --- a/apps/app/pages/signin.tsx +++ b/apps/app/pages/signin.tsx @@ -90,11 +90,7 @@ const SignInPage: NextPage = () => { ); return ( - + {isLoading ? (

Signing in. Please wait...

diff --git a/apps/app/types/issues.d.ts b/apps/app/types/issues.d.ts index 5caabd131..e06d81169 100644 --- a/apps/app/types/issues.d.ts +++ b/apps/app/types/issues.d.ts @@ -267,7 +267,7 @@ export type TIssueViewOptions = "list" | "kanban" | "calendar" | "gantt_chart"; export type TIssueGroupByOptions = "state" | "priority" | "labels" | "created_by" | null; -export type TIssueOrderByOptions = "-created_at" | "updated_at" | "priority" | "sort_order"; +export type TIssueOrderByOptions = "-created_at" | "-updated_at" | "priority" | "sort_order"; export interface IIssueViewOptions { group_by: TIssueGroupByOptions;