Changes in Search text.
This commit is contained in:
parent
fb4275fb05
commit
bb9c351189
@ -67,9 +67,17 @@ const EmployeeList = () => {
|
|||||||
if (!text) {
|
if (!text) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
const lowercasedText = text.toLowerCase();
|
const lowercasedText = text.toLowerCase().trim(); // Ensure search text is trimmed and lowercase
|
||||||
|
|
||||||
return data.filter((item) => {
|
return data.filter((item) => {
|
||||||
const fullName = `${item.firstName} ${item.middleName} ${item.lastName}`.toLowerCase();
|
// **IMPROVED FULL NAME CONSTRUCTION**
|
||||||
|
const firstName = item.firstName || "";
|
||||||
|
const middleName = item.middleName || "";
|
||||||
|
const lastName = item.lastName || "";
|
||||||
|
|
||||||
|
// Join parts, then trim any excess spaces if a middle name is missing
|
||||||
|
const fullName = `${firstName} ${middleName} ${lastName}`.toLowerCase().trim().replace(/\s+/g, ' ');
|
||||||
|
|
||||||
const email = item.email ? item.email.toLowerCase() : "";
|
const email = item.email ? item.email.toLowerCase() : "";
|
||||||
const phoneNumber = item.phoneNumber ? item.phoneNumber.toLowerCase() : "";
|
const phoneNumber = item.phoneNumber ? item.phoneNumber.toLowerCase() : "";
|
||||||
const jobRole = item.jobRole ? item.jobRole.toLowerCase() : "";
|
const jobRole = item.jobRole ? item.jobRole.toLowerCase() : "";
|
||||||
@ -212,8 +220,6 @@ const handleAllEmployeesToggle = (e) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleEmployeeModel = (id) => {
|
const handleEmployeeModel = (id) => {
|
||||||
setSelecedEmployeeId(id);
|
setSelecedEmployeeId(id);
|
||||||
setShowModal(true);
|
setShowModal(true);
|
||||||
|
@ -70,7 +70,7 @@ export function startSignalR(loggedUser) {
|
|||||||
cacheData("hasReceived", false);
|
cacheData("hasReceived", false);
|
||||||
eventBus.emit("assign_project_one", data);
|
eventBus.emit("assign_project_one", data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error in cacheData:", e);
|
// console.error("Error in cacheData:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eventBus.emit("assign_project_all", data);
|
eventBus.emit("assign_project_all", data);
|
||||||
@ -96,9 +96,7 @@ export function startSignalR(loggedUser) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
connection
|
connection
|
||||||
.start()
|
.start();
|
||||||
.then(() => console.log("SignalR connected"))
|
|
||||||
.catch((err) => console.error("SignalR error:", err));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function stopSignalR() {
|
export function stopSignalR() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user