From 3f319184224799d4ed627a0063f606a2b2e14b97 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Thu, 11 Jul 2024 14:22:40 +0800 Subject: [PATCH] update --- src/components/ChangePassword/ChangePassword.tsx | 2 +- src/components/ChangePassword/ChangePasswordForm.tsx | 2 +- src/components/UserWorkspacePage/ProjectGrid.tsx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ChangePassword/ChangePassword.tsx b/src/components/ChangePassword/ChangePassword.tsx index 12c3807..10d5b6e 100644 --- a/src/components/ChangePassword/ChangePassword.tsx +++ b/src/components/ChangePassword/ChangePassword.tsx @@ -28,7 +28,7 @@ const ChangePassword: React.FC = ({ try { let haveError = false; // Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character: - let regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&-=+_]{8,}$/ + let regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&-=+_*(),.?":{}|<>])[A-Za-z\d@$!%*?&-=+_*(),.?":{}|<>]{8,}$/ if (data.newPassword.length < 8 || data.newPassword.length > 20) { haveError = true diff --git a/src/components/ChangePassword/ChangePasswordForm.tsx b/src/components/ChangePassword/ChangePasswordForm.tsx index c00be6c..bdfc8b6 100644 --- a/src/components/ChangePassword/ChangePasswordForm.tsx +++ b/src/components/ChangePassword/ChangePasswordForm.tsx @@ -85,7 +85,7 @@ const ChagnePasswordForm: React.FC = ({ pwRules:rules }) => } else if (index === 3 && rules.number && !/[0-9]/.test(inputValue)) { //testing for numbers return "red"; - } else if (index === 4 && rules.specialChar && !/[!@#$%^&*(),.?":{}|<>]/.test(inputValue)) { + } else if (index === 4 && rules.specialChar && !/[!@#$%^&-=+_*(),.?":{}|<>]/.test(inputValue)) { //testing for special characters return "red"; } else { diff --git a/src/components/UserWorkspacePage/ProjectGrid.tsx b/src/components/UserWorkspacePage/ProjectGrid.tsx index cf1665c..d7ec011 100644 --- a/src/components/UserWorkspacePage/ProjectGrid.tsx +++ b/src/components/UserWorkspacePage/ProjectGrid.tsx @@ -52,10 +52,10 @@ const ProjectGrid: React.FC = ({ projects, maintainNormalStaffWorkspaceAb alignItems: "baseline", }} > - {t("(Others)")} - {`(${manhourFormatter.format( + {t("Others")} + {`${manhourFormatter.format( Boolean(maintainManagementStaffWorkspaceAbility) ? project.hoursSpentOther : project.currentStaffHoursSpentOther, - )})`} + )}`} } {/* Hours Allocated */} {Boolean(maintainManagementStaffWorkspaceAbility) &&