Skip to content
Snippets Groups Projects
Commit c851b780 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Fix consent step button styling and text

parent 47781ab3
No related branches found
No related tags found
1 merge request!173Consents
Pipeline #101445 passed
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
"top": "Welcome to Guest Registration.", "top": "Welcome to Guest Registration.",
"body": "You are not registered as a host or guest. To become a guest, request an invite from your host. If you should have host access, contact support." "body": "You are not registered as a host or guest. To become a guest, request an invite from your host. If you should have host access, contact support."
}, },
"loading": "Loading...", "loading": "Loading...",
"termsHeader": "Terms", "termsHeader": "Terms",
"staging": "Staging", "staging": "Staging",
...@@ -110,7 +109,8 @@ ...@@ -110,7 +109,8 @@
"backToFrontPage": "Go to front page", "backToFrontPage": "Go to front page",
"cancelInvitation": "Cancel", "cancelInvitation": "Cancel",
"resendInvitation": "Send", "resendInvitation": "Send",
"ok": "OK" "ok": "OK",
"finishRegistration": "Finish registration"
}, },
"registerWizardText": { "registerWizardText": {
"registerPage": "Enter the contact information for the guest below. All fields are mandatory.", "registerPage": "Enter the contact information for the guest below. All fields are mandatory.",
......
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
"backToFrontPage": "Tilbake til forsiden", "backToFrontPage": "Tilbake til forsiden",
"resendInvitation": "Send", "resendInvitation": "Send",
"cancelInvitation": "Kanseller", "cancelInvitation": "Kanseller",
"ok": "OK" "ok": "OK",
"finishRegistration": "Fullfør registrering"
}, },
"registerWizardText": { "registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.",
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
"backToFrontPage": "Tilbake til forsida", "backToFrontPage": "Tilbake til forsida",
"resendInvitation": "Send", "resendInvitation": "Send",
"cancelInvitation": "Kanseller", "cancelInvitation": "Kanseller",
"ok": "OK" "ok": "OK",
"finishRegistration": "Fullfør registrering"
}, },
"registerWizardText": { "registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.",
......
...@@ -71,6 +71,7 @@ export default function GuestRegister() { ...@@ -71,6 +71,7 @@ export default function GuestRegister() {
const history = useHistory() const history = useHistory()
const guestRegisterRef = useRef<GuestRegisterCallableMethods>(null) const guestRegisterRef = useRef<GuestRegisterCallableMethods>(null)
const guestConsentRef = useRef<GuestRegisterCallableMethods>(null)
// TODO On submit successful the user should be directed to some page telling // TODO On submit successful the user should be directed to some page telling
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
...@@ -180,6 +181,11 @@ export default function GuestRegister() { ...@@ -180,6 +181,11 @@ export default function GuestRegister() {
guestRegisterRef.current.doSubmit() guestRegisterRef.current.doSubmit()
} }
} }
if (activeStep === Step.ConsentStep) {
if (guestConsentRef.current) {
guestConsentRef.current.doSubmit()
}
}
} }
const handleBack = () => { const handleBack = () => {
...@@ -304,7 +310,7 @@ export default function GuestRegister() { ...@@ -304,7 +310,7 @@ export default function GuestRegister() {
<Suspense fallback={<CircularProgress />}> <Suspense fallback={<CircularProgress />}>
<GuestConsentStep <GuestConsentStep
nextHandler={handleForwardFromConsent} nextHandler={handleForwardFromConsent}
ref={guestRegisterRef} ref={guestConsentRef}
/> />
</Suspense> </Suspense>
</Box> </Box>
...@@ -333,10 +339,16 @@ export default function GuestRegister() { ...@@ -333,10 +339,16 @@ export default function GuestRegister() {
{t('button.next')} {t('button.next')}
</Button> </Button>
)} )}
{activeStep === Step.ConsentStep && (
<Button onClick={handleNext} sx={{ mr: 1 }}>
{t('button.finishRegistration')}
</Button>
)}
{activeStep === Step.ConsentStep && ( {activeStep === Step.ConsentStep && (
<Button <Button
data-testid="button-black" data-testid="button-black"
sx={{ color: 'theme.palette.secondary', mr: 1 }} color="secondary"
sx={{ mr: 1 }}
onClick={handleBack} onClick={handleBack}
> >
{t('button.back')} {t('button.back')}
......
...@@ -4,7 +4,6 @@ import { SubmitHandler, useForm, useFieldArray } from 'react-hook-form' ...@@ -4,7 +4,6 @@ import { SubmitHandler, useForm, useFieldArray } from 'react-hook-form'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { import {
Box, Box,
Button,
FormControl, FormControl,
FormGroup, FormGroup,
FormHelperText, FormHelperText,
...@@ -167,7 +166,6 @@ const GuestConsentStep = forwardRef( ...@@ -167,7 +166,6 @@ const GuestConsentStep = forwardRef(
</Box> </Box>
) )
})} })}
<Button onClick={onSubmit}>{t('button.save')}</Button>
</form> </form>
</Box> </Box>
) )
......
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