Skip to content

[Due for payment 2025-05-14] [$250] Remove $XX.XX from the submitted and approved system messages #58650

Closed

Description

@garrettmknight

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: N/A
Reproducible in staging?: N/A
Reproducible in production?: N/A
Email or phone of affected tester (no customers): N/A
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL: N/A
Issue reported by: @garrettmknight
Slack conversation (hyperlinked to channel name): #convert

Action Performed:

1.Submit a few expenses that total $50
2. Report totals $50, system message says ‘submitted $50’
3. Move another $50 expense to the Processing report
4. Report totals $100, report history only shows submitting $50
5. Approve the report

Expected Result:

We shouldn't be duplicating information about the report total when it already exists at the top of the report.

  • The submitted system message should simply read "Submitter submitted this report" if they manually submitted or "Submitter submitted this report via delay submission" if it was automatically submitted
  • The approved system message should also just read "Approver approved this report" if they manually approved or "Approver approved this report via workspace rules" if it was automatically approved

Let's update the system messages to this:

  • User submits a report manually: [Name] submitted
  • User submits a report via scheduled submit/delay submission: [Name] submitted via [workflow settings](link to workspace workflow settings help page)
  • User approves a report manually: [Name] approved
  • User approves a report via auto-approval: [Name] approved via [workspace rules](link to workspace rules settings help page)
  • User unapproves a report: [Name] unapproved

Actual Result:

The submitted and approved system messages include the report total, duplicating the information on the report.

Workaround:

Users can use the product, it's just confusing.

Platforms:

