Skip to content

Candidature: ajout du tri sur les listes de candidatures [GEN-2248]#5649

Merged
xavfernandez merged 2 commits into
masterfrom
xfernandez/sort_applications
Mar 4, 2025
Merged

Candidature: ajout du tri sur les listes de candidatures [GEN-2248]#5649
xavfernandez merged 2 commits into
masterfrom
xfernandez/sort_applications

Conversation

@xavfernandez
Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Car c'est pratique.

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À 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

@xavfernandez xavfernandez added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC modifié Modifié dans le changelog. labels Feb 19, 2025
@xavfernandez xavfernandez self-assigned this Feb 19, 2025
@xavfernandez xavfernandez marked this pull request as draft February 19, 2025 08:37
@github-actions
Copy link
Copy Markdown

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

@xavfernandez xavfernandez added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC and removed 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC labels Feb 19, 2025
@xavfernandez xavfernandez force-pushed the xfernandez/sort_applications branch from 3bd7f3b to 39ee187 Compare February 19, 2025 13:45
@xavfernandez xavfernandez added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Feb 19, 2025
@github-actions
Copy link
Copy Markdown

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

@xavfernandez xavfernandez force-pushed the xfernandez/sort_applications branch 16 times, most recently from 68810c6 to 857e5e2 Compare February 21, 2025 16:40
@xavfernandez xavfernandez marked this pull request as ready for review February 21, 2025 16:40
@xavfernandez xavfernandez changed the title Candidature: ajout du tri sur les listes de candidatures Candidature: ajout du tri sur les listes de candidatures [GEN-2248] Feb 21, 2025
@notion-workspace
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@EwenKorr EwenKorr left a comment

Choose a reason for hiding this comment

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

Ça me paraît bien rôdé comme affaire ! 👍

Comment on lines +163 to +166
job_applications = job_applications.annotate(
job_seeker_full_name=Concat(Lower("job_seeker__first_name"), Value(" "), Lower("job_seeker__last_name"))
).order_by(*order.order_by)

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 priori le annotate() est inutile pour list_for_job_seeker, non ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On pourrait faire une autre enum de tri sans le nom et prénom du candidat, ou désactiver ce critère de tri pour les candidats. Mais ça n’en vaut probablement pas la complexité.

Copy link
Copy Markdown
Member

@francoisfreitag francoisfreitag Feb 27, 2025

Choose a reason for hiding this comment

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

En relisant les tests, comme on ajoute PK pour stabiliser l’ordre, le candidat peut trier par date d’émission en utilisant la colonne nom 😛

Comment thread itou/static/js/utils.js Outdated
if (Array.from(form.elements).some((input) => input.name == checkBoxInputName && input.checked)) {
document.querySelectorAll(`[${attribute}="hidden"]`).forEach((element) => element.classList.add("d-none"))
document.querySelectorAll(`[${attribute}="shown"]`).forEach((element) => element.classList.remove("d-none"))
document.querySelectorAll(`[${attribute}="disabled"]`).forEach((element) => element.setAttribute("disabled", ""))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Au lieu de passer par des attributs, pourquoi ne pas:

diff --git a/itou/static/js/utils.js b/itou/static/js/utils.js
index 436035a8a..6cb575a3e 100644
--- a/itou/static/js/utils.js
+++ b/itou/static/js/utils.js
@@ -214,11 +214,11 @@ htmx.onLoad((target) => {
       if (Array.from(form.elements).some((input) => input.name == checkBoxInputName && input.checked)) {
         document.querySelectorAll(`[${attribute}="hidden"]`).forEach((element) => element.classList.add("d-none"))
         document.querySelectorAll(`[${attribute}="shown"]`).forEach((element) => element.classList.remove("d-none"))
-        document.querySelectorAll(`[${attribute}="disabled"]`).forEach((element) => element.setAttribute("disabled", ""))
+        document.querySelectorAll(`[${attribute}="disabled"]`).forEach((element) => { element.disabled = true; })
       } else {
         document.querySelectorAll(`[${attribute}="shown"]`).forEach((element) => element.classList.add("d-none"))
         document.querySelectorAll(`[${attribute}="hidden"]`).forEach((element) => element.classList.remove("d-none"))
-        document.querySelectorAll(`[${attribute}="disabled"]`).forEach((element) => element.removeAttribute("disabled"))
+        document.querySelectorAll(`[${attribute}="disabled"]`).forEach((element) => { element.disabled = false; })
       }
     })
   })

Comment thread itou/templates/common/tables/th_with_sort.html Outdated
Comment on lines +163 to +166
job_applications = job_applications.annotate(
job_seeker_full_name=Concat(Lower("job_seeker__first_name"), Value(" "), Lower("job_seeker__last_name"))
).order_by(*order.order_by)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

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

Le code de js: improve data-emplois-elements-visibility-on-selection mechanism est mort, jusqu’à l’introduction du 3ème commit. Je l’aurais fusionné avec le 3ème commit.

@xavfernandez xavfernandez force-pushed the xfernandez/sort_applications branch from 857e5e2 to b886772 Compare March 4, 2025 14:37
And improve data-emplois-elements-visibility-on-selection mechanism to
allow disabling elements
@xavfernandez xavfernandez force-pushed the xfernandez/sort_applications branch from f9d28ef to 6ead9fc Compare March 4, 2025 16:29
@xavfernandez xavfernandez enabled auto-merge March 4, 2025 16:29
@xavfernandez xavfernandez added this pull request to the merge queue Mar 4, 2025
Merged via the queue into master with commit 01aae4f Mar 4, 2025
@xavfernandez xavfernandez deleted the xfernandez/sort_applications branch March 4, 2025 16:46
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 modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants