-
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
Remove export ReportUtil.getReport function #43632
Conversation
@@ -61,7 +59,7 @@ function MentionReportRenderer({style, tnode, TDefaultRenderer, reports, ...defa | |||
const htmlAttributeReportID = tnode.attributes.reportid; | |||
|
|||
const currentReportID = useCurrentReportID(); | |||
const currentReport = getReport(currentReportID?.currentReportID); | |||
const [currentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${currentReportID?.currentReportID}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getReport
returns either the report or the draft report. Are we sure that in this case we are only interested in the report? (Please double check on other instances too). You may refer to #40668 and its PRs to see where we may need to fallback to the draft report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s77rt I checked the mentioned PR when investigating this PR. The draft report is only used when we move transaction from track expense. It will be cleared in optimistic data when we confirm to move the transaction from track expense and it's not used to display any other UI of the App.
src/components/Attachments/AttachmentCarousel/extractAttachments.ts
Outdated
Show resolved
Hide resolved
src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx
Outdated
Show resolved
Hide resolved
There is a function |
Co-authored-by: Abdelhafidh Belalia <[email protected]>
Co-authored-by: Abdelhafidh Belalia <[email protected]>
@s77rt I updated. please help to check again. |
Reviewer Checklist
Screenshots/Videos |
After creating a group chat the app crashes Screen.Recording.2024-06-17.at.6.48.44.PM.mov |
Co-authored-by: Abdelhafidh Belalia <[email protected]>
Co-authored-by: Abdelhafidh Belalia <[email protected]>
@s77rt I fixed the bug above and updated your suggestion, please help to check again. |
src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx
Outdated
Show resolved
Hide resolved
Bug: Can't submit an expense (IOU info keep resetting) Screen.Recording.2024-06-18.at.4.06.57.PM.mov |
@s77rt I updated to fallback reportID to
I can't reproduce this bug now. |
src/libs/ReportUtils.ts
Outdated
@@ -1227,7 +1227,8 @@ function isClosedExpenseReportWithNoExpenses(report: OnyxEntry<Report>): boolean | |||
/** | |||
* Whether the provided report is an archived room | |||
*/ | |||
function isArchivedRoom(report: OnyxInputOrEntry<Report> | EmptyObject, reportNameValuePairs?: OnyxInputOrEntry<ReportNameValuePairs> | EmptyObject): boolean { | |||
function isArchivedRoom(reportOrID: OnyxInputOrEntry<Report> | EmptyObject | string, reportNameValuePairs?: OnyxInputOrEntry<ReportNameValuePairs> | EmptyObject): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking at this one (and also isInvoiceRoom
above) and I don't really like that the first param could be either a reportID (string) or a report (object). It makes the code feel much less uncertain and if I was looking at it, I'd be wondering when I should use a reportID vs just a report. Some suggestions I have:
- Keep it two separate parameters for clarity
(reportID, report)
- Make two separate methods
- Anywhere that is only using the
reportID
, have it get the report from the collection first and then these methods would only have areport
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking at this one (and also isInvoiceRoom above) and I don't really like that the first param could be either a reportID (string) or a report (object). It makes the code feel much less uncertain and if I was looking at it, I'd be wondering when I should use a reportID vs just a report. Some suggestions I have:
It's the same way we use for other functions like isMoneyRequestReport
, isMoneyRequest
,...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I don't think that is a pattern that we should be following, so let's not do it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgolen I updated with two separate methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I really appreciate you stepping in and taking this one over. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Hi all 👋 I think this PR broke the room mentions 😅 This is the draft PR which should fix the issue. |
@war-in I can take this and raise a PR to fix this issue. |
🚀 Deployed to staging by https://github.com/tgolen in version: 9.0.1-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.1-19 🚀
|
Details
EnforceActionExportRestrictions.ts
Fixed Issues
$ #40316
PROPOSAL: #40316 (comment)
Tests
getReport
function isn't exported and is only used in the local action filesuseOnyx()
to load the data in view componentsCopy to clipboard
Offline tests
Same as above
QA Steps
Copy to clipboard
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-06-13.at.12.53.18.mov
Screen.Recording.2024-06-13.at.12.53.50.mov
Android: mWeb Chrome
Screen.Recording.2024-06-13.at.12.52.34.mov
Screen.Recording.2024-06-13.at.12.52.46.mov
iOS: Native
Screen.Recording.2024-06-13.at.13.01.31.mov
Screen.Recording.2024-06-13.at.13.01.50.mov
iOS: mWeb Safari
Screen.Recording.2024-06-13.at.12.54.51.mov
Screen.Recording.2024-06-13.at.12.55.07.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-13.at.12.51.14.mov
Screen.Recording.2024-06-13.at.12.51.27.mov
MacOS: Desktop
Screen.Recording.2024-06-13.at.12.58.30.mov
Screen.Recording.2024-06-13.at.12.58.40.mov