Skip to content

Commit 827b444

Browse files
authored
Merge pull request Expensify#87775 from Expensify/claude-filterPendingDeleteFromApprovalWorkflows
Filter pending-delete members from approval workflows
2 parents 29aca3b + 0513632 commit 827b444

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/libs/WorkflowUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ function convertPolicyEmployeesToApprovalWorkflows({policy, personalDetails, fir
164164
};
165165
}
166166

167-
approvalWorkflows[submitsTo].members.push(member);
167+
if (pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
168+
approvalWorkflows[submitsTo].members.push(member);
169+
}
168170
// Only propagate ADD/UPDATE pending actions to the workflow, not DELETE
169171
// When a member is being deleted from the workspace, their DELETE pending action
170172
// should not affect the workflow's display state (e.g., strikethrough styling)

src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsApproverPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ function WorkspaceWorkflowsApprovalsApproverPage({policy, personalDetails, isLoa
6767
return null;
6868
}
6969

70+
if (employee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
71+
return null;
72+
}
73+
7074
if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email) && visibleSelectedApproverEmail !== email) {
7175
return null;
7276
}

src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsOverLimitApproverPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ function WorkspaceWorkflowsApprovalsOverLimitApproverPage({policy, personalDetai
5858
return null;
5959
}
6060

61+
if (employee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
62+
return null;
63+
}
64+
6165
if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email)) {
6266
return null;
6367
}

0 commit comments

Comments
 (0)