Skip to content

Commit

Permalink
Merge pull request #40019 from Expensify/revert-38887-enable-searchin…
Browse files Browse the repository at this point in the history
…g-for-workspaces-by-participants

[CP Staging] Revert "Enable searching for workspaces/rooms by their participants"

(cherry picked from commit e3d68f5)
  • Loading branch information
Julesssss authored and OSBotify committed Apr 10, 2024
1 parent 12372e9 commit 1a27ee7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,20 @@ function getSearchText(
): string {
let searchTerms: string[] = [];

for (const personalDetail of personalDetailList) {
if (personalDetail.login) {
// The regex below is used to remove dots only from the local part of the user email (local-part@domain)
// so that we can match emails that have dots without explicitly writing the dots (e.g: fistlast@domain will match first.last@domain)
// More info https://github.com/Expensify/App/issues/8007
searchTerms = searchTerms.concat([
PersonalDetailsUtils.getDisplayNameOrDefault(personalDetail, '', false),
personalDetail.login,
personalDetail.login.replace(/\.(?=[^\s@]*@)/g, ''),
]);
if (!isChatRoomOrPolicyExpenseChat) {
for (const personalDetail of personalDetailList) {
if (personalDetail.login) {
// The regex below is used to remove dots only from the local part of the user email (local-part@domain)
// so that we can match emails that have dots without explicitly writing the dots (e.g: fistlast@domain will match first.last@domain)
// More info https://github.com/Expensify/App/issues/8007
searchTerms = searchTerms.concat([
PersonalDetailsUtils.getDisplayNameOrDefault(personalDetail, '', false),
personalDetail.login,
personalDetail.login.replace(/\.(?=[^\s@]*@)/g, ''),
]);
}
}
}

if (report) {
Array.prototype.push.apply(searchTerms, reportName.split(/[,\s]/));

Expand Down

0 comments on commit 1a27ee7

Please sign in to comment.