-
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 'FormAlertWithSubmitButton.js' component to TypeScript #31303
[TS migration] Migrate 'FormAlertWithSubmitButton.js' component to TypeScript #31303
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
…s-migration/FormAlertWithSubmitButton/component
…s-migration/FormAlertWithSubmitButton/component
message = '', | ||
isDisabled = false, | ||
isMessageHtml = false, | ||
containerStyles, |
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.
Careful, this prop used to default to array
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.
@pac-guerreiro we agreed earlier that styles props don't need default values here is a 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.
@kubabutkiewicz Oh okay, maybe that discussion should be added to the TS guidelines, what you think @fabioh8010 ?
|
||
return ( | ||
<FormAlertWrapper | ||
containerStyles={[styles.mh5, styles.mb5, styles.justifyContentEnd, containerStyles]} |
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.
If containerStyles
is an array, it needs to be spread here
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.
@pac-guerreiro It will work, look at screenshots
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.
The style props are able to handle nested arrays 🙂
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.
Nvm then @kubabutkiewicz @fabioh8010, I had the idea that we could not pass nested arrays like that
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.
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.
I am seeing this console warning and I believe it is related to this change
@rlinoz, eh, I think you are right. However, on main branch, FormAlertWrapper
has been migrated to tsx
, so this error will not appear after merging, we can merge that to this branch to validate it first. :)
> | ||
{(isOffline: boolean) => ( | ||
<View> | ||
{isOffline && !enabledWhenOffline ? ( |
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.
I know that this is out of scope with this PR purpose but there's code duplication in this ternary and should be addressed
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.
I see your point but during TS migration we should not do refactors which are not related to migration, maybe you can create a seperate issue for that?
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!
@kubabutkiewicz LGTM 👍 |
…s-migration/FormAlertWithSubmitButton/component
…s-migration/FormAlertWithSubmitButton/component
…s-migration/FormAlertWithSubmitButton/component
@ntdiary kindly bump 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: Native31303-android-native.mp4Android: mWeb Chrome31303-android-chrome.mp4iOS: Native31303-ios-native.mp4iOS: mWeb Safari31303-ios-safari.mp4MacOS: Chrome / Safari31303-web.mp4MacOS: Desktop31303-desktop.mp4 |
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! :)
Additionally, @kubabutkiewicz, can you please add the QA steps
? May be just a simple note that it is the same as the Tests
.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25017 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
onFixTheErrorsLinkPressed={onFixTheErrorsLinkPressed} | ||
errorMessageStyle={errorMessageStyle} | ||
> | ||
{(isOffline: boolean) => ( |
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.
Additionally, after merging the main branch to this branch, we need to slightly modify this type. Perhaps we can use boolean | undefined
? :)
…s-migration/FormAlertWithSubmitButton/component
@ntdiary thanks ! done |
✋ 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/rlinoz in version: 1.4.14-0 🚀
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 1.4.14-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.4.14-6 🚀
|
Details
Fixed Issues
$ #25017
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)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
android.mp4
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4