Skip to content

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

Closed

Description

@kevinksullivan

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 19, 2023
  2. melvin-bot commented on Oct 19, 2023

    @melvin-bot

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

  3. melvin-bot commented on Oct 19, 2023

    @melvin-bot

    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
  4. rayane-d commented on Oct 19, 2023

    @rayane-d
    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)

  5. kevinksullivan commented on Oct 19, 2023

    @kevinksullivan
    ContributorAuthor

    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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions