🔥🔥🔥 Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-904] chore: feature validation empty state (#4145)
Anmol Singh Bhatia74a88fc02851
diff --git a/web/constants/empty-state.ts b/web/constants/empty-state.tsindex 808b5470dc..20589db002 100644--- a/web/constants/empty-state.ts+++ b/web/constants/empty-state.ts@@ -92,6 +92,10 @@ export enum EmptyStateType {ACTIVE_CYCLE_LABEL_EMPTY_STATE = "active-cycle-label-empty-state",DISABLED_PROJECT_INBOX = "disabled-project-inbox",+ DISABLED_PROJECT_CYCLE = "disabled-project-cycle",+ DISABLED_PROJECT_MODULE = "disabled-project-module",+ DISABLED_PROJECT_VIEW = "disabled-project-view",+ DISABLED_PROJECT_PAGE = "disabled-project-page",INBOX_SIDEBAR_OPEN_TAB = "inbox-sidebar-open-tab",INBOX_SIDEBAR_CLOSED_TAB = "inbox-sidebar-closed-tab",@@ -634,6 +638,54 @@ const emptyStateDetails = {text: "Manage features",},},+ [EmptyStateType.DISABLED_PROJECT_CYCLE]: {+ key: EmptyStateType.DISABLED_PROJECT_CYCLE,+ title: "Cycles is not enabled for this project.",+ description:+ "Break work down by timeboxed chunks, work backwards from your project deadline to set dates, and make tangible progress as a team. Enable the cycles feature for your project to start using them.",+ accessType: "project",+ access: EUserProjectRoles.ADMIN,+ path: "/empty-state/disabled-feature/cycles",+ primaryButton: {+ text: "Manage features",+ },+ },+ [EmptyStateType.DISABLED_PROJECT_MODULE]: {+ key: EmptyStateType.DISABLED_PROJECT_MODULE,+ title: "Modules are not enabled for the project.",+ description:+ "A group of issues that belong to a logical, hierarchical parent form a module. Think of them as a way to track work by project milestones. Enable modules from project settings.",+ accessType: "project",+ access: EUserProjectRoles.ADMIN,+ path: "/empty-state/disabled-feature/modules",+ primaryButton: {+ text: "Manage features",+ },+ },+ [EmptyStateType.DISABLED_PROJECT_PAGE]: {+ key: EmptyStateType.DISABLED_PROJECT_PAGE,+ title: "Pages are not enabled for the project.",+ description:+ "Pages are thought spotting space in Plane. Take down meeting notes, format them easily, embed issues, lay them out using a library of components, and keep them all in your project’s context. Enable the pages feature to start creating them in your project.",+ accessType: "project",+ access: EUserProjectRoles.ADMIN,+ path: "/empty-state/disabled-feature/pages",+ primaryButton: {+ text: "Manage features",+ },+ },+ [EmptyStateType.DISABLED_PROJECT_VIEW]: {+ key: EmptyStateType.DISABLED_PROJECT_VIEW,+ title: "Views is not enabled for this project.",+ description:+ "Views are a set of saved filters that you use frequently or want easy access to. All your colleagues in a project can see everyone’s views and choose whichever suits their needs best. Enable views in the project settings to start using them.",+ accessType: "project",+ access: EUserProjectRoles.ADMIN,+ path: "/empty-state/disabled-feature/views",+ primaryButton: {+ text: "Manage features",+ },+ },[EmptyStateType.INBOX_SIDEBAR_OPEN_TAB]: {key: EmptyStateType.INBOX_SIDEBAR_OPEN_TAB,title: "No open issues",diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsxindex 5fd59d871a..fdf3cb6d76 100644--- a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx+++ b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx@@ -35,7 +35,7 @@ const ProjectCyclesPage: NextPageWithLayout = observer(() => {// store hooksconst { setTrackElement } = useEventTracker();const { currentProjectCycleIds, loader } = useCycle();- const { getProjectById } = useProject();+ const { getProjectById, currentProjectDetails } = useProject();// routerconst router = useRouter();const { workspaceSlug, projectId, peekCycle } = router.query;@@ -60,7 +60,18 @@ const ProjectCyclesPage: NextPageWithLayout = observer(() => {updateFilters(projectId.toString(), { [key]: newValues });};- if (!workspaceSlug || !projectId) return null;+ if (!workspaceSlug || !projectId) return <></>;++ // No access to cycle+ if (currentProjectDetails?.cycle_view === false)+ return (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState+ type={EmptyStateType.DISABLED_PROJECT_CYCLE}+ primaryButtonLink={`/${workspaceSlug}/projects/${projectId}/settings/features`}+ />+ </div>+ );if (loader)return (diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsxindex 8f626bfdf3..22973347f6 100644--- a/web/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx+++ b/web/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx@@ -5,11 +5,13 @@ import { TModuleFilters } from "@plane/types";// layouts// componentsimport { PageHead } from "@/components/core";+import { EmptyState } from "@/components/empty-state";import { ModulesListHeader } from "@/components/headers";import { ModuleAppliedFiltersList, ModulesListView } from "@/components/modules";// types// hooksimport ModulesListMobileHeader from "@/components/modules/moduels-list-mobile-header";+import { EmptyStateType } from "@/constants/empty-state";import { calculateTotalFilters } from "@/helpers/filter.helper";import { useModuleFilter, useProject } from "@/hooks/store";import { AppLayout } from "@/layouts/app-layout";@@ -17,9 +19,9 @@ import { NextPageWithLayout } from "@/lib/types";const ProjectModulesPage: NextPageWithLayout = observer(() => {const router = useRouter();- const { projectId } = router.query;+ const { workspaceSlug, projectId } = router.query;// store- const { getProjectById } = useProject();+ const { getProjectById, currentProjectDetails } = useProject();const { currentProjectFilters, clearAllFilters, updateFilters } = useModuleFilter();// derived valuesconst project = projectId ? getProjectById(projectId.toString()) : undefined;@@ -38,6 +40,19 @@ const ProjectModulesPage: NextPageWithLayout = observer(() => {[currentProjectFilters, projectId, updateFilters]);+ if (!workspaceSlug || !projectId) return <></>;++ // No access to+ if (currentProjectDetails?.module_view === false)+ return (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState+ type={EmptyStateType.DISABLED_PROJECT_MODULE}+ primaryButtonLink={`/${workspaceSlug}/projects/${projectId}/settings/features`}+ />+ </div>+ );+return (<><PageHead title={pageTitle} />diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsxindex 1912565a79..e7e7a3e2bd 100644--- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx+++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx@@ -56,7 +56,7 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => {commandPalette: { toggleCreatePageModal },} = useApplication();const { setTrackElement } = useEventTracker();- const { getProjectById } = useProject();+ const { getProjectById, currentProjectDetails } = useProject();const { fetchProjectPages, fetchArchivedProjectPages, loader, archivedPageLoader, projectPageIds, archivedPageIds } =useProjectPages();// hooks@@ -75,6 +75,19 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => {workspaceSlug && projectId ? () => fetchArchivedProjectPages(workspaceSlug.toString(), projectId.toString()) : null);+ if (!workspaceSlug || !projectId) return <></>;++ // No access to+ if (currentProjectDetails?.page_view === false)+ return (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState+ type={EmptyStateType.DISABLED_PROJECT_PAGE}+ primaryButtonLink={`/${workspaceSlug}/projects/${projectId}/settings/features`}+ />+ </div>+ );+const currentTabValue = (tab: string | null) => {switch (tab) {case "Recent":diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsxindex 59c7aa2153..dbdc0f192e 100644--- a/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx+++ b/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx@@ -3,8 +3,11 @@ import { observer } from "mobx-react";import { useRouter } from "next/router";// componentsimport { PageHead } from "@/components/core";+import { EmptyState } from "@/components/empty-state";import { ProjectViewsHeader } from "@/components/headers";import { ProjectViewsList } from "@/components/views";+// constants+import { EmptyStateType } from "@/constants/empty-state";// hooksimport { useProject } from "@/hooks/store";// layouts@@ -15,13 +18,26 @@ import { NextPageWithLayout } from "@/lib/types";const ProjectViewsPage: NextPageWithLayout = observer(() => {// routerconst router = useRouter();- const { projectId } = router.query;+ const { workspaceSlug, projectId } = router.query;// store- const { getProjectById } = useProject();+ const { getProjectById, currentProjectDetails } = useProject();// derived valuesconst project = projectId ? getProjectById(projectId.toString()) : undefined;const pageTitle = project?.name ? `${project?.name} - Views` : undefined;+ if (!workspaceSlug || !projectId) return <></>;++ // No access to+ if (currentProjectDetails?.issue_views_view === false)+ return (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState+ type={EmptyStateType.DISABLED_PROJECT_VIEW}+ primaryButtonLink={`/${workspaceSlug}/projects/${projectId}/settings/features`}+ />+ </div>+ );+return (<><PageHead title={pageTitle} />diff --git a/web/public/empty-state/disabled-feature/cycles-dark.webp b/web/public/empty-state/disabled-feature/cycles-dark.webpnew file mode 100644index 0000000000..5b2234984dBinary files /dev/null and b/web/public/empty-state/disabled-feature/cycles-dark.webp differdiff --git a/web/public/empty-state/disabled-feature/cycles-light.webp b/web/public/empty-state/disabled-feature/cycles-light.webpnew file mode 100644index 0000000000..2e6e01e3b8Binary files /dev/null and b/web/public/empty-state/disabled-feature/cycles-light.webp differdiff --git a/web/public/empty-state/disabled-feature/modules-dark.webp b/web/public/empty-state/disabled-feature/modules-dark.webpnew file mode 100644index 0000000000..8e198ed334Binary files /dev/null and b/web/public/empty-state/disabled-feature/modules-dark.webp differdiff --git a/web/public/empty-state/disabled-feature/modules-light.webp b/web/public/empty-state/disabled-feature/modules-light.webpnew file mode 100644index 0000000000..d1db65cc04Binary files /dev/null and b/web/public/empty-state/disabled-feature/modules-light.webp differdiff --git a/web/public/empty-state/disabled-feature/pages-dark.webp b/web/public/empty-state/disabled-feature/pages-dark.webpnew file mode 100644index 0000000000..19263a0cb3Binary files /dev/null and b/web/public/empty-state/disabled-feature/pages-dark.webp differdiff --git a/web/public/empty-state/disabled-feature/pages-light.webp b/web/public/empty-state/disabled-feature/pages-light.webpnew file mode 100644index 0000000000..fd1c5b4d61Binary files /dev/null and b/web/public/empty-state/disabled-feature/pages-light.webp differdiff --git a/web/public/empty-state/disabled-feature/views-dark.webp b/web/public/empty-state/disabled-feature/views-dark.webpnew file mode 100644index 0000000000..c82d967ba9Binary files /dev/null and b/web/public/empty-state/disabled-feature/views-dark.webp differdiff --git a/web/public/empty-state/disabled-feature/views-light.webp b/web/public/empty-state/disabled-feature/views-light.webpnew file mode 100644index 0000000000..145bc8c243Binary files /dev/null and b/web/public/empty-state/disabled-feature/views-light.webp differ