Skip to content

Commit

Permalink
feat: Bannière campagne handicap (#3443)
Browse files Browse the repository at this point in the history
* feat: Ajoute la bannière de campagne pour le handicap

* refactor: Extrait les variables pour les couleurs
  • Loading branch information
Mintoo200 authored Nov 15, 2024
1 parent 7b40d50 commit b6f1bb4
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.scalingo
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ NEXT_PUBLIC_API_ADRESSE_MINIMUM_QUERY_LENGTH=${NEXT_PUBLIC_API_ADRESSE_MINIMUM_Q
NEXT_PUBLIC_CAMPAGNE_ADFORM_FEATURE=${NEXT_PUBLIC_CAMPAGNE_ADFORM_FEATURE}
NEXT_PUBLIC_CAMPAGNE_COM_EN_COURS_FEATURE=${NEXT_PUBLIC_CAMPAGNE_COM_EN_COURS_FEATURE}
NEXT_PUBLIC_CAMPAGNE_APPRENTISSAGE_FEATURE=${NEXT_PUBLIC_CAMPAGNE_APPRENTISSAGE_FEATURE}
NEXT_PUBLIC_CAMPAGNE_HANDICAP=${NEXT_PUBLIC_CAMPAGNE_HANDICAP}
NEXT_PUBLIC_ENQUETE_SATISFACTION_FEATURE=${NEXT_PUBLIC_ENQUETE_SATISFACTION_FEATURE}
NEXT_PUBLIC_ENQUETE_SATISFACTION_URL='${NEXT_PUBLIC_ENQUETE_SATISFACTION_URL}'
NEXT_PUBLIC_FORMATION_LBA_FEATURE=${NEXT_PUBLIC_FORMATION_LBA_FEATURE}
Expand Down
Binary file added public/images/campagne-handicap.webp
Binary file not shown.
13 changes: 13 additions & 0 deletions src/pages/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ $color-background-world-skills: #2E1651;
padding-bottom: 1.25rem;
}
}

&.handicap {
// FIXME (GAFI 15-11-2024):
background-color: utilities.$color-primary-campagne-handicap;
color: utilities.$color-text-on-primary-campagne-handicap;

& a {
color: utilities.$color-text-on-secondary-campagne-handicap;
background-color: utilities.$color-secondary-campagne-handicap;
border: none;
outline-color: utilities.$color-secondary-campagne-handicap;
}
}
}

.card {
Expand Down
52 changes: 52 additions & 0 deletions src/pages/index.page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,58 @@ describe('Page d’accueil', () => {
expect(voirPlusButton).toHaveAttribute('href', '/faq/apprentissage-employeurs-apprentis');
});
});

describe('Semaine du handicap', () => {
describe('feature flip', () => {
it('affiche la bannière si le feature flip est activé', () => {
// Given
process.env.NEXT_PUBLIC_CAMPAGNE_HANDICAP = '1';

// When
render(
<DependenciesProvider analyticsService={analyticsService}>
<Accueil actualites={anActualiteList()} />
</DependenciesProvider>,
);

// Then
expect(screen.getByText('Semaine européenne pour l’emploi des personnes handicapées')).toBeVisible();
});
it('n’affiche pas la bannière si le feature flip est désactivé', () => {
// Given
process.env.NEXT_PUBLIC_CAMPAGNE_HANDICAP = '0';

// When
render(
<DependenciesProvider analyticsService={analyticsService}>
<Accueil actualites={anActualiteList()} />
</DependenciesProvider>,
);

// Then
expect(screen.queryByText('Semaine européenne pour l’emploi des personnes handicapées')).not.toBeInTheDocument();
});
});

it('la bannière contient les wording de la campagne apprentissage', () => {
// Given
process.env.NEXT_PUBLIC_CAMPAGNE_HANDICAP = '1';

// When
render(
<DependenciesProvider analyticsService={analyticsService}>
<Accueil actualites={anActualiteList()} />
</DependenciesProvider>,
);

// Then
const heading = screen.getByRole('heading', { level: 2, name: 'Semaine européenne pour l’emploi des personnes handicapées' });
expect(heading).toBeVisible();
const voirPlusButton = screen.getByRole('link', { name: 'Lire l’article' });
expect(voirPlusButton).toBeVisible();
expect(voirPlusButton).toHaveAttribute('href', '/articles/semaine-emploi-handicap');
});
});
});

describe('Sections', () => {
Expand Down
18 changes: 18 additions & 0 deletions src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default function Accueil(accueilProps: AccueilPageProps) {

const isCampagneApprentissageVisible = process.env.NEXT_PUBLIC_CAMPAGNE_APPRENTISSAGE_FEATURE === '1';

const isCampagneHandicapVisible = process.env.NEXT_PUBLIC_CAMPAGNE_HANDICAP === '1';

const actualitesCardListContent: CardContent[] = accueilProps.actualites.map((carte: Actualite): CardContent => {
return {
children: <p>{carte.extraitContenu}</p>,
Expand Down Expand Up @@ -349,6 +351,22 @@ export default function Accueil(accueilProps: AccueilPageProps) {
)
}

{isCampagneHandicapVisible && (
<HeroWithIllustration image="/images/campagne-handicap.webp" className={classNames(styles.hero, styles.handicap)}>
<h2>
<HeroPrimaryText className={styles.heroTitle}>
Semaine européenne pour l’emploi des personnes handicapées
</HeroPrimaryText>
</h2>
<HeroSecondaryText>
Du 18 au 24 novembre, <b>1jeune1solution</b> se mobilise, et vous propose un article par jour pour sensibiliser au handicap et promouvoir l’inclusion professionnelle. </HeroSecondaryText>
<Link href="/articles/semaine-emploi-handicap" appearance={'asSecondaryButton'} className={styles.heroButton}>
Lire l’article
<Link.Icon />
</Link>
</HeroWithIllustration>
)}

{!isOldEspaceJeuneActif && actualitesCardListContent.length > 0
&& (
<section className={styles.section}>
Expand Down
8 changes: 8 additions & 0 deletions src/styles/theme/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ $color-groupe-3-blue: #407BFF;
* ***************/
$color-title-apprentissage-2024: #E8CF31;

/* ***************
* Complementary colors - Campagne Semaine du handicap
* ***************/
$color-primary-campagne-handicap: #FCC84F;
$color-secondary-campagne-handicap: #244352;
$color-text-on-primary-campagne-handicap: $color-secondary-campagne-handicap;
$color-text-on-secondary-campagne-handicap: #FFFFFF;

/* ***************
* Shadows
* ***************/
Expand Down

0 comments on commit b6f1bb4

Please sign in to comment.