All

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021902157829644718864
  • Upwork Job ID: 1902157829644718864
  • Last Price Increase: 2025-03-19
  • Automatic offers:
    • FitseTLT | Contributor | 106734717
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 18, 2025
  2. melvin-bot commented on Mar 18, 2025

    @melvin-bot

    Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. changed the title [-]Remove $XX.XX from the submitted system message[/-] [+]Remove $XX.XX from the submitted and approved system messages[/+] on Mar 18, 2025
  4. FitseTLT commented on Mar 18, 2025

    @FitseTLT
    Contributor

    @garrettmknight What about unapproved system messages?

  5. garrettmknight commented on Mar 18, 2025

    @garrettmknight
    ContributorAuthor

    Good call, let's update those too - I also just tweaked the copy in the OP.

  6. FitseTLT commented on Mar 18, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Remove $XX.XX from the submitted and approved system messages

    What is the root cause of that problem?

    We add the amount for submitted and approved actions here

    App/src/libs/ReportUtils.ts

    Lines 5378 to 5403 in b0f5f9f

    function getReportAutomaticallySubmittedMessage(
    reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED> | ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED>,
    report?: Report,
    ) {
    return translateLocal('iou.automaticallySubmittedAmount', {formattedAmount: getFormattedAmount(reportAction, report)});
    }
    function getIOUSubmittedMessage(
    reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED> | ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED>,
    report?: Report,
    ) {
    return translateLocal('iou.submittedAmount', {formattedAmount: getFormattedAmount(reportAction, report)});
    }
    function getReportAutomaticallyApprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.APPROVED>, report?: Report) {
    return translateLocal('iou.automaticallyApprovedAmount', {amount: getFormattedAmount(reportAction, report)});
    }
    function getIOUUnapprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.UNAPPROVED>, report?: Report) {
    return translateLocal('iou.unapprovedAmount', {amount: getFormattedAmount(reportAction, report)});
    }
    function getIOUApprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.APPROVED>, report?: Report) {
    return translateLocal('iou.approvedAmount', {amount: getFormattedAmount(reportAction, report)});
    }

    we use these functions to display the report actions and copy to clipboard and so on.
    additionally we add amount for the system message in getIOUReportActionMessage here

    App/src/libs/ReportUtils.ts

    Lines 5515 to 5517 in b0f5f9f

    case CONST.REPORT.ACTIONS.TYPE.APPROVED:
    iouMessage = `approved ${amount}`;
    break;

    App/src/libs/ReportUtils.ts

    Lines 5539 to 5541 in b0f5f9f

    case CONST.REPORT.ACTIONS.TYPE.SUBMITTED:
    iouMessage = translateLocal('iou.submittedAmount', {formattedAmount: amount});
    break;

    App/src/libs/ReportUtils.ts

    Lines 5521 to 5523 in b0f5f9f

    case CONST.REPORT.ACTIONS.TYPE.UNAPPROVED:
    iouMessage = `unapproved ${amount}`;
    break;

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

    We can get the name from displayName of the reportAction.actorAccountID via getDisplayNameForParticipant and can give a fallback of the reportAction.person.text and pass as a param (similar to pay copy here) to new copies that align with the OP for their respective system messages.
    We use these copies for the above functions

    App/src/languages/en.ts

    Lines 968 to 970 in b0f5f9f

    submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `submitted ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
    automaticallySubmittedAmount: ({formattedAmount}: RequestedAmountMessageParams) =>
    `automatically submitted ${formattedAmount} via <a href="${CONST.DELAYED_SUBMISSION_HELP_URL}">delayed submission</a>`,

    App/src/languages/en.ts

    Lines 985 to 987 in b0f5f9f

    automaticallyApprovedAmount: ({amount}: ApprovedAmountParams) =>
    `automatically approved ${amount} via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
    approvedAmount: ({amount}: ApprovedAmountParams) => `approved ${amount}`,

    For iou.automaticallySubmittedAmount and iou.automaticallyApprovedAmount we easily replace the copies to the new copy.

    But for iou.submittedAmount and iou.approvedAmount we use them in other places as getIOUReportActionDisplayMessage which serve other purposes such as the copy to clipboard for money request actions (transaction thread report parent action) here

    } else if (isMoneyRequestAction(reportAction)) {
    const displayMessage = getIOUReportActionDisplayMessage(reportAction, transaction);
    if (displayMessage === Parser.htmlToText(displayMessage)) {
    Clipboard.setString(displayMessage);
    } else {
    setClipboardMessage(displayMessage);
    }

    which currently returns copies with amount and additional comment as submitted $12.00 for sdf so we might need the amount here so for this case and other cases we need them we can update the copies to handle both cases with and without amount or add a separate copy for these cases needed but we will need to confirm with the initial intention on the current issue.

    and also remove the amount from approved and unapproved system message here (we can also consider updating it to use the approved/unapproved copy same as we do for submitted message) and update similar to the new copy

    App/src/libs/ReportUtils.ts

    Lines 5515 to 5517 in b0f5f9f

    case CONST.REPORT.ACTIONS.TYPE.APPROVED:
    iouMessage = `approved ${amount}`;
    break;

    App/src/libs/ReportUtils.ts

    Lines 5521 to 5523 in b0f5f9f

    case CONST.REPORT.ACTIONS.TYPE.UNAPPROVED:
    iouMessage = `unapproved ${amount}`;
    break;

    Note: Updating this functions suffices to avoid showing the amount in these system messages but if we are going to update the reprotAction.message in getIOUReportActionMessage optimistically as above we will also need update BE (SUBMIT_REPORT APPROVE_MONEY_REQUEST unapprove) to create the action with the appropriate value consistent with these changes otherwise we can leave the changes of getIOUReportActionMessage and only update the way we display these system message in which case FE changes would be enough.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Test submit and approve actions to assert they create system messages with the appropriate message without amount if we are going to update the optimistic reportAction.message but if we don't we will not add tests as it will only be a copy change.

    What alternative solutions did you explore? (Optional)

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2025
  8. changed the title [-]Remove $XX.XX from the submitted and approved system messages[/-] [+][$250] Remove $XX.XX from the submitted and approved system messages[/+] on Mar 19, 2025
  9. melvin-bot commented on Mar 19, 2025

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2025
  11. melvin-bot commented on Mar 19, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External)

  12. 60 remaining items

  13. melvin-bot commented on May 7, 2025

    @melvin-bot

    @mananjadhav @Christinadobrzyn @mananjadhav The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. mananjadhav commented on May 11, 2025

    @mananjadhav
    Collaborator

    Once reverted, we can pay out.

    This was reverted and on production for a few days. @garrettmknight I think this can now be paid out.

  15. Christinadobrzyn commented on May 13, 2025

    @Christinadobrzyn
    Contributor

    Thanks @mananjadhav do we need a regression test?

  16. mananjadhav commented on May 15, 2025

    @mananjadhav
    Collaborator

    @Christinadobrzyn, No we decided to revert this PR. So no regression test and checklist needed. Just needs to be paid out.

  17. Christinadobrzyn commented on May 15, 2025

    @Christinadobrzyn
    Contributor

    Thanks @mananjadhav since the PR reverted I think it's a 50% penalty.

    Payment summary here - #58650 (comment)

    Please make sure to request payment in ND. Closing this out!

  18. FitseTLT commented on May 15, 2025

    @FitseTLT
    Contributor

    Thanks @mananjadhav since the PR reverted I think it's a 50% penalty.

    Payment summary here - #58650 (comment)

    No penalities it is a change of plan no any regression read #58650 (comment) 😄 @Christinadobrzyn

  19. Christinadobrzyn commented on May 15, 2025

    @Christinadobrzyn
    Contributor

    Ah sorry! Thank you! Paying it out in full. Updating the payment summary - #58650 (comment)

  20. mananjadhav commented on May 15, 2025

    @mananjadhav
    Collaborator

    Discussed with @Christinadobrzyn on DM and posting it here as well. The revert wasn’t because of a bug but change in requirement and that it’ll be handled as a larger change in another issue.

  21. garrettmknight commented on May 20, 2025

    @garrettmknight
    ContributorAuthor

    $250 approved for @mananjadhav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions