Skip to content

Candidature: conserver le mode d'affichage (Tableau/Liste) quand on efface tous les filtres#5435

Merged
xavfernandez merged 2 commits into
masterfrom
xfernandez/fix_reset_filter_button
Jan 23, 2025
Merged

Candidature: conserver le mode d'affichage (Tableau/Liste) quand on efface tous les filtres#5435
xavfernandez merged 2 commits into
masterfrom
xfernandez/fix_reset_filter_button

Conversation

@xavfernandez

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Actuellement, quand on se met en mode tableau et qu'on ajoute des filtres (ou dans l'autre sens), si on enlève ensuite les filtres avec le bouton "Effacer tout", on est rebasculé en mode liste.

Pas trop d'idée de test par contre...

🍰 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 ?

🏝️ 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 modifié Modifié dans le changelog. bug labels Jan 21, 2025
@xavfernandez xavfernandez self-assigned this Jan 21, 2025

@tonial tonial 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.

Tu pourrais vérifier que le lien de reset contient ce query param ?

When removing all filter from table view, users expect to stay in table
view.
@xavfernandez xavfernandez force-pushed the xfernandez/fix_reset_filter_button branch from e83ace4 to cd4a256 Compare January 23, 2025 09:29
@xavfernandez

Copy link
Copy Markdown
Contributor Author

J'ai snapshoté :)

@xavfernandez xavfernandez added this pull request to the merge queue Jan 23, 2025
Merged via the queue into master with commit 93f028b Jan 23, 2025
@xavfernandez xavfernandez deleted the xfernandez/fix_reset_filter_button branch January 23, 2025 11:40
<div class="ms-md-auto" id="apply-list-filter-counter"{% if request.htmx %} hx-swap-oob="true"{% endif %}>
{% if filters_counter > 0 %}
<a href="{{ reset_url }}" class="btn btn-ico btn-dropdown-filter" aria-label="Réinitialiser {{ filters_counter|pluralizefr:"le filtre actif,les filtres actifs" }}">
<a href="{{ reset_url }}?display={{ display_kind }}" class="btn btn-ico btn-dropdown-filter" aria-label="Réinitialiser {{ filters_counter|pluralizefr:"le filtre actif,les filtres actifs" }}">

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.

Pourquoi ne pas avoir utilisé un URL dédié ?

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.

Avec un {% url_add_query list_url display=display_kind as reset_url %} ?

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.

Non, je pensais changer directement le path plutôt qu’un query param. Ça permet de retenir la vue en cours sans tricher.

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.

Ah oui, mais c'est plus impactant cela 😅 .
Avec la vue tableau qui va passer par défaut (et du coup la vue liste qui serait en sursis ?), je ne vais pas me précipiter 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants