From 74a88fc02851219bf84d75a51cafd37b0183f086 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:38:07 +0530 Subject: [PATCH] [WEB-904] chore: feature validation empty state (#4145) * chore: disable feature empty state added * chore: disable feature empty state updated --- web/constants/empty-state.ts | 52 ++++++++++++++++++ .../projects/[projectId]/cycles/index.tsx | 15 ++++- .../projects/[projectId]/modules/index.tsx | 19 ++++++- .../projects/[projectId]/pages/index.tsx | 15 ++++- .../projects/[projectId]/views/index.tsx | 20 ++++++- .../disabled-feature/cycles-dark.webp | Bin 0 -> 71882 bytes .../disabled-feature/cycles-light.webp | Bin 0 -> 74068 bytes .../disabled-feature/modules-dark.webp | Bin 0 -> 64292 bytes .../disabled-feature/modules-light.webp | Bin 0 -> 67546 bytes .../disabled-feature/pages-dark.webp | Bin 0 -> 83862 bytes .../disabled-feature/pages-light.webp | Bin 0 -> 74942 bytes .../disabled-feature/views-dark.webp | Bin 0 -> 53812 bytes .../disabled-feature/views-light.webp | Bin 0 -> 53994 bytes 13 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 web/public/empty-state/disabled-feature/cycles-dark.webp create mode 100644 web/public/empty-state/disabled-feature/cycles-light.webp create mode 100644 web/public/empty-state/disabled-feature/modules-dark.webp create mode 100644 web/public/empty-state/disabled-feature/modules-light.webp create mode 100644 web/public/empty-state/disabled-feature/pages-dark.webp create mode 100644 web/public/empty-state/disabled-feature/pages-light.webp create mode 100644 web/public/empty-state/disabled-feature/views-dark.webp create mode 100644 web/public/empty-state/disabled-feature/views-light.webp diff --git a/web/constants/empty-state.ts b/web/constants/empty-state.ts index 808b5470d..20589db00 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.tsx index 5fd59d871..fdf3cb6d7 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 hooks const { setTrackElement } = useEventTracker(); const { currentProjectCycleIds, loader } = useCycle(); - const { getProjectById } = useProject(); + const { getProjectById, currentProjectDetails } = useProject(); // router const 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 ( +
l9SnWuI(RtLRDnl+@#;^$J$GWeG)%sxo*-7@JtAZm2eAV)1B
zB1etBrp2(rH=&9U*`hpU|NJ3%3TwOIwcRNF9`9JSxQ$paQPfCt@*&g@A5P-G8xuZR
zrFtM^X4Wt}^NM4Wsbyyl9I(_$)zyMB^QMPFYmyNqR}! r#xYC(V&VS7vvc@&
z^sDP>A^ZUKXisFs$(RHa_6;+rB4PQ>I}d$?mhUT(JEbw~O6!BeP!rO*??PGcrwz9*
zqflD}ClLKS^1Jo;$7qnN2H<2|233k7 ANFS&6oIXcgC4V^ivp7|0|cMI&PbLs*DG(S^cJ*t3WK$`wT|q6YfUA5~`fN;
_S&SDq=vpvI^6A|>gFEK$OjE0$h fWp4@N#{i!6ZQ+%n*E~~4WyaMj^
zSqxibU_hhH+KpvjV9Be7Iv6enT(Xm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