Skip to content

Commit

Permalink
feat: ouvrir avenir pro
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzem committed Dec 3, 2024
1 parent e279ed8 commit 7bcee24
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default function AidePage() {
return process.env.NEXT_PUBLIC_FAQ_PE_EXTERNAL_LINK as string
case StructureConseiller.POLE_EMPLOI_BRSA:
case StructureConseiller.POLE_EMPLOI_AIJ:
case StructureConseiller.AVENIR_PRO:
return process.env.NEXT_PUBLIC_FAQ_PASS_EMPLOI_EXTERNAL_LINK as string
case StructureConseiller.CONSEIL_DEPT:
return process.env.NEXT_PUBLIC_FAQ_CD_BRSA_EXTERNAL_LINK as string
Expand All @@ -68,6 +69,7 @@ export default function AidePage() {
case StructureConseiller.POLE_EMPLOI_BRSA:
case StructureConseiller.POLE_EMPLOI_AIJ:
case StructureConseiller.CONSEIL_DEPT:
case StructureConseiller.AVENIR_PRO:
return urlSiteRessource + 'assistance/'
case StructureConseiller.POLE_EMPLOI:
return urlSiteRessource + 'formuler-une-demande/'
Expand Down
20 changes: 19 additions & 1 deletion app/(connexion)/login/passemploi/LoginPassEmploiPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function LoginPage() {
<h2 className='text-l-bold text-primary_darken text-center my-6 mx-4'>
Connexion conseiller AIJ
</h2>
<ul className='px-6 pt-6 flex flex-col gap-4'>
<ul className='px-6 pt-6 flex flex-col gap-4 layout_s:border-r-2 layout_s:border-grey_100'>
<li>
<LoginButton
altText='France Travail AIJ'
Expand All @@ -99,6 +99,24 @@ function LoginPage() {
/>
</li>
</ul>

<h2 className='text-l-bold text-primary_darken text-center my-6 mx-4'>
Connexion conseiller Avenir Pro
</h2>
<ul className='px-6 pt-6 flex flex-col gap-4'>
<li>
<LoginButton
altText='France Travail Avenir Pro'
label='France Travail'
className='whitespace-nowrap'
style={ButtonStyle.SECONDARY}
illustrationName={IllustrationName.LogoFT}
handleSubmit={(event) =>
handleSignin(event, 'avenirpro-conseiller')
}
/>
</li>
</ul>
</main>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/autherror/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function AuthError({
case 'UTILISATEUR_DEJA_PE_BRSA':
case 'UTILISATEUR_DEJA_PE_AIJ':
case 'UTILISATEUR_DEJA_CONSEIL_DEPT':
case 'UTILISATEUR_DEJA_AVENIR_PRO':
erreur =
"Veuillez vous connecter en choisissant France Travail sur l'application Pass Emploi ou contacter votre conseiller pour recréer le compte."
break
Expand All @@ -57,6 +58,8 @@ export default function AuthError({
case 'POLE_EMPLOI_BRSA':
case 'POLE_EMPLOI_AIJ':
case 'FRANCE_TRAVAIL':
case 'CONSEIL_DEPT':
case 'AVENIR_PRO':
idpName = 'France Travail Connect'
break
default:
Expand Down Expand Up @@ -90,6 +93,7 @@ export default function AuthError({
case StructureConseiller.POLE_EMPLOI_BRSA:
case StructureConseiller.POLE_EMPLOI_AIJ:
case StructureConseiller.CONSEIL_DEPT:
case StructureConseiller.AVENIR_PRO:
return (
(process.env
.NEXT_PUBLIC_FAQ_PASS_EMPLOI_EXTERNAL_LINK as string) +
Expand Down
2 changes: 2 additions & 0 deletions components/ConfirmationDeleteConseillerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default function ConfirmationDeleteConseillerModal({

const labelStructure = ((): string => {
switch (conseiller.structure) {
case StructureConseiller.AVENIR_PRO:
return 'avenir pro'
case StructureConseiller.CONSEIL_DEPT:
return 'départemental'
case StructureConseiller.POLE_EMPLOI_BRSA:
Expand Down
1 change: 1 addition & 0 deletions components/layouts/AlerteDisplayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function getAlertesForStructure(structure?: string): DictAlertes {
case StructureConseiller.POLE_EMPLOI_BRSA:
case StructureConseiller.POLE_EMPLOI_AIJ:
case StructureConseiller.CONSEIL_DEPT:
case StructureConseiller.AVENIR_PRO:
return ALERTES
}
}
1 change: 1 addition & 0 deletions components/onboarding/OnboardingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function OnboardingModal(
case StructureConseiller.POLE_EMPLOI_BRSA:
case StructureConseiller.POLE_EMPLOI_AIJ:
case StructureConseiller.CONSEIL_DEPT:
case StructureConseiller.AVENIR_PRO:
return <OnboardingPEModal {...props} estPassEmploi={true} />
case StructureConseiller.MILO:
return <OnboardingMILOModal {...props} />
Expand Down
15 changes: 9 additions & 6 deletions interfaces/conseiller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum StructureConseiller {
POLE_EMPLOI_BRSA = 'POLE_EMPLOI_BRSA',
POLE_EMPLOI_AIJ = 'POLE_EMPLOI_AIJ',
CONSEIL_DEPT = 'CONSEIL_DEPT',
AVENIR_PRO = 'AVENIR_PRO',
}

export enum UserType {
Expand Down Expand Up @@ -52,11 +53,12 @@ export function estBRSA(conseiller: Conseiller): boolean {
export function estPassEmploi(
conseiller: Pick<Conseiller, 'structure'>
): boolean {
return (
conseiller.structure === StructureConseiller.POLE_EMPLOI_BRSA ||
conseiller.structure === StructureConseiller.POLE_EMPLOI_AIJ ||
conseiller.structure === StructureConseiller.CONSEIL_DEPT
)
return [
StructureConseiller.POLE_EMPLOI_BRSA,
StructureConseiller.POLE_EMPLOI_AIJ,
StructureConseiller.CONSEIL_DEPT,
StructureConseiller.AVENIR_PRO,
].includes(conseiller.structure)
}

export function estSuperviseur(conseiller: Conseiller): boolean {
Expand All @@ -79,7 +81,8 @@ export function estUserPassEmploi(user: Session.HydratedUser): boolean {
return (
user.structure === StructureConseiller.POLE_EMPLOI_BRSA ||
user.structure === StructureConseiller.POLE_EMPLOI_AIJ ||
user.structure === StructureConseiller.CONSEIL_DEPT
user.structure === StructureConseiller.CONSEIL_DEPT ||
user.structure === StructureConseiller.AVENIR_PRO
)
}

Expand Down
21 changes: 21 additions & 0 deletions tests/pages/LoginPassEmploiPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ describe('LoginPassEmploiPage client side', () => {
const franceTravailAIJButton = screen.getByRole('button', {
name: 'Connexion France Travail AIJ',
})
const franceTravailAvenirProButton = screen.getByRole('button', {
name: 'Connexion France Travail Avenir Pro',
})
const franceTravailRSAButton = screen.getByRole('button', {
name: 'Connexion France Travail RSA',
})
Expand All @@ -70,6 +73,7 @@ describe('LoginPassEmploiPage client side', () => {

//THEN
expect(franceTravailAIJButton).toBeInTheDocument()
expect(franceTravailAvenirProButton).toBeInTheDocument()
expect(franceTravailRSAButton).toBeInTheDocument()
expect(conseillerDeptButton).toBeInTheDocument()
})
Expand Down Expand Up @@ -108,6 +112,23 @@ describe('LoginPassEmploiPage client side', () => {
)
})

it("permet de s'identifier en tant que conseiller FT Avenir Pro", async () => {
// Given
const button = screen.getByRole('button', {
name: 'Connexion France Travail Avenir Pro',
})

// When
await userEvent.click(button)

// Then
expect(signin).toHaveBeenCalledWith(
'avenirpro-conseiller',
setErrorMsg,
'redirectUrl'
)
})

it("permet de s'identifier en tant que conseiller dept", async () => {
// Given
const cdButton = screen.getByRole('button', {
Expand Down
2 changes: 2 additions & 0 deletions utils/analytics/matomo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ function userStructureDimensionString(
return 'Pôle emploi AIJ'
case StructureConseiller.CONSEIL_DEPT:
return 'Conseiller départemental'
case StructureConseiller.AVENIR_PRO:
return 'Avenir Pro'
case null:
return 'visiteur'
}
Expand Down

0 comments on commit 7bcee24

Please sign in to comment.