-
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
[TS migration] Migrate 'NewChatSelector' page to TypeScript #34859
[TS migration] Migrate 'NewChatSelector' page to TypeScript #34859
Conversation
@sobitneupane 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] |
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 0 out of 2 committers have signed the CLA. |
@@ -13,7 +13,7 @@ import CONST from '@src/CONST'; | |||
import type IconAsset from '@src/types/utils/IconAsset'; | |||
import TabSelectorItem from './TabSelectorItem'; | |||
|
|||
type TabSelectorProps = { | |||
export type TabSelectorProps = { |
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.
We don't use inline exports, please add export to the bottom of this file
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.
Hey blazekustra. Ok I'll fix it.
@@ -24,11 +25,14 @@ type OnyxTabNavigatorProps = OnyxTabNavigatorOnyxProps & | |||
/** A function triggered when a tab has been selected */ | |||
onTabSelected?: (newIouType: string) => void; | |||
|
|||
tabBar: (props: TabSelectorProps) => React.JSX.Element |
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.
tabBar: (props: TabSelectorProps) => React.JSX.Element | |
tabBar: (props: TabSelectorProps) => ReactNode; |
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'll fix it.
|
||
// eslint-disable-next-line rulesdir/no-inline-named-export | ||
export const TopTab = createMaterialTopTabNavigator(); | ||
export const TopTab:any = createMaterialTopTabNavigator(); |
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 this PR WIP?
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.
Ohh, Sorry. I think it's left accidently. Let me fix it.
@@ -42,7 +46,7 @@ function OnyxTabNavigator({id, selectedTab = '', children, onTabSelected = () => | |||
backBehavior="initialRoute" | |||
keyboardDismissMode="none" | |||
screenListeners={{ | |||
state: (e) => { | |||
state: (e:Event) => { |
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.
Why this is needed?
I think eslint might be failing for this one. |
Please sync this branch with the newest main. Context here, thanks! |
@MahmudjonToraqulov Bump |
Hey. Sorry for the delay. I'll make it soon. Thanks |
Let me know if you have any questions or problems! |
Hey @blazejkustra. I have had some problems with my Mac but not with the project so far. I made all changes. Could u pls check it and tell me? Thanks. |
CLA Assistant is failing @MahmudjonToraqulov |
src/pages/NewChatSelectorPage.tsx
Outdated
@@ -46,25 +32,17 @@ function NewChatSelectorPage(props) { | |||
> | |||
<TopTab.Screen | |||
name={CONST.TAB.NEW_CHAT} | |||
component={NewChatPage} | |||
component={NewChatPage as React.ComponentType} |
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.
component={NewChatPage as React.ComponentType} | |
component={NewChatPage} |
src/pages/NewChatSelectorPage.tsx
Outdated
/> | ||
<TopTab.Screen | ||
name={CONST.TAB.NEW_ROOM} | ||
component={WorkspaceNewRoomPage} | ||
component={WorkspaceNewRoomPage as React.ComponentType} |
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.
Let's wait for this to be merged first: #34742
OR add @ts-expect-error
here as described in TS guidelines
component={WorkspaceNewRoomPage as React.ComponentType} | |
component={WorkspaceNewRoomPage} |
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.
Let's wait for this to be merged first: #34742
OR add
@ts-expect-error
here as described in TS guidelines
Yes, I think we should wait for it. There was an issue with "WorkspaceNewRoomPage".
@MahmudjonToraqulov Is this ready for review? Please let me know if it is ready for review. |
@sobitneupane We decided to wait till #34742 is merged |
@MahmudjonToraqulov Let's continue now! |
Hey @blazejkustra. I updated my branch and the error for "WorkspaceNewRoomPage" is disappeared. But there is an error for "NewChatPage" after it's migrated into typescript. Do you have any Suggestion? |
Push your changes to the branch, so I can checkout and test @MahmudjonToraqulov. Meanwhile I think you need to use |
CLA Assistant is still failing 🤔 |
I'll fix CLA issue. Right now could you check new changes and give me any suggestion with an error that is related to "NewChatPage" pls? |
I recommend dealing with CLA now, this can become cumbersome if you leave it for a longer period of time (I see some of your commits are unsigned) |
Thanks for pushing the code! I think you can use |
… mahmudjon-toraqulov
… mahmudjon-toraqulov
@MahmudjonToraqulov I would like to move this PR further, please have a look at my last comment. |
Hey @blazejkustra. Reall sorry for the delay. I made what you asked. Right now I'm having an issue when I make commit and do "git push origin main". Do u know what to do? Here is the error I'm getting -> |
Did you read the hint from your screenshot @MahmudjonToraqulov? 🤣 I think this should help |
Yes, but it didn't help so far. |
Probably you corrupted your branch and it's not compatible with what is on main, I would propose to reset your branch with git reset, or remove your branch locally and git pull from main |
49b9bcb
to
e4d518e
Compare
You may need to sign them manually with GPG or force push all these changes as one commit |
Do you know Why is CLA failing again? What should I do to solve it? |
You need to resign first commits on this PR with GPG, here are some tips. If you aren't sure, please ask on #open-source channel for guidance 😄 |
@sobitneupane Seems like contributor isn't responding, what can we do now? |
@MahmudjonToraqulov If you won't be available, we will have to assign the issue to someone else. We're aiming to have it resolved within the next day or two. |
Bump @MahmudjonToraqulov |
Hey @sobitneupane. I'm available and have finished the work already.But I'm just having an issue with CLA when making commits. Could you help me with that? |
Have you seen my comment @MahmudjonToraqulov? Did it help by any chance? |
Hey @blazejkustra. The main problem is that I made 3 initial commits from my browser directly So these commits got me "unverified" issue. If I revert all commits and make new commits again, What do u think, will it help? |
BTW, this way didn't help. |
You will lose commit history, but this should work! |
Blazejkustra This is my first time making PR for Expensify. Should I just comment as CLA assistent asked here to sign the CLA? Maybe I'm getting CLA issue as I didn't CLA yet. Can it happen? |
There are two issues:
|
I have read the CLA Document and I hereby sign the CLA |
I asked on Slack. I'll wait for respond till tomorrow morning if you don't mind. Thanks. |
Hey @blazejkustra @sobitneupane! I got reply on Slack to solve the issue. What is your opinion about that? |
Both solutions are fine with me, go for a safer approach - meaning Solution 2 😄 |
I'm closing this PR. I'm gonna create new one as I we discussed here. |
Details
Migrated 'NewChatSelector' page to TypeScript
Fixed Issues
$ #31989
PROPOSAL: #31989 (comment)
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(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
2024-01-22.05-28-21.mp4
MacOS: Desktop
2024-01-22.05-35-14.mp4