Fix/28599: Pressing back while writting notes make text disappear#29149
Conversation
|
@robertKozik 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] |
src/libs/actions/Report.js
Outdated
| const draftNoteMap = {}; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT, | ||
| callback: (value, key) => { | ||
| if (!key) { | ||
| return; | ||
| } | ||
|
|
||
| const reportID = key.replace(ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT, ''); | ||
| draftNoteMap[reportID] = value; | ||
| }, | ||
| }); |
There was a problem hiding this comment.
As I see most of the similar statements are on the top of the file, can we move it there?
There was a problem hiding this comment.
Yeah, we can do it. just updated it, please help check
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeios.-.android.-.web.movMobile Web - Safariios.-.android.-.web.movDesktopdesktop.moviOSios.-.android.-.native.movAndroidios.-.android.-.native.mov |
src/libs/actions/Report.js
Outdated
| Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {privateNotes: {[accountID]: {errors: null}}}); | ||
| } | ||
|
|
||
| export default function getDraftPrivateNote(reportID) { |
There was a problem hiding this comment.
I missed that one before, why this function is export default? Can we get rid of it? Other functions don't need it @DylanDylann
There was a problem hiding this comment.
Updated. Please help check
| }, | ||
| }); | ||
|
|
||
| const draftNoteMap = {}; |
There was a problem hiding this comment.
NAB: Maybe privateNotesDraftMap? So we exactly know it is something related to private notes feature.
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.81-4 🚀
|
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.83-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
2 similar comments
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
| const parser = new ExpensiMark(); | ||
| const [privateNote, setPrivateNote] = useState(parser.htmlToMarkdown(lodashGet(report, ['privateNotes', route.params.accountID, 'note'], '')).trim()); | ||
| const [privateNote, setPrivateNote] = useState( | ||
| Report.getDraftPrivateNote(report.reportID) || parser.htmlToMarkdown(lodashGet(report, ['privateNotes', route.params.accountID, 'note'], '')).trim(), |
There was a problem hiding this comment.
We forgot to trim the value acquired from Report.getDraftPrivateNote
There was a problem hiding this comment.
@DylanDylann can you spin up a PR to fix this? 🙏🏼
There was a problem hiding this comment.
@MariaHCD @robertKozik Sorry for the wait there. I am working on it now
There was a problem hiding this comment.
#30357 PR is ready for review @robertKozik
|
Coming from #30076. The draft value should be cleared when the save button is pressed. |
Details
[Feature Request] Pressing back while writing notes makes text disappear
Fixed Issues
$ #28599
PROPOSAL: #28599 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screencast.from.10-10-2023.12.56.09.webm
Android: mWeb Chrome
private-chrome-android.mp4
iOS: Native
ios.mov
iOS: mWeb Safari
Mios.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
deks.mov