Skip to content

Prescripteur : ajout de filtres dans l'espace Mes candidats [GEN-137] - #5670

Merged
EwenKorr merged 6 commits into
masterfrom
ewen/job_seekers_filter
Mar 14, 2025
Merged

Prescripteur : ajout de filtres dans l'espace Mes candidats [GEN-137]#5670
EwenKorr merged 6 commits into
masterfrom
ewen/job_seekers_filter

Conversation

@EwenKorr

@EwenKorr EwenKorr commented Feb 21, 2025

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

L'espace Mes candidats peut être très rempli, utiliser des filtres permet de s'y retrouver :

  • filtre sur le statut de l'éligibilité et du PASS IAE
  • dans le cas d'un prescripteur membre d'une organisation : filtre sur le prescripteur qui a créé le compte ou la candidature

🍰 Comment ?

Cette PR a phagocyté une première PR (#5661, l'ajout des onglets) car il est préférable pour les utilisateurs d'apporter les changements en une fois.

Pour faciliter la relecture, les filtres sont ajoutés en deux étapes :

  1. les filtres sur la situation IAE
  2. le filtre sur les collaborateurs/membres de l'organisation (précédé d'un commit ajoutant le panneau latéral)

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

🏝️ Comment tester ?

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

@EwenKorr EwenKorr added the ajouté Ajouté dans le changelog. label Feb 21, 2025
@EwenKorr EwenKorr self-assigned this Feb 21, 2025
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 6 times, most recently from b181f8f to f4816dc Compare March 6, 2025 07:55
@EwenKorr

EwenKorr commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

Deux premiers commits validés ici : #5661
(finalement on fusionne tout en même temps, c'est mieux pour le métier et les utilisateurs)

@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 7 times, most recently from 9053e5e to d743061 Compare March 7, 2025 16:06
@EwenKorr EwenKorr added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Mar 7, 2025
@github-actions

github-actions Bot commented Mar 7, 2025

Copy link
Copy Markdown

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

@EwenKorr EwenKorr removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Mar 7, 2025
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from d743061 to d2c9b44 Compare March 7, 2025 16:37
@EwenKorr EwenKorr added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Mar 10, 2025
@github-actions

Copy link
Copy Markdown

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

@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 4 times, most recently from 532971e to 3329829 Compare March 10, 2025 14:09
Comment thread itou/users/models.py Outdated
Comment thread itou/www/job_seekers_views/forms.py Outdated
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from 3329829 to 795be77 Compare March 10, 2025 14:33
Comment thread itou/templates/job_seekers_views/includes/job_seekers_filters/top_filters.html Outdated
@@ -0,0 +1,19 @@

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

J'introduis ce nouveau bout d'HTML à inclure pour le data-sync-with.

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 crois qu'on met un prefix -emplois dans les data (data-emplois-sync-with). pour différencier des data-bs-* (data de bootstrap) et data-it-* (data du thème). C'est ça la règle @xavfernandez non ?

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.

C'est ça la règle mais peu de code a déjà été migré :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Je me note ça pour une autre PR, ça va toucher les candidatures et le bout de JS aussi

target.querySelectorAll("input[data-sync-with]").forEach((syncedInputOrigin) => {

@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 2 times, most recently from ca20948 to c472bfb Compare March 11, 2025 16:07
@xavfernandez

Copy link
Copy Markdown
Contributor

Je suis moyennement d'accord avec le commit job_seekers_views: display orga tab only for multi-member organizations.
Un prescripteur peut se retrouver seul après le départ d'un collègue et si on cache le second onglet, il n'aura pas accès aux candidats de son ancien collègue.

@EwenKorr

Copy link
Copy Markdown
Contributor Author

Je suis moyennement d'accord avec le commit job_seekers_views: display orga tab only for multi-member organizations. Un prescripteur peut se retrouver seul après le départ d'un collègue et si on cache le second onglet, il n'aura pas accès aux candidats de son ancien collègue.

Normalement s'il y a des anciens membres (membership.is_active=False), on affiche quand même les onglets et on peut filtrer avec cet ancien collègue.

Je vais rajouter un test pour vérifier ce cas-là.

@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 4 times, most recently from 33ae9c5 to cf9a516 Compare March 13, 2025 09:23
@EwenKorr

Copy link
Copy Markdown
Contributor Author

Normalement s'il y a des anciens membres (membership.is_active=False), on affiche quand même les onglets et on peut filtrer avec cet ancien collègue.

Je vais rajouter un test pour vérifier ce cas-là.

C'est fait (cf9a516), et testable sur la recette : https://c1-review-ewen-job-seekers-filter.cleverapps.io/job-seekers/list-organization
J'ai viré tout le monde de l'orga sauf l'admin (compte prescripteur habilité).

@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from cf9a516 to 4ead969 Compare March 13, 2025 09:35
In order to populate the "Mes candidats" list page.
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch 2 times, most recently from adbd407 to b5e16e2 Compare March 13, 2025 15:03
@EwenKorr

Copy link
Copy Markdown
Contributor Author

Une dernière relecture si tu as le temps @xavfernandez ? 😇

@xavfernandez

Copy link
Copy Markdown
Contributor

Le commit "tests: fix a flaky test due to a banner shown in some departments" peut être squasher dans le commit précédent qui introduit la flakiness :)

Will be shown on the former only job seekers created by the
current user, or for whom the current user has applied.

Will be shown on the latter job seekers created by the organization,
including the current user, or for whom the members of the organization
have applied.
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from b5e16e2 to 81ab618 Compare March 13, 2025 15:44
Comment thread itou/templates/job_seekers_views/includes/job_seekers_filters/offcanvas_body.html Outdated
Comment thread itou/templates/job_seekers_views/includes/job_seekers_filters/top_filters.html Outdated
Comment thread tests/www/job_seekers_views/test_list.py Outdated
Comment thread itou/templates/job_seekers_views/list.html Outdated
- job seeker's eligibility diagnosis (IAE only)
- job seeker's approval
Comment thread tests/www/job_seekers_views/test_list.py
Comment thread itou/www/job_seekers_views/views.py Outdated
Comment thread itou/www/job_seekers_views/forms.py Outdated
Get members of the current user's organization, present or past,
that created or applied for a job seeker.
"""
created_by_id = [job_seeker.created_by_id for job_seeker in job_seeker_qs]

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.

Suggested change
created_by_id = [job_seeker.created_by_id for job_seeker in job_seeker_qs]
created_by_id = [job_seeker.created_by_id for job_seeker in job_seeker_qs if job_seeker.created_by_id]

et je pense que ça permet de se débarasser du - set([None]) en dessous.

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 au passage, vu qu'on veut un set, autant le créer directement: {job_seeker.created_by_id for job_seeker in job_seeker_qs if job_seeker.created_by_id}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Je me demandais si utiliser set ne serait pas plus performant, mais la différence ne doit pas casser des briques.

As the organization members filter is more complex and uses the
Select2MultipleWidget, we set up a lateral pane.
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from 81ab618 to 40fff75 Compare March 13, 2025 16:26
Filter job seekers created by selected organization members or for whom
the selected members have applied for.
It does not make sense displaying the "Tous les candidats de ma
structure" tab when being the only member of the structure.
@EwenKorr
EwenKorr force-pushed the ewen/job_seekers_filter branch from 40fff75 to 6815bae Compare March 13, 2025 16:29
@EwenKorr
EwenKorr added this pull request to the merge queue Mar 14, 2025
Merged via the queue into master with commit 3c22b4a Mar 14, 2025
@EwenKorr
EwenKorr deleted the ewen/job_seekers_filter branch March 14, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants