diff --git a/web/components/issues/issue-layouts/empty-states/cycle.tsx b/web/components/issues/issue-layouts/empty-states/cycle.tsx index 1a49794c6..8def7cc85 100644 --- a/web/components/issues/issue-layouts/empty-states/cycle.tsx +++ b/web/components/issues/issue-layouts/empty-states/cycle.tsx @@ -62,12 +62,14 @@ export const CycleEmptyState: React.FC = observer((props) => { const isCompletedCycleSnapshotAvailable = !isEmpty(cycleDetails?.progress_snapshot ?? {}); - const emptyStateType = isCompletedCycleSnapshotAvailable + const isCompletedAndEmpty = isCompletedCycleSnapshotAvailable || cycleDetails?.status.toLowerCase() === "completed"; + + const emptyStateType = isCompletedAndEmpty ? EmptyStateType.PROJECT_CYCLE_COMPLETED_NO_ISSUES : isEmptyFilters ? EmptyStateType.PROJECT_EMPTY_FILTER : EmptyStateType.PROJECT_CYCLE_NO_ISSUES; - const additionalPath = isCompletedCycleSnapshotAvailable ? undefined : activeLayout ?? "list"; + const additionalPath = isCompletedAndEmpty ? undefined : activeLayout ?? "list"; const emptyStateSize = isEmptyFilters ? "lg" : "sm"; return ( @@ -86,7 +88,7 @@ export const CycleEmptyState: React.FC = observer((props) => { additionalPath={additionalPath} size={emptyStateSize} primaryButtonOnClick={ - !isCompletedCycleSnapshotAvailable && !isEmptyFilters + !isCompletedAndEmpty && !isEmptyFilters ? () => { setTrackElement("Cycle issue empty state"); toggleCreateIssueModal(true, EIssuesStoreType.CYCLE); @@ -94,9 +96,7 @@ export const CycleEmptyState: React.FC = observer((props) => { : undefined } secondaryButtonOnClick={ - !isCompletedCycleSnapshotAvailable && isEmptyFilters - ? handleClearAllFilters - : () => setCycleIssuesListModal(true) + !isCompletedAndEmpty && isEmptyFilters ? handleClearAllFilters : () => setCycleIssuesListModal(true) } />