Skip to content
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

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

francoisfreitag
Copy link
Contributor

@francoisfreitag francoisfreitag commented Jul 2, 2024

🤔 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

  1. Se connecter en tant qu’employeur EI
  2. Dans la liste des fiches salarié, utiliser le champ « Candidat » : http://localhost:8000/employee_record/list?status=SENT

💻 Captures d'écran

image

Copy link

@francoisfreitag francoisfreitag added this pull request to the merge queue Jul 2, 2024
@francoisfreitag francoisfreitag removed this pull request from the merge queue due to a manual request Jul 2, 2024
@@ -80,10 +80,11 @@ class SelectEmployeeRecordStatusForm(forms.Form):


class EmployeeRecordFilterForm(forms.Form):
job_seekers = forms.MultipleChoiceField(
job_seeker = forms.TypedChoiceField(
Copy link
Contributor

Choose a reason for hiding this comment

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

Pourquoi le TypedChoiceField ?

Copy link
Contributor Author

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).

Copy link
Contributor Author

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. 🙈

Copy link
Contributor

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"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if job_seeker := filters_form.cleaned_data.get("job_seeker"):
if job_seeker_id := filters_form.cleaned_data.get("job_seeker"):

@@ -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"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 :)

Copy link
Contributor Author

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(
Copy link
Contributor

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.
@francoisfreitag francoisfreitag added this pull request to the merge queue Jul 3, 2024
Merged via the queue into master with commit 1e7ca18 Jul 3, 2024
11 checks passed
@francoisfreitag francoisfreitag deleted the ff/select-fs branch July 3, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants