Skip to content

Demandeur d'emploi : afficher le statut d’éligibilité du candidat sur sa page d’accueil - #6084

Merged
EwenKorr merged 9 commits into
masterfrom
deloo/update-job-seeker-dashboard
Jun 23, 2025
Merged

EwenKorr merged 9 commits into
masterfrom
deloo/update-job-seeker-dashboard

Conversation

@hellodeloo

@hellodeloo hellodeloo commented May 5, 2025 •

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Le candidat qui se connecte à son espace ne retrouve pas facilement le statut de son éligibilité, hormis s’il a déjà un PASS IAE.

🍰 Comment ?

Afficher les informations relatives à l’éligibilité IAE du candidat dans sa page d’accueil connecté lorsqu’il n’a pas de PASS IAE valide.

Comment tester ?

Se connecter en tant qu'admin sur la recette jetable, et détourner les comptes test0{1-9}@inclusion.gouv.fr.
Leurs noms et prénoms explicitent les différentes situations.

💻 Captures d'écran

@hellodeloo hellodeloo self-assigned this May 5, 2025
@hellodeloo hellodeloo added the ajouté Ajouté dans le changelog. label May 5, 2025
@notion-workspace

Copy link
Copy Markdown

@hellodeloo hellodeloo changed the title Deloo/update job seeker dashboard Afficher le statut d’éligibilité du candidat sur sa page d’accueil May 5, 2025
@hellodeloo
hellodeloo marked this pull request as draft May 5, 2025 15:53
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 5 times, most recently from a9fc231 to e37a474 Compare May 23, 2025 15:32
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 2 times, most recently from fe8afa2 to b36a0c4 Compare May 30, 2025 08:39
@EwenKorr EwenKorr added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label May 30, 2025
@github-actions

Copy link
Copy Markdown

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 2 times, most recently from 3ed529a to 3d1c24c Compare May 30, 2025 09:57
@EwenKorr EwenKorr removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label May 30, 2025
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch from 3d1c24c to 6739608 Compare June 2, 2025 07:10
@EwenKorr EwenKorr added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jun 2, 2025
@github-actions

github-actions Bot commented Jun 2, 2025

Copy link
Copy Markdown

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 3 times, most recently from 6fbefbb to 7b0dd25 Compare June 2, 2025 09:13

@EwenKorr EwenKorr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Une refonte de l'affichage des diagnostics d'éligibilité est prévue :

  • affichage dans les candidatures vs affichage dans le tableau de bord candidat
  • utilisateur en cours (prescripteur ou employeur)
  • qui envoie la candidature (prescripteur habilité ou non)
  • SIAE vs GEIQ

Pour l'instant, c'est assez difficile de mutualiser le code malheureusement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'avais d'abord tenté de passer une variable for_job_seeker en cascade (last_considered_valid, for_job_seeker_and_siae, has_valid_approval), mais ça compliquait pas mal toutes ces méthodes.

À la place, j'introduis donc une méthode last_for_job_seeker.

# name: TestDashboardView.test_jobseeker_approval_card[job seeker with approval queries]
dict({
'num_queries': 8,
'num_queries': 15,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On tape un peu partout pour avoir l'éligibilité. Mais passer de 8 à 15 requêtes, c'est peut-être beaucoup ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça semble beaucoup oui ^^'
Après ce n'est utilisé que sur cette page donc c'est pas ultra embêtant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici par contre, passer une variable en cascade (for_job_seeker) me semblait plus correct, les changements ne sont pas trop importants, et on ne duplique pas la logique.

@EwenKorr
EwenKorr marked this pull request as ready for review June 2, 2025 09:25
@EwenKorr
EwenKorr requested review from leo-naeka and tonial June 2, 2025 09:27
- an expired diagnosis if there is one and no valid diagnoses
"""

approval_subquery = Exists(Approval.objects.filter(eligibility_diagnosis=OuterRef("pk")))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cela engendre une requête qui existe déjà (dans le gabarit on a des user.latest_common_approval).

Je ne sais pas encore comment réussir à réutiliser l'information.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(13 requêtes comprenant 4 similaires et 2 en double)
😢

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le fait est que ça fait appel à un certain nombre de méthodes qui font leurs propres requêtes et qu'il serait p-e bon de dénormaliser si la multiplication des requêtes pose un souci (ce dont je ne suis pas convaincu)…

Ceci dit, tu dois pouvoir retirer quelques requêtes en optimisant le prefetching avec un Prefetch()

@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch from 7b0dd25 to 442d7e8 Compare June 2, 2025 10:17
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 2 times, most recently from 0b8e037 to ee10dda Compare June 16, 2025 07:06
@EwenKorr EwenKorr removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jun 16, 2025
# name: TestDashboardView.test_jobseeker_approval_card[job seeker with approval queries]
dict({
'num_queries': 8,
'num_queries': 15,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça semble beaucoup oui ^^'
Après ce n'est utilisé que sur cette page donc c'est pas ultra embêtant.

Comment thread tests/www/dashboard/__snapshots__/test_dashboard.ambr Outdated
Comment thread tests/www/dashboard/__snapshots__/test_dashboard.ambr Outdated
Comment thread tests/www/dashboard/__snapshots__/test_dashboard.ambr
''',
}),
dict({
'origin': list([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et là on retourne voir son pass....
Cela dit j'ai un doute sur le fonctionnement de considered_to_expire_at qui vérifie si le candidat a un PASS valide, pas si ce PASS a été créé avec ce diagnostic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui je vais regarder ça

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En fait j'imagine que c'est intentionnel :

# Methods below (whose name contain `considered`) take into account
# the existence of an ongoing approval.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense quand même que ce calcul est faux: si un utilisateur a plusieurs diagnostics, et un PASS tous les diagnostics vont répondre True, alors que ce n'est pas le cas.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avec #6378 on retourne chercher un pass, spécifiquement celui associé au diag du coup.

@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 4 times, most recently from 3efe875 to 94394b0 Compare June 19, 2025 13:03
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch 5 times, most recently from 5c3281a to 4457b53 Compare June 20, 2025 11:39
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch from 4457b53 to 69b962b Compare June 20, 2025 12:06

@register.simple_tag
def iae_eligibility_badge(*, is_eligible, extra_class=""):
def iae_eligibility_badge(*, is_eligible, extra_class="", for_job_seeker=False):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu pourrais rajouter des snapshots en plus dans test_iae_eligibility_badge & test_geiq_eligibility_badge

Comment thread tests/www/apply/__snapshots__/test_submit.ambr
Comment thread itou/eligibility/models/iae.py
EwenKorr added 8 commits June 20, 2025 16:54
The way they are rendered is a bit different on the job seekers'
dashboard.
This fragment will be used in several places.
So that the criteria list can be flattened independently from who
created the diagnosis.
The GEIQ eligibility diagnoses were ordered in
`authored_by_prescriber_or_geiq`, which is used only in the
`diagnoses_for` method.

In a future commit, the latter will be used without
`authored_by_prescriber_or_geiq`, so we need the ordering to happen in
`diagnoses_for`.
@EwenKorr
EwenKorr force-pushed the deloo/update-job-seeker-dashboard branch from 69b962b to 7400c93 Compare June 20, 2025 14:54
@EwenKorr
EwenKorr added this pull request to the merge queue Jun 23, 2025
Merged via the queue into master with commit f574dfb Jun 23, 2025
@EwenKorr
EwenKorr deleted the deloo/update-job-seeker-dashboard branch June 23, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ajouté Ajouté dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants