diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json index e05cd659ebaac25870f26adde30bb6a169856549..4e91d3229e38bcdc51960eec307b8a7ec8f935bf 100644 --- a/frontend/public/locales/en/common.json +++ b/frontend/public/locales/en/common.json @@ -55,6 +55,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 8db7af58c9ab06b6ef0b7478850dd1f0ef63a89c..1d5d547c0cda70c22dfd5016b15968a7da7bfcf0 100644 --- a/frontend/public/locales/nb/common.json +++ b/frontend/public/locales/nb/common.json @@ -55,6 +55,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 12ff6ef2bdf7a07f206f17a7f1dffcf5bd46d467..1122d460bdf05ac9af5ec3f6b115ef0a3b2d53ec 100644 --- a/frontend/public/locales/nn/common.json +++ b/frontend/public/locales/nn/common.json @@ -55,6 +55,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