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

fix: filtrage des questions en utilisant les étiquettes #794

Merged
merged 10 commits into from
Oct 9, 2024

Conversation

vincentporte
Copy link
Contributor

@vincentporte vincentporte commented Oct 3, 2024

Description

Modifications principales, dans le gabarit lacommunaute/templates/forum_conversation/partials/topic_tags.html

🎸 suppression du paramètre page=1 qui forçait le masquage de la zone de filtre
🎸 appel htmx de TopicListView lors du clic sur les tags, pour éviter tous les inconvénients d'un rechargement de page complet

Petits bonus en passant

🎸 fiabilisation des tests sur les filtres x les étiquettes
🎸 desambiguation des paramètres dans le contexte de la vue TopicListView
🎸 suppression de la gestion d'une liste de Tag dans les url (non terminé), pour n'en gérer plus qu'un seul

Type de changement

🪲 Correction de bug (changement non cassant qui corrige un problème).
🎨 changement d'UI
🚧 technique

Points d'attention

🦺 réécriture des tests concernés dans les commits pour améliorer la lisibilité (voir les passer en style pytest)
🦺 renommage des énums pour une meilleure présentation utilisateur
🦺 réécriture des tests de ForumView à voir ultérieurement selon les impacts de l'issue #765

Captures d'écran (optionnel)

filtrage ALL

image

filtrage ALL x étiquette

image

filtrage NEW

image

filtrage NEW x étiquette

image

filtrage CERTIFIED

image

filtrage CERTIFIED x étiquette

image

@vincentporte vincentporte self-assigned this Oct 3, 2024
@vincentporte vincentporte marked this pull request as ready for review October 7, 2024 14:57
@vincentporte vincentporte added python Pull requests that update Python code technical debt labels Oct 7, 2024
def test_clickable_tags(self, client, db, snapshot):
@pytest.mark.parametrize(
"num_of_topics_before_tagged_topic,query_param,snapshot_name",
[(None, None, "clickable_tags_page1"), (10, "?page=2", "clickable_tags_page2")],
Copy link
Contributor

Choose a reason for hiding this comment

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

Pour te faciliter la vie, tu pourrais définir les query params vide avec "". 🤷

@@ -190,32 +190,26 @@
'''
# ---
# name: TestTopicListView.test_clickable_tags[10-?page=2-clickable_tags_page2][clickable_tags_page2]
'<a class="tag bg-info-lighter text-info" href="/topics/?tag=tag&amp;filter=">tag</a>'
'<button class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="topics" hx-get="/topics/?tag=tag&amp;filter=" hx-push-url="true" hx-swap="outerHTML" hx-target="#topicsarea" id="filtertopics-button">tag</button>'
Copy link
Contributor

Choose a reason for hiding this comment

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

Laisser un a permettrait d’ouvrir les pages dans des onglets.

Copy link
Contributor

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

Les changements fonctionnent bien localement 👍

@vincentporte vincentporte merged commit d03847e into master Oct 9, 2024
13 checks passed
@vincentporte vincentporte deleted the vp/fix_tag_filtering branch October 9, 2024 13:24
vincentporte added a commit that referenced this pull request Oct 9, 2024
🦺 suite #794. fusion avant d'avoir poussé le rebasage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants