π₯π₯π₯ 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-812] chore: project active cycle stats empty state (#4053)
Anmol Singh Bhatia9f9e508bb768
diff --git a/web/components/cycles/active-cycle/cycle-stats.tsx b/web/components/cycles/active-cycle/cycle-stats.tsxindex e27c995006..fd4bc93187 100644--- a/web/components/cycles/active-cycle/cycle-stats.tsx+++ b/web/components/cycles/active-cycle/cycle-stats.tsx@@ -11,7 +11,9 @@ import { Tooltip, Loader, PriorityIcon, Avatar } from "@plane/ui";// componentsimport { SingleProgressStats } from "@/components/core";import { StateDropdown } from "@/components/dropdowns";+import { EmptyState } from "@/components/empty-state";// constants+import { EmptyStateType } from "@/constants/empty-state";import { CYCLE_ISSUES_WITH_PARAMS } from "@/constants/fetch-keys";import { EIssuesStoreType } from "@/constants/issue";// helper@@ -177,8 +179,12 @@ export const ActiveCycleStats: FC<ActiveCycleStatsProps> = observer((props) => {</Link>))) : (- <div className="flex items-center justify-center text-center h-full text-sm text-custom-text-200">- <span>There are no high priority issues present in this cycle.</span>+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState+ type={EmptyStateType.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE}+ layout="screen-simple"+ size="sm"+ /></div>)) : (@@ -195,63 +201,75 @@ export const ActiveCycleStats: FC<ActiveCycleStatsProps> = observer((props) => {as="div"className="flex h-52 w-full flex-col gap-1 overflow-y-auto text-custom-text-200 vertical-scrollbar scrollbar-sm">- {cycle.distribution?.assignees?.map((assignee, index) => {- if (assignee.assignee_id)- return (- <SingleProgressStats- key={assignee.assignee_id}- title={- <div className="flex items-center gap-2">- <Avatar name={assignee?.display_name ?? undefined} src={assignee?.avatar ?? undefined} />+ {cycleIssues.length > 0 ? (+ cycle.distribution?.assignees?.map((assignee, index) => {+ if (assignee.assignee_id)+ return (+ <SingleProgressStats+ key={assignee.assignee_id}+ title={+ <div className="flex items-center gap-2">+ <Avatar name={assignee?.display_name ?? undefined} src={assignee?.avatar ?? undefined} />- <span>{assignee.display_name}</span>- </div>- }- completed={assignee.completed_issues}- total={assignee.total_issues}- />- );- else- return (- <SingleProgressStats- key={`unassigned-${index}`}- title={- <div className="flex items-center gap-2">- <div className="h-5 w-5 rounded-full border-2 border-custom-border-200 bg-custom-background-80">- <img src="/user.png" height="100%" width="100%" className="rounded-full" alt="User" />+ <span>{assignee.display_name}</span></div>- <span>No assignee</span>- </div>- }- completed={assignee.completed_issues}- total={assignee.total_issues}- />- );- })}+ }+ completed={assignee.completed_issues}+ total={assignee.total_issues}+ />+ );+ else+ return (+ <SingleProgressStats+ key={`unassigned-${index}`}+ title={+ <div className="flex items-center gap-2">+ <div className="h-5 w-5 rounded-full border-2 border-custom-border-200 bg-custom-background-80">+ <img src="/user.png" height="100%" width="100%" className="rounded-full" alt="User" />+ </div>+ <span>No assignee</span>+ </div>+ }+ completed={assignee.completed_issues}+ total={assignee.total_issues}+ />+ );+ })+ ) : (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState type={EmptyStateType.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE} layout="screen-simple" size="sm" />+ </div>+ )}</Tab.Panel><Tab.Panelas="div"className="flex h-52 w-full flex-col gap-1 overflow-y-auto text-custom-text-200 vertical-scrollbar scrollbar-sm">- {cycle.distribution?.labels?.map((label, index) => (- <SingleProgressStats- key={label.label_id ?? `no-label-${index}`}- title={- <div className="flex items-center gap-2">- <span- className="block h-3 w-3 rounded-full"- style={{- backgroundColor: label.color ?? "#000000",- }}- />- <span className="text-xs">{label.label_name ?? "No labels"}</span>- </div>- }- completed={label.completed_issues}- total={label.total_issues}- />- ))}+ {cycleIssues.length > 0 ? (+ cycle.distribution?.labels?.map((label, index) => (+ <SingleProgressStats+ key={label.label_id ?? `no-label-${index}`}+ title={+ <div className="flex items-center gap-2">+ <span+ className="block h-3 w-3 rounded-full"+ style={{+ backgroundColor: label.color ?? "#000000",+ }}+ />+ <span className="text-xs">{label.label_name ?? "No labels"}</span>+ </div>+ }+ completed={label.completed_issues}+ total={label.total_issues}+ />+ ))+ ) : (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState type={EmptyStateType.ACTIVE_CYCLE_LABEL_EMPTY_STATE} layout="screen-simple" size="sm" />+ </div>+ )}</Tab.Panel></Tab.Panels></Tab.Group>diff --git a/web/components/cycles/active-cycle/productivity.tsx b/web/components/cycles/active-cycle/productivity.tsxindex 59c2ac3c90..a3366d9341 100644--- a/web/components/cycles/active-cycle/productivity.tsx+++ b/web/components/cycles/active-cycle/productivity.tsx@@ -3,6 +3,9 @@ import { FC } from "react";import { ICycle } from "@plane/types";// componentsimport ProgressChart from "@/components/core/sidebar/progress-chart";+import { EmptyState } from "@/components/empty-state";+// constants+import { EmptyStateType } from "@/constants/empty-state";export type ActiveCycleProductivityProps = {cycle: ICycle;@@ -16,31 +19,40 @@ export const ActiveCycleProductivity: FC<ActiveCycleProductivityProps> = (props)<div className="flex items-center justify-between gap-4"><h3 className="text-base text-custom-text-300 font-semibold">Issue burndown</h3></div>-- <div className="h-full w-full px-2">- <div className="flex items-center justify-between gap-4 py-1 text-xs text-custom-text-300">- <div className="flex items-center gap-3 text-custom-text-300">- <div className="flex items-center justify-center gap-1">- <span className="h-2 w-2 rounded-full bg-[#A9BBD0]" />- <span>Ideal</span>+ {cycle.total_issues > 0 ? (+ <>+ <div className="h-full w-full px-2">+ <div className="flex items-center justify-between gap-4 py-1 text-xs text-custom-text-300">+ <div className="flex items-center gap-3 text-custom-text-300">+ <div className="flex items-center justify-center gap-1">+ <span className="h-2 w-2 rounded-full bg-[#A9BBD0]" />+ <span>Ideal</span>+ </div>+ <div className="flex items-center justify-center gap-1">+ <span className="h-2 w-2 rounded-full bg-[#4C8FFF]" />+ <span>Current</span>+ </div>+ </div>+ <span>{`Pending issues - ${cycle.backlog_issues + cycle.unstarted_issues + cycle.started_issues}`}</span></div>- <div className="flex items-center justify-center gap-1">- <span className="h-2 w-2 rounded-full bg-[#4C8FFF]" />- <span>Current</span>+ <div className="relative h-full">+ <ProgressChart+ className="h-full"+ distribution={cycle.distribution?.completion_chart ?? {}}+ startDate={cycle.start_date ?? ""}+ endDate={cycle.end_date ?? ""}+ totalIssues={cycle.total_issues}+ /></div></div>- <span>{`Pending issues - ${cycle.backlog_issues + cycle.unstarted_issues + cycle.started_issues}`}</span>- </div>- <div className="relative h-full">- <ProgressChart- className="h-full"- distribution={cycle.distribution?.completion_chart ?? {}}- startDate={cycle.start_date ?? ""}- endDate={cycle.end_date ?? ""}- totalIssues={cycle.total_issues}- />- </div>- </div>+ </>+ ) : (+ <>+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState type={EmptyStateType.ACTIVE_CYCLE_CHART_EMPTY_STATE} layout="screen-simple" size="sm" />+ </div>+ </>+ )}</div>);};diff --git a/web/components/cycles/active-cycle/progress.tsx b/web/components/cycles/active-cycle/progress.tsxindex dea3b496a8..752f72bcc1 100644--- a/web/components/cycles/active-cycle/progress.tsx+++ b/web/components/cycles/active-cycle/progress.tsx@@ -3,8 +3,11 @@ import { FC } from "react";import { ICycle } from "@plane/types";// uiimport { LinearProgressIndicator } from "@plane/ui";+// components+import { EmptyState } from "@/components/empty-state";// constantsimport { CYCLE_STATE_GROUPS_DETAILS } from "@/constants/cycle";+import { EmptyStateType } from "@/constants/empty-state";export type ActiveCycleProgressProps = {cycle: ICycle;@@ -32,48 +35,56 @@ export const ActiveCycleProgress: FC<ActiveCycleProgressProps> = (props) => {<div className="flex flex-col gap-3"><div className="flex items-center justify-between gap-4"><h3 className="text-base text-custom-text-300 font-semibold">Progress</h3>- <span className="flex gap-1 text-sm text-custom-text-400 font-medium whitespace-nowrap rounded-sm px-3 py-1 ">- {`${cycle.completed_issues + cycle.cancelled_issues}/${cycle.total_issues - cycle.cancelled_issues} ${- cycle.completed_issues + cycle.cancelled_issues > 1 ? "Issues" : "Issue"- } closed`}- </span>+ {cycle.total_issues > 0 && (+ <span className="flex gap-1 text-sm text-custom-text-400 font-medium whitespace-nowrap rounded-sm px-3 py-1 ">+ {`${cycle.completed_issues + cycle.cancelled_issues}/${cycle.total_issues - cycle.cancelled_issues} ${+ cycle.completed_issues + cycle.cancelled_issues > 1 ? "Issues" : "Issue"+ } closed`}+ </span>+ )}</div>- <LinearProgressIndicator size="lg" data={progressIndicatorData} />+ {cycle.total_issues > 0 && <LinearProgressIndicator size="lg" data={progressIndicatorData} />}</div>- <div className="flex flex-col gap-5">- {Object.keys(groupedIssues).map((group, index) => (- <>- {groupedIssues[group] > 0 && (- <div key={index}>- <div className="flex items-center justify-between gap-2 text-sm">- <div className="flex items-center gap-1.5">- <span- className="block h-3 w-3 rounded-full"- style={{- backgroundColor: CYCLE_STATE_GROUPS_DETAILS[index].color,- }}- />- <span className="text-custom-text-300 capitalize font-medium w-16">{group}</span>+ {cycle.total_issues > 0 ? (+ <div className="flex flex-col gap-5">+ {Object.keys(groupedIssues).map((group, index) => (+ <>+ {groupedIssues[group] > 0 && (+ <div key={index}>+ <div className="flex items-center justify-between gap-2 text-sm">+ <div className="flex items-center gap-1.5">+ <span+ className="block h-3 w-3 rounded-full"+ style={{+ backgroundColor: CYCLE_STATE_GROUPS_DETAILS[index].color,+ }}+ />+ <span className="text-custom-text-300 capitalize font-medium w-16">{group}</span>+ </div>+ <span className="text-custom-text-300">{`${groupedIssues[group]} ${+ groupedIssues[group] > 1 ? "Issues" : "Issue"+ }`}</span></div>- <span className="text-custom-text-300">{`${groupedIssues[group]} ${- groupedIssues[group] > 1 ? "Issues" : "Issue"- }`}</span></div>- </div>- )}- </>- ))}- {cycle.cancelled_issues > 0 && (- <span className="flex items-center gap-2 text-sm text-custom-text-300">- <span>- {`${cycle.cancelled_issues} cancelled ${- cycle.cancelled_issues > 1 ? "issues are" : "issue is"- } excluded from this report.`}{" "}+ )}+ </>+ ))}+ {cycle.cancelled_issues > 0 && (+ <span className="flex items-center gap-2 text-sm text-custom-text-300">+ <span>+ {`${cycle.cancelled_issues} cancelled ${+ cycle.cancelled_issues > 1 ? "issues are" : "issue is"+ } excluded from this report.`}{" "}+ </span></span>- </span>- )}- </div>+ )}+ </div>+ ) : (+ <div className="flex items-center justify-center h-full w-full">+ <EmptyState type={EmptyStateType.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE} layout="screen-simple" size="sm" />+ </div>+ )}</div>);};diff --git a/web/components/cycles/active-cycle/upcoming-cycles-list.tsx b/web/components/cycles/active-cycle/upcoming-cycles-list.tsxindex f4156f3418..221ffab0b6 100644--- a/web/components/cycles/active-cycle/upcoming-cycles-list.tsx+++ b/web/components/cycles/active-cycle/upcoming-cycles-list.tsx@@ -1,5 +1,7 @@import { FC } from "react";import { observer } from "mobx-react";+import Image from "next/image";+import { useTheme } from "next-themes";// componentsimport { UpcomingCycleListItem } from "@/components/cycles";// hooks@@ -14,6 +16,11 @@ export const UpcomingCyclesList: FC<Props> = observer((props) => {// store hooksconst { currentProjectUpcomingCycleIds } = useCycle();+ // theme+ const { resolvedTheme } = useTheme();++ const resolvedEmptyStatePath = `/empty-state/active-cycle/cycle-${resolvedTheme === "light" ? "light" : "dark"}.webp`;+if (!currentProjectUpcomingCycleIds) return null;return (@@ -28,8 +35,18 @@ export const UpcomingCyclesList: FC<Props> = observer((props) => {))}</div>) : (- <div className="w-full grid place-items-center py-20">- <div className="text-center">+ <div className="flex items-center justify-center h-full w-full py-20">+ <div className="text-center flex flex-col gap-2.5 items-center">+ <div className="h-24 w-24">+ <Image+ src={resolvedEmptyStatePath}+ alt="button image"+ width={78}+ height={78}+ layout="responsive"+ lazyBoundary="100%"+ />+ </div><h5 className="text-xl font-medium mb-1">No upcoming cycles</h5><p className="text-custom-text-400 text-base">Create new cycles to find them here or checkdiff --git a/web/components/empty-state/empty-state.tsx b/web/components/empty-state/empty-state.tsxindex 88fe216125..790bd5aecc 100644--- a/web/components/empty-state/empty-state.tsx+++ b/web/components/empty-state/empty-state.tsx@@ -151,12 +151,12 @@ export const EmptyState: React.FC<EmptyStateProps> = (props) => {)}{layout === "screen-simple" && (<div className="text-center flex flex-col gap-2.5 items-center">- <div className="h-28 w-28">+ <div className={`${size === "sm" ? "h-24 w-24" : "h-28 w-28"}`}><Imagesrc={resolvedEmptyStatePath}alt={key || "button image"}- width={96}- height={96}+ width={size === "sm" ? 78 : 96}+ height={size === "sm" ? 78 : 96}layout="responsive"lazyBoundary="100%"/>diff --git a/web/constants/empty-state.ts b/web/constants/empty-state.tsindex 6705021a50..363147775d 100644--- a/web/constants/empty-state.ts+++ b/web/constants/empty-state.ts@@ -84,6 +84,12 @@ export enum EmptyStateType {NOTIFICATION_ARCHIVED_EMPTY_STATE = "notification-archived-empty-state",NOTIFICATION_SNOOZED_EMPTY_STATE = "notification-snoozed-empty-state",NOTIFICATION_UNREAD_EMPTY_STATE = "notification-unread-empty-state",++ ACTIVE_CYCLE_PROGRESS_EMPTY_STATE = "active-cycle-progress-empty-state",+ ACTIVE_CYCLE_CHART_EMPTY_STATE = "active-cycle-chart-empty-state",+ ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE = "active-cycle-priority-issue-empty-state",+ ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE = "active-cycle-assignee-empty-state",+ ACTIVE_CYCLE_LABEL_EMPTY_STATE = "active-cycle-label-empty-state",}const emptyStateDetails = {@@ -584,6 +590,31 @@ const emptyStateDetails = {description: "Any notification you archive will be \n available here to help you focus",path: "/empty-state/search/archive",},+ [EmptyStateType.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE]: {+ key: EmptyStateType.ACTIVE_CYCLE_PROGRESS_EMPTY_STATE,+ title: "Add issues to the cycle to view it's \n progress",+ path: "/empty-state/active-cycle/progress",+ },+ [EmptyStateType.ACTIVE_CYCLE_CHART_EMPTY_STATE]: {+ key: EmptyStateType.ACTIVE_CYCLE_CHART_EMPTY_STATE,+ title: "Add issues to the cycle to view the \n burndown chart.",+ path: "/empty-state/active-cycle/chart",+ },+ [EmptyStateType.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE]: {+ key: EmptyStateType.ACTIVE_CYCLE_PRIORITY_ISSUE_EMPTY_STATE,+ title: "Observe high priority issues tackled in \n the cycle at a glance.",+ path: "/empty-state/active-cycle/priority",+ },+ [EmptyStateType.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE]: {+ key: EmptyStateType.ACTIVE_CYCLE_ASSIGNEE_EMPTY_STATE,+ title: "Add assignees to issues to see a \n breakdown of work by assignees.",+ path: "/empty-state/active-cycle/assignee",+ },+ [EmptyStateType.ACTIVE_CYCLE_LABEL_EMPTY_STATE]: {+ key: EmptyStateType.ACTIVE_CYCLE_LABEL_EMPTY_STATE,+ title: "Add labels to issues to see the \n breakdown of work by labels.",+ path: "/empty-state/active-cycle/label",+ },} as const;export const EMPTY_STATE_DETAILS: Record<EmptyStateType, EmptyStateDetails> = emptyStateDetails;diff --git a/web/public/empty-state/active-cycle/assignee-dark.webp b/web/public/empty-state/active-cycle/assignee-dark.webpnew file mode 100644index 0000000000..2590627670Binary files /dev/null and b/web/public/empty-state/active-cycle/assignee-dark.webp differdiff --git a/web/public/empty-state/active-cycle/assignee-light.webp b/web/public/empty-state/active-cycle/assignee-light.webpnew file mode 100644index 0000000000..b8ae5c0102Binary files /dev/null and b/web/public/empty-state/active-cycle/assignee-light.webp differdiff --git a/web/public/empty-state/active-cycle/chart-dark.webp b/web/public/empty-state/active-cycle/chart-dark.webpnew file mode 100644index 0000000000..033d6fe3c4Binary files /dev/null and b/web/public/empty-state/active-cycle/chart-dark.webp differdiff --git a/web/public/empty-state/active-cycle/chart-light.webp b/web/public/empty-state/active-cycle/chart-light.webpnew file mode 100644index 0000000000..587906fba3Binary files /dev/null and b/web/public/empty-state/active-cycle/chart-light.webp differdiff --git a/web/public/empty-state/active-cycle/cycle-dark.webp b/web/public/empty-state/active-cycle/cycle-dark.webpnew file mode 100644index 0000000000..d092308046Binary files /dev/null and b/web/public/empty-state/active-cycle/cycle-dark.webp differdiff --git a/web/public/empty-state/active-cycle/cycle-light.webp b/web/public/empty-state/active-cycle/cycle-light.webpnew file mode 100644index 0000000000..a218d4d268Binary files /dev/null and b/web/public/empty-state/active-cycle/cycle-light.webp differdiff --git a/web/public/empty-state/active-cycle/label-dark.webp b/web/public/empty-state/active-cycle/label-dark.webpnew file mode 100644index 0000000000..c15d3be26eBinary files /dev/null and b/web/public/empty-state/active-cycle/label-dark.webp differdiff --git a/web/public/empty-state/active-cycle/label-light.webp b/web/public/empty-state/active-cycle/label-light.webpnew file mode 100644index 0000000000..e5ccc6994dBinary files /dev/null and b/web/public/empty-state/active-cycle/label-light.webp differdiff --git a/web/public/empty-state/active-cycle/priority-dark.webp b/web/public/empty-state/active-cycle/priority-dark.webpnew file mode 100644index 0000000000..f662e92eecBinary files /dev/null and b/web/public/empty-state/active-cycle/priority-dark.webp differdiff --git a/web/public/empty-state/active-cycle/priority-light.webp b/web/public/empty-state/active-cycle/priority-light.webpnew file mode 100644index 0000000000..fde814c6a7Binary files /dev/null and b/web/public/empty-state/active-cycle/priority-light.webp differdiff --git a/web/public/empty-state/active-cycle/progress-dark.webp b/web/public/empty-state/active-cycle/progress-dark.webpnew file mode 100644index 0000000000..4beda66ea4Binary files /dev/null and b/web/public/empty-state/active-cycle/progress-dark.webp differdiff --git a/web/public/empty-state/active-cycle/progress-light.webp b/web/public/empty-state/active-cycle/progress-light.webpnew file mode 100644index 0000000000..ae30cf76a5Binary files /dev/null and b/web/public/empty-state/active-cycle/progress-light.webp differ