anthonychengit commented on code in PR #5756:
URL: https://github.com/apache/texera/pull/5756#discussion_r3457199910


##########
frontend/src/app/dashboard/component/admin/user/admin-user.component.ts:
##########
@@ -258,20 +258,33 @@ export class AdminUserComponent implements OnInit {
     this.listOfDisplayUser = [...this.userList];
   }
 
+  private normalizeSearchValue(value: string | null | undefined): string {
+    return (value ?? "").trim().toLowerCase();
+  }
+
   searchByName(): void {
     this.nameSearchVisible = false;
+    this.emailSearchValue = "";
+    this.commentSearchValue = "";
     const q = (this.nameSearchValue ?? "").trim().toLowerCase();
-    this.listOfDisplayUser = this.userList.filter(u => (u.name ?? 
"").toLowerCase().includes(q));
+    this.listOfDisplayUser = this.userList.filter(user => (user.name ?? 
"").toLowerCase().includes(q));
   }
 
   searchByEmail(): void {
     this.emailSearchVisible = false;
-    this.listOfDisplayUser = this.userList.filter(user => (user.email || 
"").indexOf(this.emailSearchValue) !== -1);
+    this.nameSearchValue = "";
+    this.commentSearchValue = "";
+
+    const q = (this.emailSearchValue ?? "").trim().toLowerCase();
+    this.listOfDisplayUser = this.userList.filter(user => (user.email ?? 
"").toLowerCase().includes(q));

Review Comment:
   These issues has been fixed and revamped



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to