Skip to content

Commit

Permalink
feat: allow 11 caracters identifiant FT
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlbrjc committed Dec 5, 2024
1 parent 9f957e3 commit 05d3413
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
11 changes: 8 additions & 3 deletions components/jeune/BlocInformationJeuneFicheBeneficiaire.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
import SituationTag from 'components/jeune/SituationTag'
import IconComponent, { IconName } from 'components/ui/IconComponent'
import { CategorieSituation, EtatSituation } from 'interfaces/beneficiaire'
import { Conseiller, estMilo } from 'interfaces/conseiller'
import {
Conseiller,
estConseilDepartemental,
estMilo,
} from 'interfaces/conseiller'
import { toShortDate } from 'utils/date'

interface BlocInformationJeuneFicheBeneficiaireProps {
Expand Down Expand Up @@ -43,7 +47,8 @@ export function BlocInformationJeuneFicheBeneficiaire({
? '/etablissement/beneficiaires'
: '/mes-jeunes'
const conseillerEstMilo = estMilo(conseiller)

const aIdentifiantFT =
!conseillerEstMilo && !estConseilDepartemental(conseiller)
return (
<div className='border border-solid rounded-base w-full p-4 border-grey_100'>
<h2 className='text-m-bold text-grey_800 mb-2'>Informations</h2>
Expand Down Expand Up @@ -78,7 +83,7 @@ export function BlocInformationJeuneFicheBeneficiaire({

{email && <Email email={email} />}

{!conseillerEstMilo &&
{aIdentifiantFT &&
onIdentifiantPartenaireCopie &&
onIdentifiantPartenaireClick && (
<IdentifiantPartenaire
Expand Down
7 changes: 3 additions & 4 deletions components/jeune/UpdateIdentifiantPartenaireModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function UpdateIdentifiantPartenaireModal({
updateIdentifiantPartenaire,
onClose,
}: UpdateIdentifiantPartenaireModalProps) {
const MAX_INPUT_LENGTH = 10
const MAX_INPUT_LENGTH = 11

const [portefeuille] = usePortefeuille()
const [getIdentifiantPartenaire, setIdentifiantPartenaire] = useState<
Expand All @@ -29,9 +29,8 @@ export default function UpdateIdentifiantPartenaireModal({

function identifiantPartenaireEstValide() {
return (
getIdentifiantPartenaire &&
getIdentifiantPartenaire.length > 0 &&
getIdentifiantPartenaire.length < 11
getIdentifiantPartenaire?.length &&
getIdentifiantPartenaire.length <= MAX_INPUT_LENGTH
)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pass-emploi-web",
"version": "5.1.2",
"version": "5.1.3",
"private": true,
"engines": {
"node": "22.11.0"
Expand Down
8 changes: 4 additions & 4 deletions tests/components/DetailsJeune.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe('<DetailsJeune>', () => {
it('affiche une pop-in pour ajouter un identifiant', async () => {
expect(
screen.getByLabelText(
'Identifiant France Travail (10 caractères maximum)'
'Identifiant France Travail (11 caractères maximum)'
)
).toBeInTheDocument()
expect(
Expand All @@ -187,7 +187,7 @@ describe('<DetailsJeune>', () => {
// Given
await userEvent.type(
screen.getByLabelText(
'Identifiant France Travail (10 caractères maximum)'
'Identifiant France Travail (11 caractères maximum)'
),
'12345'
)
Expand Down Expand Up @@ -255,7 +255,7 @@ describe('<DetailsJeune>', () => {
it('affiche une pop-in pour modifier l’identifiant', async () => {
expect(
screen.getByLabelText(
'Identifiant France Travail (10 caractères maximum)'
'Identifiant France Travail (11 caractères maximum)'
)
).toBeInTheDocument()
expect(
Expand All @@ -269,7 +269,7 @@ describe('<DetailsJeune>', () => {
// Given
await userEvent.type(
screen.getByLabelText(
'Identifiant France Travail (10 caractères maximum)'
'Identifiant France Travail (11 caractères maximum)'
),
'6789'
)
Expand Down

0 comments on commit 05d3413

Please sign in to comment.