-
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 RoomInvitePage to typescript #34956
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this was removed?
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.
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 |
src/libs/OptionsListUtils.ts
Outdated
@@ -1837,12 +1836,8 @@ function getShareDestinationOptions( | |||
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we checked all usages to see that it's okay to remove config
?
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.
Double checked if everything works. This method is used only in two places and none of them use config
param.
@@ -1837,12 +1836,8 @@ function getShareDestinationOptions( | |||
* @param member - personalDetails or userToInvite | |||
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have any case where this could error?
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.
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.
src/pages/RoomInvitePage.tsx
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, should have renamed it when I was renaming personalDetails into invitePersonalDetails
src/pages/RoomInvitePage.tsx
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
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.
This caused a regression here #38324
Details
Fixed Issues
$ #31993
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
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
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