diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 5a016d6e..75b44591 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -141,7 +141,8 @@ "PAGE_NOT_FOUND": "Page not found", "ACCESS_DENIED": "Access Denied", "YOU_DONT_HAVE_PERMISSION_TO_ACCESS_THIS_PAGE": "You don't have access to this page", - "RETURN_TO_LOGIN": "Return to Login" + "RETURN_TO_LOGIN": "Return to Login", + "COHORT_CODE_EXISTS": "Cohort code already exists" }, "LOGIN_PAGE": { diff --git a/src/components/DeleteUserModal.tsx b/src/components/DeleteUserModal.tsx index 11bd32db..5b388673 100644 --- a/src/components/DeleteUserModal.tsx +++ b/src/components/DeleteUserModal.tsx @@ -41,16 +41,18 @@ const DeleteUserModal: React.FC = ({ centers, userId, userName, - userType + userType, }) => { - console.log(centers) + console.log(centers); const { t } = useTranslation(); const theme = useTheme(); const reasons = [ { value: "Incorrect Data Entry", label: t("COMMON.INCORRECT_DATA_ENTRY") }, { value: "Duplicated User", label: t("COMMON.DUPLICATED_USER") }, ]; - const [checkedCohortDeletion, setCheckedCohortDeletion] = useState(centers === "-" ? true : false); + const [checkedCohortDeletion, setCheckedCohortDeletion] = useState( + centers === "-" ? true : false + ); useEffect(() => { if (centers === "-") { @@ -89,7 +91,7 @@ const DeleteUserModal: React.FC = ({ return ( = ({ variant="body1" sx={{ marginBottom: "12px", fontWeight: "bold", color: "#333" }} > - {userType===Role.TEAM_LEADERS?t("COMMON.USER_BLOCK", { name: userName }): centers.split(', ').length===1 ? t("COMMON.USER_CENTER", { name: userName }) : t("COMMON.USER_CENTERS", { name: userName })} + {userType === Role.TEAM_LEADERS + ? t("COMMON.USER_BLOCK", { name: userName }) + : centers.split(", ").length === 1 + ? t("COMMON.USER_CENTER", { name: userName }) + : t("COMMON.USER_CENTERS", { name: userName })} = ({ color="primary" /> } - label={userType===Role.TEAM_LEADERS?t("COMMON.DELETE_FROM_BLOCK_WARNING"): centers.split(', ').length===1 ? t("COMMON.DELETE_FROM_CENTER_WARNING") : t("COMMON.DELETE_FROM_CENTERS_WARNING")} - + label={ + userType === Role.TEAM_LEADERS + ? t("COMMON.DELETE_FROM_BLOCK_WARNING") + : centers.split(", ").length === 1 + ? t("COMMON.DELETE_FROM_CENTER_WARNING") + : t("COMMON.DELETE_FROM_CENTERS_WARNING") + } sx={{ marginTop: "12px", color: "#555" }} /> diff --git a/src/components/ReassignCenterModal.tsx b/src/components/ReassignCenterModal.tsx index 1f3c31a1..14afcf59 100644 --- a/src/components/ReassignCenterModal.tsx +++ b/src/components/ReassignCenterModal.tsx @@ -372,7 +372,8 @@ const ReassignCenterModal: React.FC = ({ setReassignAlertModal(true); setAssignedTeamLeader(resp?.userDetails?.length); setSelectedBlockForTL(checkedCenters[0]); - const userNames = resp?.userDetails?.map((user: any) => user.name); + const userNames = resp?.userDetails?.map((user: any) => firstLetterInUpperCase(user.name)); + setSelectedTLUserID(userId); setAssignedTeamLeaderNames(userNames); } else { diff --git a/src/components/SendCredentialModal.tsx b/src/components/SendCredentialModal.tsx index b926feb1..7f4f02b0 100644 --- a/src/components/SendCredentialModal.tsx +++ b/src/components/SendCredentialModal.tsx @@ -115,8 +115,9 @@ const SendCredentialModal: React.FC = ({ {userType === Role.STUDENT ? (