Skip to content

Commit

Permalink
fix: transfer issues count fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsikrishnamathala committed Jan 10, 2025
1 parent 1f51b24 commit 78f9643
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions packages/types/src/cycle/cycle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type TCycleProgress = {

export type TProgressSnapshot = {
total_issues: number;
pending_issues: number;
completed_issues: number;
backlog_issues: number;
started_issues: number;
Expand Down Expand Up @@ -120,9 +121,7 @@ export interface CycleIssueResponse {
sub_issues_count: number;
}

export type SelectCycleType =
| (ICycle & { actionType: "edit" | "delete" | "create-issue" })
| undefined;
export type SelectCycleType = (ICycle & { actionType: "edit" | "delete" | "create-issue" }) | undefined;

export type CycleDateCheckData = {
start_date: string;
Expand Down
2 changes: 1 addition & 1 deletion web/ce/components/cycles/end-cycle/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
cycleId: string;
projectId: string;
workspaceSlug: string;
transferrableIssuesCount: number;
pendingIssues: number;
}

export const EndCycleModal: React.FC<Props> = () => <></>;
5 changes: 2 additions & 3 deletions web/core/components/cycles/list/cycle-list-item-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export const CycleListItemAction: FC<Props> = observer((props) => {
// derived values
const cycleStatus = cycleDetails.status ? (cycleDetails.status.toLocaleLowerCase() as TCycleGroups) : "draft";
const showIssueCount = useMemo(() => cycleStatus === "draft" || cycleStatus === "upcoming", [cycleStatus]);
const transferableIssuesCount = cycleDetails ? cycleDetails.total_issues - cycleDetails.completed_issues : 0;
const showTransferIssues = transferableIssuesCount > 0 && cycleStatus === "completed";
const showTransferIssues = cycleDetails.pending_issues > 0 && cycleStatus === "completed";
const isEditingAllowed = allowPermissions(
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
EUserPermissionsLevel.PROJECT,
Expand Down Expand Up @@ -254,7 +253,7 @@ export const CycleListItemAction: FC<Props> = observer((props) => {
}}
>
<TransferIcon className="fill-custom-primary-200 w-4" />
<span>Transfer {transferableIssuesCount} issues</span>
<span>Transfer {cycleDetails.pending_issues} issues</span>
</div>
)}

Expand Down
2 changes: 1 addition & 1 deletion web/core/components/cycles/quick-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const CycleQuickActions: React.FC<Props> = observer((props) => {
cycleId={cycleId}
projectId={projectId}
workspaceSlug={workspaceSlug}
transferrableIssuesCount={transferableIssuesCount}
pendingIssues={cycleDetails.pending_issues}
/>
</div>
)}
Expand Down

0 comments on commit 78f9643

Please sign in to comment.