Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(services jeunes): Modifier le single types des mesures jeunes en ajoutant les categories engagement et logement #3215

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ $transition-visibility: visibility 0ms $transition-duration linear;
background-color: utilities.$color-groupe-3-green;
}

& .categoryEngagement {
background-color: utilities.$color-groupe-3-blue;
}

& .categoryLogement {
background-color: utilities.$color-groupe-3-pink;
}

& .body {
display: grid;
grid-template-rows: auto 1fr;
Expand Down
4 changes: 4 additions & 0 deletions src/client/components/ui/Card/Flipping/FlippingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export function FlippingCard(props: FlippingCardProps) {
return styles.categoryVieProfessionnelle;
case ServiceJeune.Categorie.AIDES_FINANCIERES:
return styles.categoryAidesFinancieres;
case ServiceJeune.Categorie.ENGAGEMENT:
return styles.categoryEngagement;
case ServiceJeune.Categorie.LOGEMENT:
return styles.categoryLogement;
}
}, [category]);

Expand Down
9 changes: 9 additions & 0 deletions src/server/services-jeunes/domain/servicesJeunes.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export function anUnorderedAndNotFilterServiceJeuneList(): Array<ServiceJeune> {
categorie: ServiceJeune.Categorie.AIDES_FINANCIERES,
titre: 'Des aides pour financer son permis de conduire',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.ENGAGEMENT,
titre: 'Le Service Militaire Volontaire',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.LOGEMENT,
titre: 'Un Logement',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.ORIENTATION_FORMATION,
titre: 'Les Junior Entreprises',
Expand All @@ -48,6 +56,7 @@ export function anUnorderedAndNotFilterServiceJeuneList(): Array<ServiceJeune> {
categorie: ServiceJeune.Categorie.ENTREE_VIE_PROFESSIONELLE,
titre: 'Le Parcours Emploi Compétences (PEC) Jeunes',
}),

];
}

2 changes: 2 additions & 0 deletions src/server/services-jeunes/domain/servicesJeunes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ export namespace ServiceJeune {
AIDES_FINANCIERES = 'Aides financières',
ORIENTATION_FORMATION = 'Orientation et formation',
ENTREE_VIE_PROFESSIONELLE = 'Entrée dans la vie professionnelle',
LOGEMENT = 'Logement',
ENGAGEMENT = 'Engagement',
}
}
20 changes: 20 additions & 0 deletions src/server/services-jeunes/infra/strapiMesuresJeunes.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ export function aStrapiMesuresJeunesParCategorie(overrides?: Partial<StrapiMesur
article: undefined,
titre: 'Des aides pour financer son permis de conduire',
})],
engagement: [aStrapiMesureJeune({
titre: 'Le Service Militaire Volontaire',
})],
logement: [aStrapiMesureJeune({
titre: 'Un Logement',
})],
orienterFormer: [aStrapiMesureJeune({
titre: 'Les Junior Entreprises',
})],
vieProfessionnelle: [aStrapiMesureJeune({
titre: 'Le Parcours Emploi Compétences (PEC) Jeunes',
})],
/*logement: [aStrapiMesureJeune({
titre: 'Logement',
})],
engagement: [aStrapiMesureJeune({
titre: 'Le Service Militaire Volontaire',
})], ok test, linter not*/
...overrides,
};
}
Expand All @@ -26,6 +38,8 @@ export function aStrapiMesuresJeunesParCategorieSansResultat(overrides?: Partial
return {
accompagnement: [],
aidesFinancieres: [],
engagement: [],
logement: [],
orienterFormer: [],
vieProfessionnelle: [],
...overrides,
Expand All @@ -44,6 +58,12 @@ export function aStrapiUnorderedMesuresJeunesParCategorie(): StrapiMesuresJeunes
article: undefined,
titre: 'Des aides pour financer son permis de conduire',
})],
engagement: [aStrapiMesureJeune({
titre: 'Le Service Militaire Volontaire',
})],
logement: [aStrapiMesureJeune({
titre: 'Un logement',
})],
orienterFormer: [aStrapiMesureJeune({
titre: 'Les Junior Entreprises',
})],
Expand Down
4 changes: 3 additions & 1 deletion src/server/services-jeunes/infra/strapiMesuresJeunes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export namespace StrapiMesuresJeunes {
orienterFormer: Array<StrapiMesuresJeunes.MesureJeune>
accompagnement: Array<StrapiMesuresJeunes.MesureJeune>
aidesFinancieres: Array<StrapiMesuresJeunes.MesureJeune>
logement: Array<StrapiMesuresJeunes.MesureJeune>
engagement: Array<StrapiMesuresJeunes.MesureJeune>
}
export interface MesureJeune {
titre: string
Expand All @@ -18,5 +20,5 @@ export namespace StrapiMesuresJeunes {
pourQui: string
}

export type Categorie = 'accompagnement' | 'orienterFormer' | 'vieProfessionnelle' | 'aidesFinancieres'
export type Categorie = 'accompagnement' | 'orienterFormer' | 'vieProfessionnelle' | 'aidesFinancieres' | 'logement' | 'engagement'
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ describe('mapToServicesJeunes', () => {
aidesFinancieres: [aStrapiMesureJeune({
titre: 'Des aides pour financer son permis de conduire',
})],
engagement: [aStrapiMesureJeune({
titre: 'Le Service Militaire Volontaire',
})],
logement: [aStrapiMesureJeune({
titre: 'Un Logement',
})],
orienterFormer: [aStrapiMesureJeune({
titre: 'Les Junior Entreprises',
})],
vieProfessionnelle: [aStrapiMesureJeune({
titre: 'Le Parcours Emploi Compétences (PEC) Jeunes',
})],

});

// WHEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export function mapToServicesJeunes(strapiMesuresJeunes: StrapiMesuresJeunes.Mes
const mesuresJeunesParCategorie = {
accompagnement: strapiMesuresJeunes.accompagnement,
aidesFinancieres: strapiMesuresJeunes.aidesFinancieres,
engagement: strapiMesuresJeunes.engagement,
logement: strapiMesuresJeunes.logement,
orienterFormer: strapiMesuresJeunes.orienterFormer,
vieProfessionnelle: strapiMesuresJeunes.vieProfessionnelle,
};
Expand Down Expand Up @@ -44,5 +46,9 @@ function mapServiceJeuneCategorie(mesureJeuneKey: keyof StrapiMesuresJeunes.Mesu
return ServiceJeune.Categorie.ENTREE_VIE_PROFESSIONELLE;
case 'aidesFinancieres':
return ServiceJeune.Categorie.AIDES_FINANCIERES;
case 'engagement':
return ServiceJeune.Categorie.ENGAGEMENT;
case 'logement':
return ServiceJeune.Categorie.LOGEMENT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ describe('strapiMesuresJeunesRepository', () => {
categorie: ServiceJeune.Categorie.ENTREE_VIE_PROFESSIONELLE,
titre: 'Le Parcours Emploi Compétences (PEC) Jeunes',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.ENGAGEMENT,
titre: 'Le Service Militaire Volontaire',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.ORIENTATION_FORMATION,
titre: 'Les Junior Entreprises',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.LOGEMENT,
titre: 'Un logement',
}),
aServiceJeune({
categorie: ServiceJeune.Categorie.ACCOMPAGNEMENT,
titre: 'Une formation en centre EPIDE',
Expand Down