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

Update MoneyRequestView.js #31084

Closed
cead22 opened this issue Nov 8, 2023 · 26 comments
Closed

Update MoneyRequestView.js #31084

cead22 opened this issue Nov 8, 2023 · 26 comments
Assignees
Labels
Engineering Improvement Item broken or needs improvement. NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@cead22
Copy link
Contributor

cead22 commented Nov 8, 2023

  • 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

@cead22 cead22 added Engineering Daily KSv2 NewFeature Something to build that is a new item. labels Nov 8, 2023

This comment was marked as off-topic.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 8, 2023
@cead22 cead22 added Improvement Item broken or needs improvement. and removed NewFeature Something to build that is a new item. labels Nov 8, 2023
@cead22
Copy link
Contributor Author

cead22 commented Nov 8, 2023

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

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

@cdanwards
Copy link
Contributor

Commenting for assignment

@cdanwards
Copy link
Contributor

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

@cead22
Copy link
Contributor Author

cead22 commented Nov 10, 2023

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

@lindboe
Copy link
Contributor

lindboe commented Nov 10, 2023

@cead22 Refreshing doesn't seem to work.

I'm not familiar with this token idea? The URL that I see that it is opening in my browser is https://github.com/Expensify/Expensify/assets/165133/557c3ea2-a268-4415-8331-0e5963b20a2c, if it helps. I know we don't have access to that particular repo.

@trevor-coleman
Copy link
Contributor

@cead22 -- In you description you list:

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

There doesn't appear to be a tax field in this view. Should the tax warning go on the amount?

Copy link

melvin-bot bot commented Nov 16, 2023

📣 @trevor-coleman! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@cead22
Copy link
Contributor Author

cead22 commented Nov 17, 2023

There doesn't appear to be a tax field in this view. Should the tax warning go on the amount?

No, the tax ones will go into the tax field once we have it. You can ignore that field for now

@trevor-coleman
Copy link
Contributor

trevor-coleman commented Nov 21, 2023

As we discussed here it's possible to have multiple violations per field.

How should we handle that.

I can see two ways to do it:

(for examples assume violations is the array of translated violation names) :

1. Iterate over the array and map to individual text components :

<View>
    {violations.map((violation) =>(<Text key={violation} ... >{violation}</Text>)}
</View>

2. Join the members of the array with a comma in the text field:

        <Text ... >{violations.join(', ')}</Text>
)}

@cead22
Copy link
Contributor Author

cead22 commented Nov 21, 2023

Let's go with 1. Every field except for receipt will only have 1 violation, and for the receipt ones, we want to show them one below the other, not separated by commas. Does that make sense?

@trevor-coleman
Copy link
Contributor

Perfect thanks.

@cead22 cead22 changed the title [HOLD 31083] Update MoneyRequestView.js Update MoneyRequestView.js Dec 4, 2023
@cead22
Copy link
Contributor Author

cead22 commented Dec 4, 2023

Off hold

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Dec 4, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

This issue has not been updated in over 15 days. @cdanwards eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@cdanwards
Copy link
Contributor

@trevor-coleman is working on this.

@trevor-coleman
Copy link
Contributor

Yeah it's done just need to update to match the changes from ViolationUtils and the PR will be up today.

@cead22 cead22 self-assigned this Dec 5, 2023
@trevor-coleman
Copy link
Contributor

Sorry this will take a bit longer, I'm used to being able to make PRs when the code is ready, but completing the checklist will take some time -- probably the rest of today at least.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Monthly KSv2 labels Dec 6, 2023
@trevor-coleman
Copy link
Contributor

PR is up: #32594

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 1, 2024
Copy link

melvin-bot bot commented Jan 1, 2024

This issue has not been updated in over 15 days. @cead22, @cdanwards eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@cdanwards
Copy link
Contributor

PR has been merged

@cead22 cead22 closed this as completed Jan 11, 2024
@aimane-chnaif
Copy link
Contributor

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

@cead22 cead22 reopened this Feb 5, 2024
@cead22 cead22 added the NewFeature Something to build that is a new item. label Feb 5, 2024
Copy link

melvin-bot bot commented Feb 5, 2024

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Monthly KSv2 labels Feb 5, 2024
@MitchExpensify
Copy link
Contributor

MitchExpensify commented Feb 6, 2024

Payment summary:

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

@cead22
Copy link
Contributor Author

cead22 commented Feb 23, 2024

Can we close?

@aimane-chnaif
Copy link
Contributor

Not yet

@MitchExpensify
Copy link
Contributor

Paid, contract ended, sorry for the delay!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Improvement Item broken or needs improvement. NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants