-
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
Remain draft comment when switching to current chat #41338
Conversation
@Santhosh-Sellavel Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@nkdengineer 17 commits is too much here can we clean that up by making only the final changes in a single commit. Also there's a typo in method naming |
@Santhosh-Sellavel Updated to merge all commits and fix the typo bug. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-05-05.at.2.53.15.PM.movAndroid: mWeb ChromemwebDraft.moviOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2024-05-04.at.2.41.01.AM.movMacOS: DesktopScreen.Recording.2024-05-04.at.2.45.25.AM.movNote: Unable to capture the exact steps as screen record for iOS platform tests in simulator. So skipped recording. |
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.
Also, Resolve conflicts
src/libs/actions/Report.ts
Outdated
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, prepareDraftComment(comment)); | ||
} | ||
|
||
function saveReportDraftCommentWithCallback(reportID: string, comment: string | null, callback: () => void) { | ||
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, prepareDraftComment(comment)).then(callback); | ||
} | ||
|
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.
Do we need a separate method for callback alone?
Can we add the callback to existing method and by default callback param empty if not passed?
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.
@Santhosh-Sellavel I updated.
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.
LGTM, tests well!
A Small NAB
@@ -344,6 +344,20 @@ function ComposerWithSuggestions( | |||
[], | |||
); | |||
|
|||
useEffect(() => { | |||
const switchToCurrentReport = DeviceEventEmitter.addListener(`switchToCurrentReport_${reportID}`, ({preexistingReportID, callback}) => { |
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.
NAB switchToCurrentReport_
can be switchToPreExistingReport_
. Because that's what the event it is 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.
Make sense.
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 updated.
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.
LGTM, thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/bondydaa in version: 1.4.72-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.72-1 🚀
|
@@ -1246,13 +1246,17 @@ function handleReportChanged(report: OnyxEntry<Report>) { | |||
// In this case, the API will let us know by returning a preexistingReportID. | |||
// We should clear out the optimistically created report and re-route the user to the preexisting report. | |||
if (report?.reportID && report.preexistingReportID) { | |||
Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, null); |
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 line removal caused regression.
We added back in #43633.
Details
Remain draft comment when switching to current chat
Fixed Issues
$ #38983
PROPOSAL: #38983 (comment)
Tests
Offline tests
None
QA Steps
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-04-30.at.21.02.47.mov
Android: mWeb Chrome
Screen.Recording.2024-04-30.at.21.16.12.mov
iOS: Native
Screen.Recording.2024-04-30.at.21.31.02.mov
iOS: mWeb Safari
Screen.Recording.2024-04-30.at.21.18.47.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-30.at.21.00.52.mov
MacOS: Desktop
Screen.Recording.2024-04-30.at.21.33.38.mov