[TS migration] Migrate 'FullscreenLoadingIndicator.js' component to TypeScript#29988
Conversation
| </View> | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
We should always define displayName:
| FullScreenLoadingIndicator.displayName = 'FullScreenLoadingIndicator'; |
| import themeColors from '../styles/themes/default'; | ||
|
|
||
| type FullScreenLoadingIndicatorProps = { | ||
| style: Record<string, unknown> | Array<Record<string, unknown>>; |
There was a problem hiding this comment.
I would consider more accurate type here:
| style: Record<string, unknown> | Array<Record<string, unknown>>; | |
| style: StyleProp<ViewStyle> |
fabioh8010
left a comment
There was a problem hiding this comment.
@MaciejSWM Please update the PR title to [TS migration] Migrate 'FullscreenLoadingIndicator.js' component to TypeScript, we should have this one tested by QA.
Co-authored-by: Fábio Henriques <fabio.lacerda@outlook.com>
|
@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] |
|
|
||
| function FullScreenLoadingIndicator({style}: FullScreenLoadingIndicatorProps) { | ||
| return ( | ||
| <View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, style]}> |
There was a problem hiding this comment.
Hm, so passing a style array here just works? Was the old logic unnecessary?
const additionalStyles = _.isArray(props.style) ? props.style : [props.style];There was a problem hiding this comment.
@MaciejSWM Let's ensure this change was intended
There was a problem hiding this comment.
Turns out it works just fine. It's not only correct Typescript, but it also works when I test it with all the combinations of style:
http://localhost:8082/settings/profile/display-name
In DisplayNamePage.js (I renamed it to .tsx to highlight any errors, but none showed up):
{!props.isLoadingApp ? (
<>
<View style={{ height: '20%' }}>
{/* No style */}
<FullScreenLoadingIndicator />
</View>
<View style={{ height: '20%' }}>
{/* Empty array style */}
<FullScreenLoadingIndicator style={[]} />
</View>
<View style={{ height: '20%' }}>
{/* Just one style */}
<FullScreenLoadingIndicator style={styles.backgroundPurple} />
</View>
<View style={{ height: '20%' }}>
{/* Array of styles */}
<FullScreenLoadingIndicator style={[styles.backgroundPurple, styles.backgroundGold]} />
</View>
</>
) : (
There was a problem hiding this comment.
Thanks for verifying this!
|
We are over 1000 commits behind Even if there are no Git conflicts on the textual level, such diversion can:
In the case of this specific PR, we would probably get only a textual conflict (as it deletes a file), but 1000 commits is still a lot. |
Reviewer Checklist
Screenshots/VideosWebFullscreenLoadingIndicator-ts-web.mp4Mobile Web - ChromeFullscreenLoadingIndicator-ts-android-web-compressed.mp4Mobile Web - SafariFullscreenLoadingIndicator-ts-ios-web.mp4DesktopiOSFullscreenLoadingIndicator-ts-ios.mp4AndroidFullscreenLoadingIndicator-ts-android-compressed.mp4 |
|
@cubuspl42 thanks for pointing out valid concerns. Branch is up to date now + I addressed your question about getting rid of |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25010 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
AndrewGable
left a comment
There was a problem hiding this comment.
Please write QA steps
|
@AndrewGable updated |
|
✋ 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/AndrewGable in version: 1.3.96-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
Details
Fixed Issues
$ #25010
PROPOSAL:
Tests
DisplayNamePage.jsadd an early return:FullScreenLoadingIndicatorrendering a fullscreen spinnerOffline tests
TestsQA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2023-10-20.at.14.01.31.mov
Android: mWeb Chrome
Screen.Recording.2023-10-20.at.11.31.49.mov
iOS: Native
Screen.Recording.2023-10-20.at.11.27.27.mov
iOS: mWeb Safari
Screen.Recording.2023-10-20.at.11.30.43.mov
MacOS: Chrome / Safari
Screen.Recording.2023-10-20.at.11.30.15.mov
MacOS: Desktop
Screen.Recording.2023-10-20.at.11.24.08.mov