-
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] Migrate 'SignInRedirect.js' lib to TypeScript #28388
[No QA] [TS migration] Migrate 'SignInRedirect.js' lib to TypeScript #28388
Conversation
@@ -12,6 +14,8 @@ type Session = { | |||
accountID?: number; | |||
|
|||
autoAuthState?: string; | |||
/** Server side errors keyed by microtime */ | |||
errors?: OnyxCommon.Errors; |
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.
maybe we can only import Errors
from this common namespace?
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.
Everywhere we are are importing it as OnyxCommon.Errors so I would follow this pattern 😄
@Julesssss 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] |
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!
Just so you know @Julesssss, TS process was changed recently and now C+ are responsible for the reviewer checklist. |
@Julesssss are you able to look again? |
@Julesssss are you able to do PR reviewer checklist or assign someone? |
Hey @s77rt, you were chosen by the bot for C+ review 👋 |
Onyx.connect({ | ||
key: ONYXKEYS.NETWORK, | ||
callback: (network) => { |
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.
In the callback we are converting network.shouldForceOffline
to Boolean. I don't think that's necessary. There is also an early return. Can we use optional chaining instead?
currentIsOffline = network?.isOffline;
currentShouldForceOffline = network?.shouldForceOffline;
…s-migration/SignInRedirect-lib
@s77rt fixed 😄 |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - ChromeMobile Web - SafariDesktop |
✋ 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/Julesssss in version: 1.3.86-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.86-5 🚀
|
@@ -58,15 +50,15 @@ function clearStorageAndRedirect(errorMessage) { | |||
*/ | |||
function resetHomeRouteParams() { | |||
Navigation.isNavigationReady().then(() => { | |||
const routes = navigationRef.current && lodashGet(navigationRef.current.getState(), 'routes'); | |||
const homeRoute = _.find(routes, (route) => route.name === SCREENS.HOME); | |||
const routes = navigationRef.current?.getState().routes; |
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.
Coming from #45619, we should use optional chaining operator here to avoid accessing routes when nav state is null
Details
Migrate 'SignInRedirect.js' lib to TypeScript
Fixed Issues
$ 24913
PROPOSAL: N/A
Tests
Offline tests
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
web.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
desktop.mp4
iOS
ios.mp4
Android