diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json index d4038dc6ebf1f8d0445b8eecfdf9c048c382dc20..fec1141ff664bffd008f33511ed87557d5d802bc 100644 --- a/frontend/public/locales/en/common.json +++ b/frontend/public/locales/en/common.json @@ -56,6 +56,7 @@ "roleInfoHead": "Roles and periods", "roleInfoTableText": "Guest roles", "roleInfoBody": "You can only change roles connected to units that you have given.", + "newEmailSent": "New invitation sent", "verifier": "Verified by", "verified": "Verified", "source": "Source", diff --git a/frontend/public/locales/nb/common.json b/frontend/public/locales/nb/common.json index 0bf35fdd1525966be787853784026ce61e76d1f8..bba31d684415b62dd6c22712717b980664f37d34 100644 --- a/frontend/public/locales/nb/common.json +++ b/frontend/public/locales/nb/common.json @@ -56,6 +56,7 @@ "roleInfoHead": "Roller og perioder", "roleInfoBody": "Du kan endre på tidsperioden, men kun på gjesteroller tilknyttet enheter du er vert for.", "roleInfoTableText": "Gjesteroller", + "newEmailSent": "Ny invitasjon sendt", "verifier": "Godkjent av", "verified": "Godkjent", "source": "Kilde", diff --git a/frontend/public/locales/nn/common.json b/frontend/public/locales/nn/common.json index 3a0d8c7a88018b604c8ca50fdc34f0e77c7828d6..cff78a450049509d086d97c61bad6ef9b7373bca 100644 --- a/frontend/public/locales/nn/common.json +++ b/frontend/public/locales/nn/common.json @@ -56,6 +56,7 @@ "roleInfoTableText": "Gjesteroller", "roleInfoHead": "Roller og periodar", "roleInfoBody": "Du kan endre på tidsperioden, men berre på gjesteroller knytta til eininger du er vert for.", + "newEmailSent": "Ny invitasjon sendt", "verifier": "Godkjend av", "verified": "Godkjend", "source": "Kjelde", diff --git a/frontend/src/routes/sponsor/guest/guestInfo/index.tsx b/frontend/src/routes/sponsor/guest/guestInfo/index.tsx index 09af68476d1a06e4e81f2e1d5e5dc2e228abf283..18d304c16a15272bbeae8e426c9c08b8552b28e4 100644 --- a/frontend/src/routes/sponsor/guest/guestInfo/index.tsx +++ b/frontend/src/routes/sponsor/guest/guestInfo/index.tsx @@ -98,6 +98,7 @@ export default function GuestInfo({ const [t] = useTranslation(['common']) const navigate = useNavigate() const [confirmCancelDialogOpen, setConfirmCancelDialogOpen] = useState(false) + const [showEmailSent, setShowEmailSent] = useState<Boolean>(false) const [emailUpdateError, setEmailUpdateError] = useState<ServerErrorReportData>() const [updateOKMsg, setUpdateOKMsg] = useState<string>('') @@ -221,6 +222,11 @@ export default function GuestInfo({ } } + const handleClick = () => { + resend() + setShowEmailSent(true) + } + useEffect(() => { reset({ email: guest.email }) // Forces defaultValue to be set to the new value, making the form not dirty setValue('email', guest.email) @@ -256,6 +262,14 @@ export default function GuestInfo({ {t(updateOKMsg)} </Alert> )} + {showEmailSent && ( + <Alert + severity="success" + sx={{ fontSize: '1rem', marginBottom: '1rem' }} + > + {t('guestInfo.newEmailSent')} + </Alert> + )} <TableContainer> <Table sx={{ minWidth: 650 }} aria-label="simple table"> <TableHead> @@ -304,7 +318,7 @@ export default function GuestInfo({ marginTop: '0.5rem', }} > - <Button color="secondary" onClick={resend}> + <Button color="secondary" onClick={handleClick}> {t('button.resendInvitation')} </Button> <Button