[TS migration] Migrate RoomInvitePage to typescript#34956
Conversation
|
|
||
| sectionsArr.push({ | ||
| title: translate('common.contacts'), | ||
| data: personalDetailsFormatted, | ||
| shouldShow: !_.isEmpty(personalDetailsFormatted), |
There was a problem hiding this comment.
why this was removed?
There was a problem hiding this comment.
shouldShow is not used anywhere in SelectionList(sectionArr is data for SectionList) so I've removed it.
Double checked if everything works.
|
@kubabutkiewicz fixed comments 😅 |
|
@kubabutkiewicz fixed comments |
|
@mananjadhav 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] |
|
I’ll check this once I am online. Quick question, is the unit test failure related to this PR? |
|
@mananjadhav tests failure was related to this PR but I've already fixed them |
| * @param member - personalDetails or userToInvite | ||
| * @param config - keys to overwrite the default values | ||
| */ | ||
| function formatMemberForList(member: ReportUtils.OptionData, config: ReportUtils.OptionData | EmptyObject = {}): MemberForList | undefined { |
There was a problem hiding this comment.
have we checked all usages to see that it's okay to remove config?
There was a problem hiding this comment.
Double checked if everything works. This method is used only in two places and none of them use config param.
| * @param config - keys to overwrite the default values | ||
| */ | ||
| function formatMemberForList(member: ReportUtils.OptionData, config: ReportUtils.OptionData | EmptyObject = {}): MemberForList | undefined { | ||
| if (!member) { |
There was a problem hiding this comment.
do we have any case where this could error?
There was a problem hiding this comment.
Same as above, every usage of this function has member of ReportUtils.OptionData type, not undefined or null, so we don't need this check. Future usages are going to be checked by typecheck.
| const [personalDetails, setPersonalDetails] = useState([]); | ||
| const [userToInvite, setUserToInvite] = useState(null); | ||
| const [selectedOptions, setSelectedOptions] = useState<ReportUtils.OptionData[]>([]); | ||
| const [invitePersonalDetails, setPersonalDetails] = useState<ReportUtils.OptionData[]>([]); |
There was a problem hiding this comment.
should we rename the set state method? I was a bit confused when tracking where was invitePersonalDetails updated.
| const [invitePersonalDetails, setPersonalDetails] = useState<ReportUtils.OptionData[]>([]); | |
| const [invitePersonalDetails, setInvitePersonalDetails] = useState<ReportUtils.OptionData[]>([]); |
There was a problem hiding this comment.
Good point, should have renamed it when I was renaming personalDetails into invitePersonalDetails
| const isOptionInPersonalDetails = _.some(personalDetails, (personalDetail) => personalDetail.accountID === accountID); | ||
| filterSelectedOptions = selectedOptions.filter((option) => { | ||
| const accountID = option?.accountID; | ||
| const isOptionInPersonalDetails = invitePersonalDetails.some((personalDetail) => accountID && personalDetail.accountID && personalDetail.accountID === accountID); |
There was a problem hiding this comment.
| const isOptionInPersonalDetails = invitePersonalDetails.some((personalDetail) => accountID && personalDetail.accountID && personalDetail.accountID === accountID); | |
| const isOptionInPersonalDetails = invitePersonalDetails.some((personalDetail) => accountID && personalDetail?.accountID === accountID); |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-room-invite.movAndroid: mWeb Chromemweb-chrome-room-invite.moviOS: Nativeios-room-invite.moviOS: mWeb Safarimweb-safari-room-invite.movMacOS: Chrome / Safariweb-room-invite.movMacOS: Desktopdesktop-room-invite_BQ57Sn8D.mp4 |
|
@mananjadhav fixed comments |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #31993 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ 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 🚀
|
| const isPartOfSearchTerm = option.text?.toLowerCase().includes(searchValue) ?? option.login?.toLowerCase().includes(searchValue); | ||
| return isPartOfSearchTerm ?? isOptionInPersonalDetails; |
Details
Fixed Issues
$ #31993
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
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
androidinvite.mov
Android: mWeb Chrome
androidwebinvite.mov
iOS: Native
iosinvite.mov
iOS: mWeb Safari
ioswebinvite.mov
MacOS: Chrome / Safari
webinvite.mov
MacOS: Desktop
desktopinvite.mov