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 isCompletedCycleSnapshotAvailable = !isEmpty(cycleDetails?.progress_snapshot ?? {});
|
||||||
|
|
||||||
const emptyStateType = isCompletedCycleSnapshotAvailable
|
const isCompletedAndEmpty = isCompletedCycleSnapshotAvailable || cycleDetails?.status.toLowerCase() === "completed";
|
||||||
|
|
||||||
|
const emptyStateType = isCompletedAndEmpty
|
||||||
? EmptyStateType.PROJECT_CYCLE_COMPLETED_NO_ISSUES
|
? EmptyStateType.PROJECT_CYCLE_COMPLETED_NO_ISSUES
|
||||||
: isEmptyFilters
|
: isEmptyFilters
|
||||||
? EmptyStateType.PROJECT_EMPTY_FILTER
|
? EmptyStateType.PROJECT_EMPTY_FILTER
|
||||||
: EmptyStateType.PROJECT_CYCLE_NO_ISSUES;
|
: EmptyStateType.PROJECT_CYCLE_NO_ISSUES;
|
||||||
const additionalPath = isCompletedCycleSnapshotAvailable ? undefined : activeLayout ?? "list";
|
const additionalPath = isCompletedAndEmpty ? undefined : activeLayout ?? "list";
|
||||||
const emptyStateSize = isEmptyFilters ? "lg" : "sm";
|
const emptyStateSize = isEmptyFilters ? "lg" : "sm";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -86,7 +88,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
additionalPath={additionalPath}
|
additionalPath={additionalPath}
|
||||||
size={emptyStateSize}
|
size={emptyStateSize}
|
||||||
primaryButtonOnClick={
|
primaryButtonOnClick={
|
||||||
!isCompletedCycleSnapshotAvailable && !isEmptyFilters
|
!isCompletedAndEmpty && !isEmptyFilters
|
||||||
? () => {
|
? () => {
|
||||||
setTrackElement("Cycle issue empty state");
|
setTrackElement("Cycle issue empty state");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
||||||
@ -94,9 +96,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
secondaryButtonOnClick={
|
secondaryButtonOnClick={
|
||||||
!isCompletedCycleSnapshotAvailable && isEmptyFilters
|
!isCompletedAndEmpty && isEmptyFilters ? handleClearAllFilters : () => setCycleIssuesListModal(true)
|
||||||
? handleClearAllFilters
|
|
||||||
: () => setCycleIssuesListModal(true)
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user