fix: workspace active cycle empty state (#144)

This commit is contained in:
Anmol Singh Bhatia
2024-03-25 19:46:13 +05:30
committed by GitHub
parent 96dcf13b8f
commit a0e71bda2a
2 changed files with 12 additions and 28 deletions

View File

@@ -1,16 +1,10 @@
import { useState } from "react";
import { observer } from "mobx-react-lite";
import { useRouter } from "next/router";
// import { useTheme } from "next-themes";
// ui
import { Button } from "@plane/ui";
// components
import { ActiveCyclesListPage } from "@/components/active-cycles";
// import { EmptyState, getEmptyStateImagePath } from "@/components/empty-state";
// constants
// import { EUserWorkspaceRoles } from "@/constants/workspace";
// hooks
// import { useUser } from "@/hooks/store";
import { EmptyStateType } from "@/constants/empty-state";
import { EmptyState } from "../empty-state";
const perPage = 3;
@@ -22,13 +16,6 @@ export const WorkspaceActiveCyclesList = observer(() => {
// router
const router = useRouter();
const { workspaceSlug } = router.query;
// theme
// const { resolvedTheme } = useTheme();
// store
// const {
// membership: { currentWorkspaceRole },
// currentUser,
// } = useUser();
const activeCyclesPages = [];
@@ -60,10 +47,6 @@ export const WorkspaceActiveCyclesList = observer(() => {
/>
);
}
// const isLightMode = resolvedTheme ? resolvedTheme === "light" : currentUser?.theme.theme === "light";
// const EmptyStateImagePath = getEmptyStateImagePath("onboarding", "workspace-active-cycles", isLightMode);
// const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;
return (
<div className="h-full w-full overflow-y-scroll bg-custom-background-90 vertical-scrollbar scrollbar-md">
@@ -77,15 +60,7 @@ export const WorkspaceActiveCyclesList = observer(() => {
</div>
)}
{/* {resultsCount === 0 && (
<EmptyState
image={EmptyStateImagePath}
title="No active cycles"
description="Cycles of your projects that includes any period that encompasses today's date within its range. Find the progress and details of all your active cycle here."
size="lg"
disabled={!isEditingAllowed}
/>
)} */}
<EmptyState type={EmptyStateType.WORKSPACE_ACTIVE_CYCLES} />
</div>
);
});

View File

@@ -90,6 +90,8 @@ export enum EmptyStateType {
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",
WORKSPACE_ACTIVE_CYCLES = "workspace-active-cycles",
}
const emptyStateDetails = {
@@ -615,6 +617,13 @@ const emptyStateDetails = {
title: "Add labels to issues to see the \n breakdown of work by labels.",
path: "/empty-state/active-cycle/label",
},
[EmptyStateType.WORKSPACE_ACTIVE_CYCLES]: {
key: EmptyStateType.WORKSPACE_ACTIVE_CYCLES,
title: "No active cycles",
description:
"Cycles of your projects that includes any period that encompasses today's date within its range. Find the progress and details of all your active cycle here.",
path: "/empty-state/onboarding/workspace-active-cycles",
},
} as const;
export const EMPTY_STATE_DETAILS: Record<EmptyStateType, EmptyStateDetails> = emptyStateDetails;