-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[PAID] [$500] Update getIOUReportActionDisplayMessage() to accept the transaction as a parameter #38355
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01cae110240999840b |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
Triggered auto assignment to @strepanier03 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update getIOUReportActionDisplayMessage() to accept the transaction as a parameter What is the root cause of that problem?Enhancement What changes do you think we should make in order to solve the problem?Update Lines 4958 to 4959 in 02e8025
and pass transaction from withOnyx (using transactionID action.originalMessage.IOUTransactionID ) for REportactionItem here
And for context menu action we will subscribe to transaction in here App/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx Lines 280 to 284 in 02e8025
we will pass reportActions and reportActionID to the key and we will subscribe to transaction with transactionID we get from the report action's originalMessage.IOUTransactionID and pass the transaction to onPress in the payload when the context menu item is copy to clipboard ( textTranslateKey=='reportActionContextMenu.copyToClipboard') hereApp/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx Lines 264 to 265 in 02e8025
and we will pass the transaction when we call getIOUReportActionDisplayMessage App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx Lines 366 to 367 in 02e8025
What alternative solutions did you explore? (Optional)for the context menu ,of course we can omit the transaction parameter and continue the current method of fetching transaction as we are currently doing because we don't have stale data worry for it as the function will be executed when the user presses copy to clipboard not when context menu component is first rendered 👍 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update getIOUReportActionDisplayMessage() to accept the transaction as a parameter What is the root cause of that problem?We want to update Line 4928 in aca0f8c
What changes do you think we should make in order to solve the problem?First we need to update function getIOUReportActionDisplayMessage( transaction OnyxEntry<Transaction>): string { Then remove the Lines 4958 to 4959 in aca0f8c
Finally we need to get
What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update getIOUReportActionDisplayMessage() to accept the transaction as a parameter What is the root cause of that problem?Enhancement What changes do you think we should make in order to solve the problem?We need to pass transaction from these two places, in
Here we need to accept transaction prop and remove the line. Lines 4925 to 4928 in 2737e44
Line 4958 in 2737e44
ResultAlternativeInstead of adding additional prop, we can utilize the transactions we have in allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${iouMessage?.IOUTransactionID}`] ?? ({} as Transaction) Lines 499 to 509 in 2737e44
|
Updated ProposalRemoved the reference of |
Proposal UpdateAdded minor detail. |
@Krishna2323 Why do you suggest using |
In context menu action the funtion is called when the user press copy to clipboard and the transaction we get with |
@FitseTLT I think it's better to connect the context menu to onyx to get the data it needs:
All of this results in higher-quality, easier to maintain, easier to debug code across the app. |
Update based on #38355 (comment) |
@tgolen, I think we can simply use the Line 2267 in 2faffcd
Line 5072 in 2faffcd
I have updated my proposal |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update getIOUReportActionDisplayMessage to accept the transaction as a parameter What is the root cause of that problem?We should pass What changes do you think we should make in order to solve the problem?
and then we can remove this line Line 4983 in 4e599b2
And then add
Test branch: https://github.com/nkdengineer/App/tree/fix/38355 What alternative solutions did you explore? (Optional)NA |
@FitseTLT @Krishna2323 @GandalfGwaihir. Thanks for the proposals, everyone. There are a few things that don't look good to me in your proposals:
|
I'm inclined to @nkdengineer's proposal here #38355 (comment):
🎀👀🎀 C+ reviewed |
Current assignee @tgolen is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Really don't get it @hoangzinh I think you misunderstood me I am proposing same as the selected proposal and I did propose to pass the transaction in the payload of
I really think you should give my proposal a second look. I have stated what should be done in detail same as the selected proposal and giving code snippet is not a must when a contributor provides what should be done in detail as I did
cc: @tgolen |
Hi @FitseTLT just wanna confirm that, in your proposal, you mentioned that you would pass
And only pass |
Yes. App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx Lines 332 to 333 in e9c112a
That's why I said 👍 |
I discussed this with @hoangzinh and we agreed to go with the proposal from @FitseTLT. It was the most complete and it was posted earlier than the proposal from nkdengineer. |
@davidcardoza - Because it seemed like the best fit based on this doc. I originally thought VSB but it says anything related to IOU and bills are "elsewhere". Then under VIP-bills it says "Anything related to bills and invoicing as part of an IOU request". |
That makes sense, thanks for explaining. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-15. 🎊 For reference, here are some details about the assignees on this issue:
|
This comment was marked as resolved.
This comment was marked as resolved.
@hoangzinh - Please complete the checklist as soon as you can and then I'll handle your payment. @FitseTLT - I've paid your contract and closed it in Upwork, thanks! |
Hi @strepanier03 we don't have a checklist for this issue because it's not a bug fix but a technical improvement. |
oh @tgolen @FitseTLT we still have another follow-up task here #38882 (comment) |
Yeah, I've got that follow-up issue assigned to me:
#39408
I'll take a look at the logs today and see what I find.
…On Wed, Apr 17, 2024 at 4:31 AM Vinh Hoang ***@***.***> wrote:
oh @tgolen <https://github.com/tgolen> @FitseTLT
<https://github.com/FitseTLT> we still have another follow-up task here #38882
(comment)
<#38882 (comment)>
—
Reply to this email directly, view it on GitHub
<#38355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMAB7LY6SXWEYW35LJJ43Y5ZFQ7AVCNFSM6AAAAABEWY4LNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQHE2DGOJRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks @hoangzinh for clarification 🙌. |
Okay, this is all paid out and contracts are closed. Thank you both, @hoangzinh and @FitseTLT, for your work on this. |
This is coming from #27262. You can read the issue description there to get context behind the problem being solved and the mess being cleaned up.
Problem
ReportUtils.getIOUReportActionDisplayMessage()
is called from a view component. It contains logic which callsconst transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID ?? '');
(a deprecated method).Why this is important to fix
It maintains more pure and exact flow of data through the react application. If the view is using transaction data, then it needs to subscribe to the transaction in Onyx so that it's assured that the transaction object will never be stale or out-of-date.
Solution
transaction
as a parameter togetIOUReportActionDisplayMessage()
and get the parameter fromwithOnyx()
in the view component.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @strepanier03The text was updated successfully, but these errors were encountered: