Skip to content

Commit

Permalink
feat(AVO-3508): only allow teacher card numbers that start with 6 or 9
Browse files Browse the repository at this point in the history
  • Loading branch information
bertyhell committed Jan 24, 2025
1 parent 34b716f commit 674c6da
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
7 changes: 5 additions & 2 deletions src/authentication/components/StamboekInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export const StamboekInput: FC<StamboekInputProps> = ({ onChange, value = '' })
setStamboekValidationStatus('INCOMPLETE');
return;
}
if (/^[0-9]{11}(-[0-9]*)?$/g.test(cleanedStamboekNumber)) {

// Only allow numbers that start with a 6 or are our test number that starts with a 9
// https://meemoo.atlassian.net/browse/AVO-3508
if (/^[69][0-9]{10}$/g.test(cleanedStamboekNumber)) {
const stamboekNumber = cleanedStamboekNumber.substring(0, 11);
setStamboekValidationStatus('VALID_FORMAT');
const validationStatus: Avo.Stamboek.ValidationStatuses =
Expand Down Expand Up @@ -126,7 +129,7 @@ export const StamboekInput: FC<StamboekInputProps> = ({ onChange, value = '' })
return (
<Spacer className="m-stamboek-input" margin={['bottom-large']}>
<TextInput
placeholder={tText('authentication/components/stamboek-input___00000000000-000000')}
placeholder={tText('authentication/components/stamboek-input___60000000000')}
value={rawStamboekNumber}
onChange={setStamboekNumber}
/>
Expand Down
14 changes: 10 additions & 4 deletions src/authentication/views/registration-flow/r3-stamboek.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const RegisterStamboek: FC<RegisterStamboekProps> = ({ location }) => {
if (isError) {
return (
<ErrorView
message={tText('Het laden van dit help artikel is mislukt')}
message={tText(
'authentication/views/registration-flow/r-3-stamboek___het-laden-van-dit-help-artikel-is-mislukt'
)}
icon={IconName.alertTriangle}
/>
);
Expand Down Expand Up @@ -131,14 +133,18 @@ const RegisterStamboek: FC<RegisterStamboekProps> = ({ location }) => {
</FormGroup>

<Accordion
title={tText('Waar vind ik mijn lerarenkaart nummer?')}
title={tText(
'authentication/views/registration-flow/r-3-stamboek___waar-vind-ik-mijn-lerarenkaart-nummer'
)}
className="u-m-t-xl"
isOpen={false}
>
{renderContentPage(whereFindPageInfo, whereFindIsLoading, whereFindIsError)}
</Accordion>
<Accordion
title={tText('Waarom hebben jullie mijn stamboeknummer nodig?')}
title={tText(
'authentication/views/registration-flow/r-3-stamboek___waarom-hebben-jullie-mijn-stamboeknummer-nodig'
)}
className="u-m-t-s"
isOpen={false}
>
Expand All @@ -150,7 +156,7 @@ const RegisterStamboek: FC<RegisterStamboekProps> = ({ location }) => {
</Accordion>
<Accordion
title={tText(
'Ik ben lesgever en heb (nog) geen lerarenkaart of stamboeknummer.'
'authentication/views/registration-flow/r-3-stamboek___ik-ben-lesgever-en-heb-nog-geen-lerarenkaart-of-stamboeknummer'
)}
className="u-m-t-s"
isOpen={false}
Expand Down
Loading

0 comments on commit 674c6da

Please sign in to comment.