Skip to content
Snippets Groups Projects
Commit 5396ae52 authored by Tore.Brede's avatar Tore.Brede
Browse files

GREG-135: Update register new guest UI

parent 914ac03c
No related branches found
No related tags found
1 merge request!206GREG-135: Update register new guest UI
Pipeline #104328 passed
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
"passportNumber": "Passport number", "passportNumber": "Passport number",
"passportNationality": "Passport nationality", "passportNationality": "Passport nationality",
"countryCallingCode": "Country code", "countryCallingCode": "Country code",
"contactPersonUnit": "Contact at unit" "contactPersonUnit": "Contact at unit",
"optional": "(optional)"
}, },
"sponsor": { "sponsor": {
"addRole": "Add role", "addRole": "Add role",
...@@ -118,10 +119,10 @@ ...@@ -118,10 +119,10 @@
"finishRegistration": "Finish registration" "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. These fields are mandatory.",
"summaryPage": "Check that the values are correct before saving.", "summaryPage": "Check that the values are correct before saving.",
"registerContactInfo": "Register contact info", "registerContactInfo": "Register contact info",
"registerPeriod": "Register period", "registerPeriod": "Register role and period",
"registerPeriodText": "Enter role and duration.", "registerPeriodText": "Enter role and duration.",
"summaryContactInformation": "Summary contact information", "summaryContactInformation": "Summary contact information",
"summaryPeriod": "Summary period", "summaryPeriod": "Summary period",
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
"passportNumber": "Passnummer", "passportNumber": "Passnummer",
"passportNationality": "Passnasjonalitet", "passportNationality": "Passnasjonalitet",
"countryCallingCode": "Landkode", "countryCallingCode": "Landkode",
"contactPersonUnit": "Kontakt ved avdeling" "contactPersonUnit": "Kontakt ved avdeling",
"optional": "(valgfritt)"
}, },
"sponsor": { "sponsor": {
"addRole": "Legg til rolle", "addRole": "Legg til rolle",
...@@ -118,10 +119,10 @@ ...@@ -118,10 +119,10 @@
"finishRegistration": "Fullfør registrering" "finishRegistration": "Fullfør registrering"
}, },
"registerWizardText": { "registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Disse feltene er obligatoriske.",
"summaryPage": "Sjekk at alt stemmer før lagring.", "summaryPage": "Sjekk at alt stemmer før lagring.",
"registerContactInfo": "Registrere kontaktinfo", "registerContactInfo": "Registrer kontaktinfo",
"registerPeriod": "Registrere periode", "registerPeriod": "Registrer rolle og periode",
"registerPeriodText": "Fyll inn rolle og periode.", "registerPeriodText": "Fyll inn rolle og periode.",
"summaryContactInformation": "Summary contact information", "summaryContactInformation": "Summary contact information",
"summaryPeriod": "Summary period", "summaryPeriod": "Summary period",
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
"passportNumber": "Passnummer", "passportNumber": "Passnummer",
"passportNationality": "Passnasjonalitet", "passportNationality": "Passnasjonalitet",
"countryCallingCode": "Landkode", "countryCallingCode": "Landkode",
"contactPersonUnit": "Kontakt ved avdeling" "contactPersonUnit": "Kontakt ved avdeling",
"optional": "(valfritt)"
}, },
"sponsor": { "sponsor": {
"addRole": "Legg til role", "addRole": "Legg til role",
...@@ -119,10 +120,10 @@ ...@@ -119,10 +120,10 @@
"finishRegistration": "Fullfør registrering" "finishRegistration": "Fullfør registrering"
}, },
"registerWizardText": { "registerWizardText": {
"registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Alle feltene er obligatoriske.", "registerPage": "Fyll inn kontaktinformasjonen til gjesten under. Desse felta er obligatoriske.",
"summaryPage": "Sjekk at alt stemmer før lagring.", "summaryPage": "Sjekk at alt stemmer før lagring.",
"registerContactInfo": "Registrere kontaktinfo", "registerContactInfo": "Registrer kontaktinfo",
"registerPeriod": "Registrere periode", "registerPeriod": "Registrer rolle og periode",
"registerPeriodText": "Fyll inn rolle og periode.", "registerPeriodText": "Fyll inn rolle og periode.",
"summaryContactInformation": "Summary contact information", "summaryContactInformation": "Summary contact information",
"summaryPeriod": "Summary period", "summaryPeriod": "Summary period",
......
import { import {
Box, Box,
FormControl, Divider,
InputLabel,
MenuItem, MenuItem,
Select,
SelectChangeEvent,
Stack, Stack,
TextField, TextField,
Typography, Typography,
...@@ -76,7 +73,7 @@ const StepPersonForm = forwardRef( ...@@ -76,7 +73,7 @@ const StepPersonForm = forwardRef(
reset(formData) reset(formData)
}, []) }, [])
const handleOuChange = (event: SelectChangeEvent) => { const handleOuChange = (event: any) => {
if (event.target.value) { if (event.target.value) {
setOuChoice(event.target.value) setOuChoice(event.target.value)
setValue('ou_id', parseInt(event.target.value, 10)) setValue('ou_id', parseInt(event.target.value, 10))
...@@ -132,11 +129,18 @@ const StepPersonForm = forwardRef( ...@@ -132,11 +129,18 @@ const StepPersonForm = forwardRef(
> >
{t('registerWizardText.registerContactInfo')} {t('registerWizardText.registerContactInfo')}
</Typography> </Typography>
<Typography sx={{ paddingBottom: '2rem' }}> <Typography sx={{ paddingBottom: '0.5rem' }}>
{t('registerWizardText.registerPage')} {t('registerWizardText.registerPage')}
</Typography> </Typography>
<Box sx={{ maxWidth: '30rem' }}> <Divider />
<form onSubmit={onSubmit}> <form onSubmit={onSubmit}>
<Box
sx={{
paddingTop: '1rem',
paddingBottom: '4rem',
maxWidth: '30rem',
}}
>
<Stack spacing={2}> <Stack spacing={2}>
<TextField <TextField
id="firstName" id="firstName"
...@@ -166,33 +170,24 @@ const StepPersonForm = forwardRef( ...@@ -166,33 +170,24 @@ const StepPersonForm = forwardRef(
validate: isValidEmail, validate: isValidEmail,
})} })}
/> />
</Stack>
</Box>
<Typography
variant="h5"
sx={{
paddingTop: '1rem',
paddingBottom: '1rem',
}}
>
{t('registerWizardText.registerPeriod')}
</Typography>
<Typography sx={{ paddingBottom: '0.5rem' }}>
{t('registerWizardText.registerPeriodText')}
</Typography>
<Divider />
<Typography variant="h5" sx={{ paddingTop: '1rem' }}> <Box sx={{ paddingTop: '1rem', maxWidth: '30rem' }}>
{t('registerWizardText.registerPeriod')} <Stack spacing={2}>
</Typography>
<Typography sx={{ paddingBottom: '1rem' }}>
{t('registerWizardText.registerPeriodText')}
</Typography>
<FormControl fullWidth>
<InputLabel id="ou-select-label">{t('common:ou')}</InputLabel>
<Select
labelId="ou-select-label"
id="ou-select-label"
value={ouChoice?.toString()}
label={t('common:ou')}
onChange={handleOuChange}
>
{ous.length > 0 &&
ous
.sort(i18n.language === 'en' ? enSort : nbSort)
.map((ou) => (
<MenuItem key={ou.id.toString()} value={ou.id}>
{i18n.language === 'en' ? ou.en : ou.nb} ({ou.id})
</MenuItem>
))}
</Select>
</FormControl>
<TextField <TextField
id="roletype-select" id="roletype-select"
select select
...@@ -210,6 +205,22 @@ const StepPersonForm = forwardRef( ...@@ -210,6 +205,22 @@ const StepPersonForm = forwardRef(
))} ))}
</TextField> </TextField>
<TextField
id="ou-select-label"
select
value={ouChoice?.toString()}
label={t('common:ou')}
onChange={handleOuChange}
>
{ous
.sort(i18n.language === 'en' ? enSort : nbSort)
.map((ou) => (
<MenuItem key={ou.id.toString()} value={ou.id}>
{i18n.language === 'en' ? ou.en : ou.nb} ({ou.id})
</MenuItem>
))}
</TextField>
{/* There are no particular constraints on the date pickers. It should be allowed to add a role with a start date that is in the past for instance */} {/* There are no particular constraints on the date pickers. It should be allowed to add a role with a start date that is in the past for instance */}
<Controller <Controller
name="role_start" name="role_start"
...@@ -257,7 +268,9 @@ const StepPersonForm = forwardRef( ...@@ -257,7 +268,9 @@ const StepPersonForm = forwardRef(
{displayContactAtUnit && ( {displayContactAtUnit && (
<TextField <TextField
id="contact_person" id="contact_person"
label={t('input.contactPersonUnit')} label={`${t('input.contactPersonUnit')} ${t(
'input.optional'
)}`}
{...register(`contact_person_unit`)} {...register(`contact_person_unit`)}
/> />
)} )}
...@@ -265,15 +278,15 @@ const StepPersonForm = forwardRef( ...@@ -265,15 +278,15 @@ const StepPersonForm = forwardRef(
{displayComment && ( {displayComment && (
<TextField <TextField
id="comment" id="comment"
label={t('input.comment')} label={`${t('input.comment')} ${t('input.optional')}`}
multiline multiline
rows={5} rows={5}
{...register(`comment`)} {...register(`comment`)}
/> />
)} )}
</Stack> </Stack>
</form> </Box>
</Box> </form>
</> </>
) )
} }
......
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