Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HIGH] [P2P ACTIVATION] Preview component for pending payment is incorrect #30034

Closed
kevinksullivan opened this issue Oct 19, 2023 · 4 comments
Closed
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kevinksullivan
Copy link
Contributor

See slack thread

Coming from #29430

the preview component header is not using the correct format. It should say %firstName% paid (pending) (first screenshot), rather than using the dot separator shown in-app right now (second screenshot).

image

image

@kevinksullivan kevinksullivan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@rayane-djouah
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Preview component for pending payment is incorrect.

What is the root cause of that problem?

the root cause is in this function:

const getPreviewHeaderText = () => {
if (isDistanceRequest) {
return props.translate('common.distance');
}
if (isScanning) {
return props.translate('common.receipt');
}
if (props.isBillSplit) {
return props.translate('iou.split');
}
if (isExpensifyCardTransaction) {
let message = props.translate('iou.card');
if (TransactionUtils.isPending(props.transaction)) {
message += ` • ${props.translate('iou.pending')}`;
}
return message;
}
let message = props.translate('iou.cash');
if (ReportUtils.isControlPolicyExpenseReport(props.iouReport) && ReportUtils.isReportApproved(props.iouReport) && !ReportUtils.isSettled(props.iouReport)) {
message += ` • ${props.translate('iou.approved')}`;
} else if (props.iouReport.isWaitingOnBankAccount) {
message += ` • ${props.translate('iou.pending')}`;
}
return message;
};

What changes do you think we should make in order to solve the problem?

we should change the function logic here as follow:

if (isExpensifyCardTransaction) {
    let message ='';
    if (TransactionUtils.isPending(props.transaction)) {
        const firstname = ReportUtils.getDisplayNameForParticipant(managerID, true);
        message = firstname;
        message += `${props.translate('iou.paid')} (${props.translate('iou.pending')})`;
    }
    else {
    message = props.translate('iou.card');
    }
    return message;
}

let message ='';
if (ReportUtils.isControlPolicyExpenseReport(props.iouReport) && ReportUtils.isReportApproved(props.iouReport) && !ReportUtils.isSettled(props.iouReport)) {
    message = `${props.translate('iou.cash')}${props.translate('iou.approved')}`;
} else if (props.iouReport.isWaitingOnBankAccount) {
        const firstname = ReportUtils.getDisplayNameForParticipant(managerID, true);
        message = firstname;
        message += `${props.translate('iou.paid')} (${props.translate('iou.pending')})`;
}
return message;

What alternative solutions did you explore? (Optional)

@kevinksullivan
Copy link
Contributor Author

NVM, per this convo I am closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

4 participants