-
Notifications
You must be signed in to change notification settings - Fork 24
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
UX/UI : Limiter la sélection rapide à un candidat dans la liste des fiches salarié [GEN-1687] #4344
Conversation
@@ -80,10 +80,11 @@ class SelectEmployeeRecordStatusForm(forms.Form): | |||
|
|||
|
|||
class EmployeeRecordFilterForm(forms.Form): | |||
job_seekers = forms.MultipleChoiceField( | |||
job_seeker = forms.TypedChoiceField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi le TypedChoiceField ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parce qu’on compare à job_application.job_seeker_id
qui est un entier (car les candidatures ont déjà été chargées en mémoire, je n’ai pas cherché pourquoi de peur de ce que je trouverais).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, c’est pour compter le nombre d’objets dans chaque catégorie pour les badges. 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci pour la vérif :)
@@ -211,9 +211,9 @@ def list_employee_records(request, template_name="employee_record/list.html"): | |||
if status == Status.NEW: | |||
# Browse to get only the linked employee record in "new" state | |||
data = eligible_job_applications | |||
if job_seekers := filters_form.cleaned_data.get("job_seekers"): | |||
if job_seeker := filters_form.cleaned_data.get("job_seeker"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if job_seeker := filters_form.cleaned_data.get("job_seeker"): | |
if job_seeker_id := filters_form.cleaned_data.get("job_seeker"): |
9083b1d
to
fe63256
Compare
@@ -238,8 +238,8 @@ def list_employee_records(request, template_name="employee_record/list.html"): | |||
.filter(status=status) | |||
.order_by(*employee_record_order_by) | |||
) | |||
if job_seekers := filters_form.cleaned_data.get("job_seekers"): | |||
data = data.filter(job_application__job_seeker__in=job_seekers) | |||
if job_seeker := filters_form.cleaned_data.get("job_seeker"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if job_seeker := filters_form.cleaned_data.get("job_seeker"): | |
if job_seeker_id := filters_form.cleaned_data.get("job_seeker"): |
ici aussi du coup :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erf, oui. Merci !
@@ -80,10 +80,11 @@ class SelectEmployeeRecordStatusForm(forms.Form): | |||
|
|||
|
|||
class EmployeeRecordFilterForm(forms.Form): | |||
job_seekers = forms.MultipleChoiceField( | |||
job_seeker = forms.TypedChoiceField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci pour la vérif :)
The select multiple widget is partially broken with the itou-theme. In most places, users actually just want to quickly navigate to a single entry in the list. Simplify the UI and remove bugs by using a TypedChoiceField instead of a MultipleChoiceField.
fe63256
to
c2e49c1
Compare
🤔 Pourquoi ?
Le thème casse partiellement le MultipleChoiceField, utilisons plutôt le composant de sélection d’un seul élément.
Dans tous les cas, les utilisateurs utilisent le widget pour accéder rapidement à un candidat, et non pour limiter les éléments présents dans la liste à un ensemble de candidats.
🏝️ Comment tester
💻 Captures d'écran