forked from github/plane
chore: completed cycle empty state valdidation updated (#3959)
This commit is contained in:
parent
94f1e6d957
commit
c17748eec2
@ -62,12 +62,14 @@ export const CycleEmptyState: React.FC<Props> = 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<Props> = 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<Props> = observer((props) => {
|
||||
: undefined
|
||||
}
|
||||
secondaryButtonOnClick={
|
||||
!isCompletedCycleSnapshotAvailable && isEmptyFilters
|
||||
? handleClearAllFilters
|
||||
: () => setCycleIssuesListModal(true)
|
||||
!isCompletedAndEmpty && isEmptyFilters ? handleClearAllFilters : () => setCycleIssuesListModal(true)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user