-
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
Hide contact option if we don't include P2P option #42142
Changes from 5 commits
000ebb3
995ade0
b583557
096c212
0ff20ca
ecf8458
f213328
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,6 @@ type GetOptionsConfig = { | |
maxRecentReportsToShow?: number; | ||
excludeLogins?: string[]; | ||
includeMultipleParticipantReports?: boolean; | ||
includePersonalDetails?: boolean; | ||
includeRecentReports?: boolean; | ||
includeSelfDM?: boolean; | ||
sortByReportTypeInSearch?: boolean; | ||
|
@@ -1648,7 +1647,6 @@ function getOptions( | |
maxRecentReportsToShow = 0, | ||
excludeLogins = [], | ||
includeMultipleParticipantReports = false, | ||
includePersonalDetails = false, | ||
includeRecentReports = false, | ||
// When sortByReportTypeInSearch flag is true, recentReports will include the personalDetails options as well. | ||
sortByReportTypeInSearch = false, | ||
|
@@ -1831,7 +1829,7 @@ function getOptions( | |
return option; | ||
}); | ||
|
||
const havingLoginPersonalDetails = options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail); | ||
const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : []; | ||
let allPersonalDetailsOptions = havingLoginPersonalDetails; | ||
|
||
if (sortPersonalDetailsByAlphaAsc) { | ||
|
@@ -1917,7 +1915,7 @@ function getOptions( | |
} | ||
} | ||
|
||
if (includePersonalDetails) { | ||
if (includeP2P) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this condition will not be redundant? we're assigning an empty array above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @getusha You're right, I updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nkdengineer I am still not sure if we want to keep the code that was under this condition. could you please confirm that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @getusha The code that was under this condition is used to create personal detail option so it's necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nkdengineer sorry, i was just confused because the code was supposed to run only under that condition right? removing only the condition didn't make any sense, can you check it again? and lets make sure we test this thoroughly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, thanks |
||
const personalDetailsOptionsToExclude = [...optionsToExclude, {login: currentUserLogin}]; | ||
// Next loop over all personal details removing any that are selectedUsers or recentChats | ||
allPersonalDetailsOptions.forEach((personalDetailOption) => { | ||
|
@@ -1990,7 +1988,7 @@ function getSearchOptions(options: OptionList, searchValue = '', betas: Beta[] = | |
maxRecentReportsToShow: 0, // Unlimited | ||
sortByReportTypeInSearch: true, | ||
showChatPreviewLine: true, | ||
includePersonalDetails: true, | ||
includeP2P: true, | ||
forcePolicyNamePreview: true, | ||
includeOwnedWorkspaceChats: true, | ||
includeThreads: true, | ||
|
@@ -2011,7 +2009,7 @@ function getShareLogOptions(options: OptionList, searchValue = '', betas: Beta[] | |
includeRecentReports: true, | ||
includeMultipleParticipantReports: true, | ||
sortByReportTypeInSearch: true, | ||
includePersonalDetails: true, | ||
includeP2P: true, | ||
forcePolicyNamePreview: true, | ||
includeOwnedWorkspaceChats: true, | ||
includeSelfDM: true, | ||
|
@@ -2068,7 +2066,6 @@ function getFilteredOptions( | |
includePolicyReportFieldOptions = false, | ||
policyReportFieldOptions: string[] = [], | ||
recentlyUsedPolicyReportFieldOptions: string[] = [], | ||
includePersonalDetails = true, | ||
maxRecentReportsToShow = 5, | ||
) { | ||
return getOptions( | ||
|
@@ -2078,7 +2075,6 @@ function getFilteredOptions( | |
searchInputValue: searchValue.trim(), | ||
selectedOptions, | ||
includeRecentReports: true, | ||
includePersonalDetails, | ||
maxRecentReportsToShow, | ||
excludeLogins, | ||
includeOwnedWorkspaceChats, | ||
|
@@ -2124,7 +2120,6 @@ function getShareDestinationOptions( | |
maxRecentReportsToShow: 0, // Unlimited | ||
includeRecentReports: true, | ||
includeMultipleParticipantReports: true, | ||
includePersonalDetails: false, | ||
showChatPreviewLine: true, | ||
forcePolicyNamePreview: true, | ||
includeThreads: true, | ||
|
@@ -2181,7 +2176,7 @@ function getMemberInviteOptions( | |
{ | ||
betas, | ||
searchInputValue: searchValue.trim(), | ||
includePersonalDetails: true, | ||
includeP2P: true, | ||
excludeLogins, | ||
sortPersonalDetailsByAlphaAsc: true, | ||
includeSelectedOptions, | ||
|
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.
based on your comment shouldn't we cleanup
includePersonalDetails
if it's redundant?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.
@getusha I updated to cleanup
includePersonalDetails
.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.
Nice I like that.
NAB: We could remove the variable
havingLoginPersonalDetails
since its unnecessary.