[TS Migration] Migrate NewChatPage#34638
Conversation
There was a problem hiding this comment.
personalDetails is not an onyx collection , you should use PersonalDetailsList type instead.
There was a problem hiding this comment.
I think this typing is unnecessary here
There was a problem hiding this comment.
import it as import * as OnyxTypes from '@src/types/onyx'
There was a problem hiding this comment.
I think you can use type OptionData here or Partial<OptionData>
There was a problem hiding this comment.
I think this is unnecessary here
There was a problem hiding this comment.
I think in this case we can do it like that
| if (option.login === undefined || option.login === null) { | |
| if (!option.login) { |
because if option.login is '' we still dont want to navigate but I could be wrong here 😄
There was a problem hiding this comment.
I think doInteractionTask is wrongly typed becuase cancel method will be only there for desktop platform maybe we can improve typing there?
CC: @fabioh8010 @blazejkustra
There was a problem hiding this comment.
I agree, @ruben-rebelo let's fix it here. Here is the working code to adjust:
src/libs/DoInteractionTask/types.ts
import type {InteractionManager} from 'react-native';
type DoInteractionTask = (callback: () => void) => ReturnType<typeof InteractionManager.runAfterInteractions> | null;
export default DoInteractionTask;src/libs/DoInteractionTask/index.ts
import type DoInteractionTask from './types';
const doInteractionTask: DoInteractionTask = (callback) => {
callback();
return null;
};
export default doInteractionTask;src/libs/DoInteractionTask/index.desktop.ts
import {InteractionManager} from 'react-native';
import type DoInteractionTask from './types';
// For desktop, we should call the callback after all interactions to prevent freezing. See more detail in https://github.com/Expensify/App/issues/28916
const doInteractionTask: DoInteractionTask = (callback) =>
InteractionManager.runAfterInteractions(() => {
callback();
});
export default doInteractionTask;
blazejkustra
left a comment
There was a problem hiding this comment.
Let's sync with main, and let me know so I can review.
There was a problem hiding this comment.
OptionsListUtils is finally migrated on main, please sync your branch
Co-authored-by: Fábio Henriques <fabio.lacerda@outlook.com>
3c9b476 to
8163c3d
Compare
|
@shubham1206agra 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] |
|
@ruben-rebelo Can you merge main here? |
# Conflicts: # src/ONYXKEYS.ts # src/libs/OptionsListUtils.ts # src/pages/NewChatPage.tsx
|
@shubham1206agra Done |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-02-08.at.5.49.28.PM.movAndroid: mWeb ChromeScreen.Recording.2024-02-08.at.5.29.55.PM.moviOS: NativeScreen.Recording.2024-02-07.at.9.48.29.PM.moviOS: mWeb SafariScreen.Recording.2024-02-08.at.5.22.36.PM.movMacOS: Chrome / SafariScreen.Recording.2024-02-07.at.9.30.14.PM.movMacOS: DesktopScreen.Recording.2024-02-08.at.5.38.48.PM.mov |
|
@ruben-rebelo Please fix conflicts. |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25178 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
# Conflicts: # src/pages/NewChatPage.tsx
|
Conflicts resolved |
|
@ruben-rebelo conflicts again, sorry to leave this open for so long! |
|
Hello @jasperhuangg, no problem at all. |
# Conflicts: # src/libs/OptionsListUtils.ts
|
✋ 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 production by https://github.com/thienlnam in version: 1.4.41-12 🚀
|
Details
[TS migration] Migrate NewChatPage page to TypeScript
Fixed Issues
$ #25178
PROPOSAL: N/A
Tests
Test NewChatPage:
Offline tests
N/A
QA Steps
Same as in the Tests section.
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop