diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json index 2f2f2063e5f4c367f2c3bf0bb2bcbfc0aa2c068f..4a95405994f06f149976e6197ee6434044504c7b 100644 --- a/frontend/public/locales/en/common.json +++ b/frontend/public/locales/en/common.json @@ -53,7 +53,6 @@ "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." }, - "loading": "Loading...", "termsHeader": "Terms", "staging": "Staging", @@ -110,7 +109,8 @@ "backToFrontPage": "Go to front page", "cancelInvitation": "Cancel", "resendInvitation": "Send", - "ok": "OK" + "ok": "OK", + "finishRegistration": "Finish registration" }, "registerWizardText": { "registerPage": "Enter the contact information for the guest below. All fields are mandatory.", diff --git a/frontend/public/locales/nb/common.json b/frontend/public/locales/nb/common.json index ec30342da2e1b3dcd488a554c29fe905d8877675..989e8c09c4ac896ff70545daac973b0d41b99cb0 100644 --- a/frontend/public/locales/nb/common.json +++ b/frontend/public/locales/nb/common.json @@ -109,7 +109,8 @@ "backToFrontPage": "Tilbake til forsiden", "resendInvitation": "Send", "cancelInvitation": "Kanseller", - "ok": "OK" + "ok": "OK", + "finishRegistration": "Fullfør registrering" }, "registerWizardText": { "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", diff --git a/frontend/public/locales/nn/common.json b/frontend/public/locales/nn/common.json index 25d2b543b15648b4977b259b73cddbab5d9d8d44..4024b7a0656fb0463357608b4900e58d32dc07df 100644 --- a/frontend/public/locales/nn/common.json +++ b/frontend/public/locales/nn/common.json @@ -110,7 +110,8 @@ "backToFrontPage": "Tilbake til forsida", "resendInvitation": "Send", "cancelInvitation": "Kanseller", - "ok": "OK" + "ok": "OK", + "finishRegistration": "Fullfør registrering" }, "registerWizardText": { "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", diff --git a/frontend/src/routes/guest/register/index.tsx b/frontend/src/routes/guest/register/index.tsx index ae8b4dd8ac65dc1ec4e524346f71be6716f8d16a..02194ba0d2a6645f40e83524473fc16e11134088 100644 --- a/frontend/src/routes/guest/register/index.tsx +++ b/frontend/src/routes/guest/register/index.tsx @@ -71,6 +71,7 @@ export default function GuestRegister() { const history = useHistory() const guestRegisterRef = useRef<GuestRegisterCallableMethods>(null) + const guestConsentRef = useRef<GuestRegisterCallableMethods>(null) // TODO On submit successful the user should be directed to some page telling // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -180,6 +181,11 @@ export default function GuestRegister() { guestRegisterRef.current.doSubmit() } } + if (activeStep === Step.ConsentStep) { + if (guestConsentRef.current) { + guestConsentRef.current.doSubmit() + } + } } const handleBack = () => { @@ -304,7 +310,7 @@ export default function GuestRegister() { <Suspense fallback={<CircularProgress />}> <GuestConsentStep nextHandler={handleForwardFromConsent} - ref={guestRegisterRef} + ref={guestConsentRef} /> </Suspense> </Box> @@ -333,10 +339,16 @@ export default function GuestRegister() { {t('button.next')} </Button> )} + {activeStep === Step.ConsentStep && ( + <Button onClick={handleNext} sx={{ mr: 1 }}> + {t('button.finishRegistration')} + </Button> + )} {activeStep === Step.ConsentStep && ( <Button data-testid="button-black" - sx={{ color: 'theme.palette.secondary', mr: 1 }} + color="secondary" + sx={{ mr: 1 }} onClick={handleBack} > {t('button.back')} diff --git a/frontend/src/routes/guest/register/steps/consent.tsx b/frontend/src/routes/guest/register/steps/consent.tsx index cf2ad31ecd5208c278ef9f321c6a51a085705ed9..882b17c5db7b1c4050657ce0d494457f4b4c96ff 100644 --- a/frontend/src/routes/guest/register/steps/consent.tsx +++ b/frontend/src/routes/guest/register/steps/consent.tsx @@ -4,7 +4,6 @@ import { SubmitHandler, useForm, useFieldArray } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { Box, - Button, FormControl, FormGroup, FormHelperText, @@ -167,7 +166,6 @@ const GuestConsentStep = forwardRef( </Box> ) })} - <Button onClick={onSubmit}>{t('button.save')}</Button> </form> </Box> )