Skip to content

Commit

Permalink
Task #234747-[FE] Handle Deleting sent Invitations,Bug #235030-[admin…
Browse files Browse the repository at this point in the history
… portal] Unable to see reject invitation option.PFA
  • Loading branch information
vidyaaKhandekar committed Feb 14, 2025
1 parent 5fbdeea commit d43671e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
2 changes: 2 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,11 @@
"INVITED_TO_JOIN_COHORT": "Invited to join cohort",
"INVITED_BY": "Invited by",
"REVOKE_INVITATION": "Revoke Invitation",

"DELETE_CONFIRMATION": "Revoke request of ",
"CANCEL": "Cancel",
"REVOKE": "Revoke",
"REVOKED_SUCCESS": "Invitation revoked successfully",
"ACCEPTED_SUCCESS": "Accepted request successfully",
"REJECTED_SUCCESS": "Rejected request",
"ERROR_UPDATING_REQUEST": "Error in updating request",
Expand Down
1 change: 1 addition & 0 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"DELETE_CONFIRMATION": "को भेजा गया निमंत्रण हटाएं",
"CANCEL": "रद्द करें",
"REVOKE": " निमंत्रण रद्द करें",
"REVOKED_SUCCESS": "आमंत्रण सफलतापूर्वक रद्द किया गया",
"ACCEPTED_SUCCESS": "अनुरोध सफलतापूर्वक स्वीकारा गया",
"REJECTED_SUCCESS": "अनुरोध अस्वीकार किया गया",
"ERROR_UPDATING_REQUEST": "अनुरोध अपडेट करने में त्रुटि",
Expand Down
1 change: 1 addition & 0 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"DELETE_CONFIRMATION": "याला पाठवलेले निमंत्रण हटवा",
"CANCEL": "रद्द करा",
"REVOKE": "निमंत्रण रद्द करा",
"REVOKED_SUCCESS":"निमंत्रण यशस्वीरित्या रद्द केले",
"ACCEPTED_SUCCESS": "विनंती यशस्वीरित्या स्वीकारली",
"REJECTED_SUCCESS": "विनंती नाकारली",
"ERROR_UPDATING_REQUEST": "विनंती अद्यतनित करताना त्रुटी",
Expand Down
1 change: 1 addition & 0 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"DELETE_CONFIRMATION": "କୁ ପଠାଯାଇଥିବା ନିମନ୍ତ୍ରଣ ବିଲୋପ କରନ୍ତୁ",
"CANCEL": "ବାତିଲ୍ କରନ୍ତୁ",
"REVOKE": "ନିମନ୍ତ୍ରଣ ବାତିଲ୍ କରନ୍ତୁ",
"REVOKED_SUCCESS":"ନିମନ୍ତ୍ରଣ ସଫଳତାର ସହ ରଦ୍ଦ କରାଯାଇଛି",
"ACCEPTED_SUCCESS": "ଅନୁରୋଧ ସଫଳତାର ସହିତ ଗ୍ରହଣ କରାଯାଇଛି",
"REJECTED_SUCCESS": "ଅନୁରୋଧ ଅସ୍ଵୀକାର କରାଯାଇଛି",
"ERROR_UPDATING_REQUEST": "ଅନୁରୋଧ ଅଦ୍ୟତନ କରିବାରେ ତ୍ରୁଟି",
Expand Down
40 changes: 33 additions & 7 deletions src/components/layouts/header/Invitation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ const InvitationMenu = () => {
if (invitationStatus === "Accepted") {
showToastMessage(t("COHORTINVITATION.ACCEPTED_SUCCESS"), "success");
router.push("/cohorts");
} else if (invitationStatus === "Revoked") {
showToastMessage(t("COHORTINVITATION.REVOKED_SUCCESS"), "success");
} else {
showToastMessage(t("COHORTINVITATION.REJECTED_SUCCESS"), "success");
}
Expand Down Expand Up @@ -341,18 +343,34 @@ const InvitationMenu = () => {
justifyContent="space-between"
alignItems="center"
>
<Typography variant="body2">
<Typography
variant="body2"
sx={{
width: "65%",
whiteSpace: "normal",
wordWrap: "break-word",
display: "block",
}}
>
Invited to <b>{invitation.invitedTo}</b> to join cohort{" "}
<b>{invitation.cohortName}</b>
</Typography>

<Tooltip title="Delete Request">
<IconButton
<Tooltip title="Revoke Invitation">
<Button
size="small"
onClick={() => setConfirmDelete(invitation)}
onClick={() =>
updateInvitationStatus(
invitation.tenantId,
invitation.invitationId,
"Revoked"
)
}
variant="outlined"
sx={{ borderRadius: "15px" }}
>
<Delete fontSize="small" color="primary" />
</IconButton>
Revoke Invitation
</Button>
</Tooltip>
</Stack>
</CardContent>
Expand All @@ -376,7 +394,15 @@ const InvitationMenu = () => {
justifyContent="space-between"
alignItems="center"
>
<Typography variant="body2">
<Typography
variant="body2"
sx={{
width: "75%",
whiteSpace: "normal",
wordWrap: "break-word",
display: "block",
}}
>
{t("COHORTINVITATION.INVITED_BY")}{" "}
<b>{invitation.invitedBy}</b> to cohort{" "}
<b>{invitation.cohortName}</b>
Expand Down

0 comments on commit d43671e

Please sign in to comment.