diff --git a/web/components/cycles/active-cycle-info.tsx b/web/components/cycles/active-cycle-info.tsx index 5b58bd8c1f..63d003323a 100644 --- a/web/components/cycles/active-cycle-info.tsx +++ b/web/components/cycles/active-cycle-info.tsx @@ -15,7 +15,7 @@ import { renderFormattedDate, findHowManyDaysLeft, renderFormattedDateWithoutYea import { truncateText } from "helpers/string.helper"; import { renderEmoji } from "helpers/emoji.helper"; // constants -import { CYCLE_STATE_GROUPS_DETAILS } from "constants/cycle"; +import { WORKSPACE_ACTIVE_CYCLE_STATE_GROUPS_DETAILS } from "constants/cycle"; export type ActiveCycleInfoProps = { cycle: ICycle; @@ -53,7 +53,7 @@ export const ActiveCycleInfo: FC = (props) => { backlog: cycle.backlog_issues, }; - const progressIndicatorData = CYCLE_STATE_GROUPS_DETAILS.map((group, index) => ({ + const progressIndicatorData = WORKSPACE_ACTIVE_CYCLE_STATE_GROUPS_DETAILS.map((group, index) => ({ id: index, name: group.title, value: cycle.total_issues > 0 ? (cycle[group.key as keyof ICycle] as number) : 0, @@ -96,7 +96,7 @@ export const ActiveCycleInfo: FC = (props) => { position="top-left" > - {`${daysLeft} ${daysLeft > 1 ? "Days" : "Day"} Left`} + {`${daysLeft} ${daysLeft > 1 ? "days" : "day"} left`} @@ -156,7 +156,7 @@ export const ActiveCycleInfo: FC = (props) => { {group} diff --git a/web/components/headers/workspace-active-cycles.tsx b/web/components/headers/workspace-active-cycles.tsx index 79e6bcaf3c..d3f14fbb3d 100644 --- a/web/components/headers/workspace-active-cycles.tsx +++ b/web/components/headers/workspace-active-cycles.tsx @@ -1,7 +1,6 @@ import { observer } from "mobx-react-lite"; -import { SendToBack } from "lucide-react"; // ui -import { Breadcrumbs } from "@plane/ui"; +import { Breadcrumbs, ContrastIcon } from "@plane/ui"; export const WorkspaceActiveCycleHeader = observer(() => (
@@ -10,7 +9,7 @@ export const WorkspaceActiveCycleHeader = observer(() => ( } + icon={} label="Active Cycles" /> diff --git a/web/components/workspace/workspace-active-cycles-list.tsx b/web/components/workspace/workspace-active-cycles-list.tsx index 0dc28065e5..99d0bb1bab 100644 --- a/web/components/workspace/workspace-active-cycles-list.tsx +++ b/web/components/workspace/workspace-active-cycles-list.tsx @@ -3,14 +3,18 @@ import useSWR from "swr"; import { observer } from "mobx-react-lite"; import { useRouter } from "next/router"; import isEqual from "lodash/isEqual"; +// hooks +import { useUser } from "hooks/store"; // components import { ActiveCycleInfo } from "components/cycles"; -import { Button, ContrastIcon, Spinner } from "@plane/ui"; +import { Button, Spinner } from "@plane/ui"; +import { EmptyState, getEmptyStateImagePath } from "components/empty-state"; // services import { CycleService } from "services/cycle.service"; const cycleService = new CycleService(); // constants import { WORKSPACE_ACTIVE_CYCLES_LIST } from "constants/fetch-keys"; +import { EUserWorkspaceRoles } from "constants/workspace"; // types import { ICycle } from "@plane/types"; @@ -25,6 +29,11 @@ export const WorkspaceActiveCyclesList = observer(() => { const router = useRouter(); const { workspaceSlug } = router.query; + const { + membership: { currentWorkspaceRole }, + currentUser, + } = useUser(); + // fetching active cycles in workspace const { data: workspaceActiveCycles, isLoading } = useSWR( workspaceSlug && cursor ? WORKSPACE_ACTIVE_CYCLES_LIST(workspaceSlug as string, cursor, `${per_page}`) : null, @@ -54,6 +63,13 @@ export const WorkspaceActiveCyclesList = observer(() => { ); } + const EmptyStateImagePath = getEmptyStateImagePath( + "onboarding", + "workspace-active-cycles", + currentUser?.theme.theme === "light" + ); + const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; + return (
{allCyclesData.length > 0 ? ( @@ -74,17 +90,13 @@ export const WorkspaceActiveCyclesList = observer(() => { )} ) : ( -
-
-
- -
-

- Cycles running across all your projects can be seen here. Use this to track how the org is delivering - value across teams -

-
-
+ )}
); diff --git a/web/constants/cycle.ts b/web/constants/cycle.ts index 7a2c48634e..d316cd924a 100644 --- a/web/constants/cycle.ts +++ b/web/constants/cycle.ts @@ -186,3 +186,28 @@ export const CYCLE_EMPTY_STATE_DETAILS = { description: "No dates added in cycles? Find them here as drafts.", }, }; + + +// ee +export const WORKSPACE_ACTIVE_CYCLE_STATE_GROUPS_DETAILS = [ + { + key: "completed_issues", + title: "Completed", + color: "#d687ff", + }, + { + key: "started_issues", + title: "Started", + color: "#FFC53D", + }, + { + key: "unstarted_issues", + title: "Unstarted", + color: "#FB923C", + }, + { + key: "backlog_issues", + title: "Backlog", + color: "#F0F0F3", + }, +]; diff --git a/web/public/empty-state/onboarding/workspace-active-cycles-dark.webp b/web/public/empty-state/onboarding/workspace-active-cycles-dark.webp new file mode 100644 index 0000000000..a77b05a283 Binary files /dev/null and b/web/public/empty-state/onboarding/workspace-active-cycles-dark.webp differ diff --git a/web/public/empty-state/onboarding/workspace-active-cycles-light.webp b/web/public/empty-state/onboarding/workspace-active-cycles-light.webp new file mode 100644 index 0000000000..15e3c29664 Binary files /dev/null and b/web/public/empty-state/onboarding/workspace-active-cycles-light.webp differ