Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/libs/WorkflowUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ function convertPolicyEmployeesToApprovalWorkflows({policy, personalDetails, fir
};
}

approvalWorkflows[submitsTo].members.push(member);
if (pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
approvalWorkflows[submitsTo].members.push(member);
}
// Only propagate ADD/UPDATE pending actions to the workflow, not DELETE
// When a member is being deleted from the workspace, their DELETE pending action
// should not affect the workflow's display state (e.g., strikethrough styling)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ function WorkspaceWorkflowsApprovalsApproverPage({policy, personalDetails, isLoa
return null;
}

if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email) && visibleSelectedApproverEmail !== email) {
if (employee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return null;
}

if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email) && visibleSelectedApproverEmail !== email) {

// Do not allow the same email to be added twice
const isEmailAlreadyInApprovers = approversFromWorkflow?.some((approver, index) => approver?.email === email && index !== approverIndex);
if (isEmailAlreadyInApprovers && visibleSelectedApproverEmail !== email) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ function WorkspaceWorkflowsApprovalsOverLimitApproverPage({policy, personalDetai
return null;
}

if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email)) {
if (employee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return null;
}

if (!isDefault && policy?.preventSelfApproval && membersEmail?.includes(email)) {

if (email === currentApproverEmail) {
return null;
}
Expand Down