Skip to content
Snippets Groups Projects
Commit 8cf755cb authored by Marte Fossum's avatar Marte Fossum
Browse files

Merge branch 'GREG-307-invitation-sent-box' into 'master'

GREG-307: Show that new invitation is sent

See merge request !368
parents f7d4ceff fae08fb4
No related branches found
No related tags found
1 merge request!368GREG-307: Show that new invitation is sent
Pipeline #177729 passed
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment