-
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
[No QA] [TS Migration] Standardize approach to Onyx pendingFields #34799
[No QA] [TS Migration] Standardize approach to Onyx pendingFields #34799
Conversation
@roryabraham Could you please clarify what fields can be in the |
I think prettymuch any key on the onyx entity can be pending. No limitations as far as I know |
# Conflicts: # src/libs/SidebarUtils.ts
# Conflicts: # src/libs/SidebarUtils.ts # src/types/onyx/Policy.ts # src/types/onyx/Report.ts # src/types/onyx/ReportAction.ts
@roryabraham How do you think, should we apply offline feedback props ( |
# Conflicts: # src/types/onyx/Report.ts
@roryabraham kind bump on the question above 🙂 |
# Conflicts: # src/types/onyx/Transaction.ts
@roryabraham Could you please take a look at the question above? |
# Conflicts: # src/types/onyx/Policy.ts # src/types/onyx/Report.ts
Maybe it makes sense to use generics to specify which fields can be pending? So more the latter option. |
@roryabraham Just to be true I didn't get your answer, so I'll provide more detailed information to be sure we are on the same page. 1st variant of implementation (implemented in this PR right now): We have This type returns provided onyx type with additional
2nd variant of implementation (to consider):
Questions:
|
# Conflicts: # src/libs/SidebarUtils.ts # src/types/onyx/Policy.ts # src/types/onyx/Report.ts # src/types/onyx/Transaction.ts
# Conflicts: # src/types/onyx/Policy.ts
Note: I'll be OOO Feb 10 - Feb 18 🌴 |
Reviewer Checklist
There are no test steps for this PR Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
App/src/libs/OptionsListUtils.ts Line 127 in f438cb7
Should we update this case? |
Also resolve conflict |
@VickyStash Bump on this one |
# Conflicts: # src/types/onyx/Policy.ts # src/types/onyx/ReimbursementAccount.ts # src/types/onyx/Transaction.ts
I think it's okay to leave it as is since it's not an Onyx type |
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
/** Field-specific server side errors keyed by microtime */ | ||
errorFields?: OnyxCommon.ErrorFields; | ||
}, | ||
'defaultLogin' | 'validateLogin' | 'addedLogin' | 'deletedLogin' |
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.
Sorry, I'm confused what the 2nd template argument for OnyxValueWithOfflineFeedback
is for. Could you help explain? Maybe a README example here could be helpful too?
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.
2nd template argument for OnyxValueWithOfflineFeedback
are additional keys to be provided as keys for pendingFields
. So these keys 'defaultLogin' | 'validateLogin' | 'addedLogin' | 'deletedLogin'
are outside of the Login model, but can be in pendingFields keys.
So for example, validateLogin
can be used in pendingFields keys, but it doesn't exist in the Login model
Lines 379 to 381 in ba7f01d
pendingFields: { | |
validateLogin: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, | |
}, |
That's also was explained in this comment in 1st variant of implementation section.
Maybe it will be better to add a clarifying comment right next to the OnyxValueWithOfflineFeedback type, this way it should be easy to find and helpful.
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.
@roryabraham Bump for reviewing
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.
thanks for explaining
# Conflicts: # src/types/onyx/Policy.ts # src/types/onyx/Report.ts
# Conflicts: # src/types/onyx/Policy.ts
looks like there are conflicts to resolve here, but I look forward to reviewing this again |
# Conflicts: # src/types/onyx/Policy.ts
@roryabraham Conflicts are resolved, please take a look when you can |
Sorry, conflicts again |
# Conflicts: # src/types/onyx/Policy.ts
@roryabraham Conflicts are resolved again 😅 |
✋ 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/roryabraham in version: 1.4.44-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
[TS Migration] Standardize approach to Onyx pendingFields
Fixed Issues
$ #34662
PROPOSAL: N/A
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 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(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label 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
MacOS: Desktop