-
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
[TS migration] Migrate 'WalletStatementModal' component to TypeScript #31832
[TS migration] Migrate 'WalletStatementModal' component to TypeScript #31832
Conversation
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
@@ -51,7 +45,7 @@ function WalletStatementModal({statementPageURL, session}) { | |||
title="Statements" | |||
height="100%" | |||
width="100%" | |||
seamless="seamless" | |||
seamless |
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.
is seamless
now a boolean prop?
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.
@fabioh8010 Yeah, it looks so
@cubuspl42 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] |
import {walletStatementDefaultProps, walletStatementPropTypes} from './WalletStatementModalPropTypes'; | ||
import type {WalletStatementOnyxProps, WalletStatementProps} from './types'; | ||
|
||
type WebViewNavigationEvent = WebViewNavigation & {type?: ValueOf<typeof CONST.WALLET.WEB_MESSAGE_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.
Interesting. Do you think that we might benefit from making CONST.js
more TypeScript-friendly? It looks like we might find some uses for TypeScript enums.
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.
Okey, I've just checked and we have a lint against enums...
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.
Still, the question holds. While I appreciate the ValueOf
magic, I'm wondering if making things more TypeScriptish on the CONST.ts
side could help with making this less magical.
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.
@VickyStash You could extract ValueOf<typeof CONST.WALLET.WEB_MESSAGE_TYPE>
to a separate 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.
@cubuspl42 It's something that goes from TS_STYLE guide, so I'm not sure that we should change it.
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.
Still, the question holds. While I appreciate the ValueOf magic, I'm wondering if making things more TypeScriptish on the CONST.ts side could help with making this less magical.
Once the codebase is completely written in TS, we can rewrite CONST.ts more safely, for now let's keep it as it is.
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.
Fine 👍
The code looks good 👍 I'll proceed with the checklist. |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25131 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Do you consider it acceptable that we test this when it hits prod? Or, maybe, would it be possible to update the CSP policy, so we can test this on staging? |
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.
@cubuspl42 in this instance, yes I think its okay. Code looks very straightforward and I checked out the branch on my machine (which doesn't have the CSP issue since i have the whole backend setup locally) and checked to make sure nothing seemed obviously off. I feel pretty comfortable QA-ing this in prod.
✋ 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/blimpich in version: 1.4.7-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.7-4 🚀
|
Details
[TS migration] Migrate 'WalletStatementModal' component to TypeScript
Fixed Issues
$ #25131
PROPOSAL: N/A
Tests
It's not possible to test it on DEV due to CSP policy. If you try to open statement on DEV you will get the next error:
Offline tests
N/A
QA Steps
PROD QA:
That's what you should see:
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(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
Android: Native
Not possible to test on DEV, see the Tests section.
Android: mWeb Chrome
Not possible to test on DEV, see the Tests section.
iOS: Native
Not possible to test on DEV, see the Tests section.
iOS: mWeb Safari
Not possible to test on DEV, see the Tests section.
MacOS: Chrome / Safari
Not possible to test on DEV, see the Tests section.
MacOS: Desktop
Not possible to test on DEV, see the Tests section.