Skip to content

Update MoneyRequestView.js #31084

Closed
Closed

Description

@cead22
  • Design Doc
  • Let's update MoneyRequestView.js
    • The following should only apply to users in the violations beta
    • Let's add a connection to the transactionViolations and policyCategories Onyx collections as shown in the code snippet below, which will go in the withOnyx section of the code at the bottom
    • Let's add the new onyx key for the transaction violation collection
    • Add a new transactionViolation prop
    • Pass the transactionViolation to the MoneyRequestView function
    • For each field that can have a violation, Inside OfflineWithFeedback and below MenuItemWithTopDescription let's add a View that wraps a Text component to show the violation text, as shown in the snippet below
      • The fields are merchant, amount, category, date, tag, comment, billable, receipt, and tax
    • Fields with violations that go into a new page, like a list page for the cate of category and description for instance, should show a RBR circle to the right, in front of the caret >. Screenshots below
withOnyx({
    …
    policyCategories: {
        key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report.policyID}`,
    },
    transactionViolation: {
        key: ({report}) => {
            const parentReportAction = ReportActionsUtils.getParentReportAction(report);
            const transactionID = lodashGet(parentReportAction, ['originalMessage', 'IOUTransactionID'], 0);
            return `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`;
        },
    },
...
{Boolean(ViolationUtils.getViolationForField(transactionViolation, 'amount')) && (
    <View>
        <Text style={[styles.ph5, styles.textLabelError]}>{ViolationUtils.getViolationForField(transactionViolation, 'amount')}</Text>
    </View>
)}

image
image

Activity

  1. melvin-bot commented on Nov 8, 2023

    @melvin-bot
  2. added
    ImprovementItem broken or needs improvement.
    and removed
    NewFeatureSomething to build that is a new item.
    on Nov 8, 2023
  3. cead22 commented on Nov 8, 2023

    @cead22
    ContributorAuthor

    @lindboe @cdanwards can you please comment here so I can assign you?

    (@NicMendonca sorry about that ping, that was a mistake)

  4. cdanwards commented on Nov 10, 2023

    @cdanwards
    Contributor

    Commenting for assignment

  5. cdanwards commented on Nov 10, 2023

    @cdanwards
    Contributor

    @cead22 I'm unable to see the 2 images listed at the end of the ticket description, do you mind providing screenshots?

  6. cead22 commented on Nov 10, 2023

    @cead22
    ContributorAuthor

    Can you try refreshing the page? GH adds a token to the image URLs and if you had this tab open before or you opened a cached version of this page, the token may not work. Let me know if that still doesn't work

  7. 26 remaining items

  8. aimane-chnaif commented on Feb 4, 2024

    @aimane-chnaif
    Contributor

    @cead22 C+ payment is pending here. Can you please reopen?

  9. reopened this on Feb 5, 2024
  10. melvin-bot commented on Feb 5, 2024

    @melvin-bot
  11. MitchExpensify commented on Feb 6, 2024

    @MitchExpensify
    Contributor

    Payment summary:

    C+: $500 @aimane-chnaif (Upwork job here)

  12. cead22 commented on Feb 23, 2024

    @cead22
    ContributorAuthor

    Can we close?

  13. aimane-chnaif commented on Feb 23, 2024

    @aimane-chnaif
    Contributor

    Not yet

  14. MitchExpensify commented on Feb 26, 2024

    @MitchExpensify
    Contributor

    Paid, contract ended, sorry for the delay!

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions