-
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: update options when creating task #39811
Fix: update options when creating task #39811
Conversation
…when-creating-task
@thesahindia 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] |
@thesahindia 👋 what is your ETA for this pr please? thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-10.at.2.08.02.AM.movAndroid: mWeb ChromeScreen.Recording.2024-04-10.at.1.59.51.AM.moviOS: NativeScreen.Recording.2024-04-10.at.2.30.24.AM.moviOS: mWeb SafariScreen.Recording.2024-04-10.at.2.25.32.AM.movMacOS: Chrome / SafariScreen.Recording.2024-04-10.at.1.55.27.AM.movMacOS: DesktopScreen.Recording.2024-04-10.at.2.15.55.AM.mov |
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!
const report = reports[missingReportId]; | ||
|
||
if (!report) { | ||
return; | ||
} |
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.
isnt this already captured in the condition above?
@@ -71,6 +74,31 @@ function OptionsListContextProvider({reports, children}: OptionsListProviderProp | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, [reports]); | |||
|
|||
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.
@TMisiukiewicz can you please add some comment here to explain what this is good for?
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.
added comments to each effect for easier understanding 👍
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.
One comment but not a blocker
const missingReportId = Object.keys(reports).find((key) => prevReports && !(key in prevReports)); | ||
const report = missingReportId ? reports[missingReportId] : null; | ||
if (!missingReportId || !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.
What if we merge collection of reports so there would be more reports missing in that single update, can that happen? @TMisiukiewicz
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.
@mountiny that's a valid point, however I couldn't find a quick way how could I test it with many reports, are you aware of any way how to do that? Are merge calls batched? If so, I assume there could be more than just a single ID missing. I can create a follow-up PR moving from find
to filter
✋ 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: 1.4.63-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
Details
If the task was created, it did not appear on the search list. There was no mechanism responsible for creating new option and putting it in the option list for newly created reports. This solution should be performant, since it looks for the report key that did not exist in the past, creates a single option and updates the report options.
Fixed Issues
$ #39705
PROPOSAL:
Tests
Offline tests
n/a
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.mp4
Android: mWeb Chrome
ANDROID.WEB.mov
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.WEB.mp4
MacOS: Chrome / Safari
WEB.mov
MacOS: Desktop
DESKTOP.mov