Skip to content

Commit

Permalink
Merge pull request #93 from virtualidentityag/feat/DIAKONIE-215-regis…
Browse files Browse the repository at this point in the history
…tration-a11y

Feat/diakonie 215 registration a11y
  • Loading branch information
janrembold authored Apr 22, 2024
2 parents 0fd48b5 + 9452604 commit fe842d2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}

.template {
width: 100%;
max-width: 700px;

h2,
Expand Down
10 changes: 10 additions & 0 deletions src/extensions/components/registration/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ export const Registration = () => {
disabled={disabledNextButton}
variant="contained"
onClick={onRegisterClick}
type={
disabledNextButton
? 'button'
: 'submit'
}
>
{t('registration.register')}
</Button>
Expand All @@ -366,6 +371,11 @@ export const Registration = () => {
variant="contained"
onClick={onNextClick}
sx={{ width: 'unset' }}
type={
disabledNextButton
? 'button'
: 'submit'
}
>
{t('registration.next')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export const AccountData: VFC<{
}
onInputChange={setRepeatPassword}
value={repeatPassword}
info="&nbsp;"
label={t('registration.account.repeatPassword.label')}
isValueValid={async (val) =>
val === password && password.length > 0
Expand All @@ -209,7 +210,7 @@ export const AccountData: VFC<{
'registration.account.repeatPassword.success'
)}
/>
<FormGroup sx={{ mt: '40px' }}>
<FormGroup sx={{ mt: '20px' }}>
<FormControlLabel
onClick={() => {
setDataProtectionChecked(!dataProtectionChecked);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ export const AgencySelectionResults = ({
const { setDisabledNextButton, registrationData } =
useContext(RegistrationContext);
const { consultant: preselectedConsultant } = useContext(UrlParamsContext);

const [selectedAgency, setSelectedAgency] = useState<AgencyDataInterface>(
registrationData?.agency
);

const onlyExternalAgencies = results?.every((agency) => agency.external);
const isSingleResultAndNotOnlyExternal =
results?.length === 1 && !onlyExternalAgencies;

useEffect(() => {
if (
// only external agencies
Expand Down Expand Up @@ -100,8 +103,6 @@ export const AgencySelectionResults = ({
}
}, [selectedAgency, results, onChange, setDisabledNextButton, zipcode]);

const onlyExternalAgencies = results?.every((agency) => agency.external);

return (
<>
{!!results && !preselectedConsultant && (
Expand Down Expand Up @@ -213,7 +214,7 @@ export const AgencySelectionResults = ({
)}

{/* one Result */}
{results?.length === 1 && !onlyExternalAgencies && (
{isSingleResultAndNotOnlyExternal && (
<FormControl sx={{ width: '100%' }}>
<RadioGroup
data-cy="agency-selection-radio-group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ const TopicSelect = ({
value={topic?.id}
control={
<Radio
tabIndex={0}
onClick={onChange}
checked={checked}
checkedIcon={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export const ZipcodeInput: VFC<{
useEffect(() => {
if (REGISTRATION_DATA_VALIDATION.zipcode.validation(value)) {
setDisabledNextButton(false);
onChange({ zipcode: value });
onChange({
zipcode: value,
agencyId: undefined,
agency: undefined
});
} else {
setDisabledNextButton(true);
}
Expand Down

0 comments on commit fe842d2

Please sign in to comment.