-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix/32302: Note editor open #32327
Fix/32302: Note editor open #32327
Conversation
src/pages/ReportDetailsPage.js
Outdated
const isPrivateNotesFetchTriggered = !_.isUndefined(props.report.isLoadingPrivateNotes); | ||
|
||
useEffect(() => { | ||
// Do not fetch private notes if isLoadingPrivateNotes is already defined, or if network is offline. | ||
if (isPrivateNotesFetchTriggered || props.network.isOffline) { | ||
return; | ||
} | ||
|
||
Report.getReportPrivateNote(props.report.reportID); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps -- do not add report.isLoadingPrivateNotes to dependencies | ||
}, [props.report.reportID, props.network.isOffline, isPrivateNotesFetchTriggered]); | ||
|
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.
This change based on the existed logic:
App/src/pages/home/report/withReportAndPrivateNotesOrNotFound.js
Lines 60 to 68 in 6301426
useEffect(() => { | |
// Do not fetch private notes if isLoadingPrivateNotes is already defined, or if network is offline. | |
if (isPrivateNotesFetchTriggered || network.isOffline) { | |
return; | |
} | |
Report.getReportPrivateNote(report.reportID); | |
// eslint-disable-next-line react-hooks/exhaustive-deps -- do not add report.isLoadingPrivateNotes to dependencies | |
}, [report.reportID, network.isOffline, isPrivateNotesFetchTriggered]); |
@@ -76,6 +77,17 @@ function ReportDetailsPage(props) { | |||
|
|||
const isGroupDMChat = useMemo(() => ReportUtils.isDM(props.report) && participants.length > 1, [props.report, participants.length]); | |||
|
|||
const isPrivateNotesFetchTriggered = !_.isUndefined(props.report.isLoadingPrivateNotes); | |||
|
|||
useEffect(() => { |
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.
We have a hook WithReportAndPrivateNotesOrNotFound
to fetch the private note, I think we can use that, right?
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.
But we need to add more props to WithReportAndPrivateNotesOrNotFound
to not display FullScreenLoadingIndicator
or NotFoundPage
(in case users are in report detail page) because this hook have the logic:
App/src/pages/home/report/withReportAndPrivateNotesOrNotFound.js
Lines 89 to 104 in 6301426
if (shouldShowFullScreenLoadingIndicator) { | |
return <FullScreenLoadingIndicator />; | |
} | |
if (shouldShowNotFoundPage) { | |
return <NotFoundPage />; | |
} | |
return ( | |
<WrappedComponent | |
// eslint-disable-next-line react/jsx-props-no-spreading | |
{...props} | |
ref={forwardedRef} | |
/> | |
); | |
} |
what do you think?
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.
That might change behavior. The logic used in our current method is quite different and might not be suitable after replacing HOC. IMO we don't expect to see a 'not found' screen.
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.
To clarify, changing the logic in the HOC won't reflect what it does based on its name.
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.
That might change behavior
So I think we should keep the current logic rather than using WithReportAndPrivateNotesOrNotFound
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 think that's fine, then. Thanks for having a look.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb ChromeiOS: Nativeios.moviOS: mWeb SafariNagranie.z.ekranu.2023-12-1.o.10.51.35.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Nice thank you for the fix @DylanDylann. |
@chiragsalian I just updated the QA steps. Thanks for notices me |
🚀 Cherry-picked to staging by https://github.com/yuwenmemon in version: 1.4.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to staging by https://github.com/techievivek in version: 1.4.8-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.8-3 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.8-3 🚀
|
Details
Fixed Issues
$ #32302
PROPOSAL:
Tests
Step from here. Confirm there is no issue.
Offline tests
QA Steps
Step from here. Confirm there is no issue.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screencast.from.01-12-2023.10.40.57.webm
MacOS: Desktop