Skip to content

Commit 098e4bd

Browse files
Filter pending-delete members from approval workflows and approver list
When a member is removed offline, they have pendingAction: 'delete' but remain in employeeList until server confirms. This change skips those members when building per-workflow member lists and the approver selection list, matching the existing filter for availableMembers. Co-authored-by: parasharrajat <parasharrajat@users.noreply.github.com>
1 parent 7d55eda commit 098e4bd

2 files changed

Lines changed: 7 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
}

0 commit comments

Comments
 (0)