-
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
Add comment text update by edit comment #51422
Add comment text update by edit comment #51422
Conversation
# Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts # tests/unit/RequestConflictUtilsTest.ts
# Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts # tests/unit/RequestConflictUtilsTest.ts
…mment_text_update_by_edit_comment # Conflicts: # src/libs/actions/Report.ts # src/libs/actions/RequestConflictUtils.ts # tests/actions/ReportTest.ts
@dukenv0307 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] |
@gedu Lints are failed. |
…mment_text_update_by_edit_comment # Conflicts: # tests/unit/RequestConflictUtilsTest.ts
@gedu Is it ready for review? |
@dukenv0307 yes |
tests/ui/PaginationTest.tsx
Outdated
@@ -275,7 +275,6 @@ describe('Pagination', () => { | |||
|
|||
it('opens a chat and load initial messages', async () => { | |||
mockOpenReport(5, '5'); | |||
|
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 is unnecessary
Looks good, just one small problem ^ |
@gedu Can you add the test steps on the |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-30.at.11.00.01.movAndroid: mWeb ChromeScreen.Recording.2024-10-30.at.10.45.46.moviOS: NativeScreen.Recording.2024-10-30.at.10.58.45.moviOS: mWeb SafariScreen.Recording.2024-10-30.at.00.18.45.movMacOS: Chrome / Safariweb-resize.mp4MacOS: Desktopweb-resize.mp4 |
@gedu Bug:
Actual result: Expected result: |
@dukenv0307 It's not a bug, I commented here: #50074 (comment), technically we are editing so showing the edit it is ok, and because later we are merging the edit and the add, the |
Thank you @gedu. LGTM |
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.
Just NAB comments
PersistedRequests.save(newRequest); | ||
} else if (conflictAction.type === 'replace') { | ||
PersistedRequests.update(conflictAction.index, conflictAction.request ?? newRequest); | ||
} else if (conflictAction.type === 'delete') { |
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.
Might be good to make these types a const at this point
if (request.command === WRITE_COMMANDS.OPEN_REPORT && request.data?.parentReportActionID === reportActionID && reportActionID in commentCouldBeThread) { | ||
const indexToRemove = commentCouldBeThread[reportActionID]; | ||
commentIndicesToDelete.splice(indexToRemove, 1); | ||
// The new message performs some changes in Onyx, we want to keep those changes. |
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.
// The new message performs some changes in Onyx, we want to keep those changes. | |
// The new message performs some changes in Onyx, we want to keep those changes. |
|
||
Report.addComment(REPORT_ID, 'Testing a comment'); | ||
// Need the reportActionID to delete the comments |
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.
Report.addComment(REPORT_ID, 'Testing a comment'); | |
// Need the reportActionID to delete the comments | |
Report.addComment(REPORT_ID, 'Testing a comment'); | |
// Need the reportActionID to delete the comments |
✋ 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/mountiny in version: 9.0.56-0 🚀
|
Details
When a EditComment is fired, the code will look for an AddComment or AttachmentWithText, if found it will look any UpdateComment in the middle to delete it, will get the AddMessage and update just the text from the EditComment.
This code is depends on: #50919
Fixed Issues
$ #50074
PROPOSAL: -
Tests
Normal Flow
Pending Flow
Offline tests
Delete No requests:
No delete Threads
All the request must be sent
Update:
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
updateCommentText_chrome.mp4
UpdateCommentText_safari.mp4
MacOS: Desktop
UpdateCommentText_desktop.mp4