-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tags): afficher les filtres sur les tags (#752)
gi## Description 🎸 Afficher les filtres sur les `tags` des `Forum` enfants (`descendants`) 🎸 Mettre à jour la liste des `Forum` enfants par une vue `ListView` HTMX 🎸 Seuls les `tags` associés aux `Forum` enfant sont affichés 🎸 Le filtrage n'est possible que sur un seul `tag` à la fois. 🦺 suite des PR #746 #750 #751 ## Type de changement 🎢 Nouvelle fonctionnalité (changement non cassant qui ajoute une fonctionnalité). ### Points d'attention 🦺 choix d'une vue indépendante pour éviter la surcharge de `ForumView`. Conséquence, ne permet pas la mise à jour dynamique de l'url avec le paramètre `hx-push` 🦺 mise à jour de `parse_response_to_soup` : gestion de `hx-get` en plus de `hx-post` et `href` 🦺 mise à jour de la command `populate` : ajout de tags aux `Forum` générés 🦺 suppression du template `partials/tag.html`, mutualisation inutile avec l'affichage des `tags` des `Topics`⚠️ #750 installait la capacité de la vue à recevoir plusieurs tags en paramètre de la requete. cette capacité est retirée ici car non utilisable par l'UI ### Captures d'écran (optionnel) Categorie avec fiches sans tag ![image](https://github.com/user-attachments/assets/cc96b706-0235-41e9-8755-8657543c794e) Categorie avec fiches taggées non filtrées ![image](https://github.com/user-attachments/assets/af981989-dcbb-4f90-b76f-2a6dcaeeebc8) Categorie avec fiches taggées filtrées ![image](https://github.com/user-attachments/assets/b8eabf50-c861-472b-a690-7cb4fff34614)
- Loading branch information
1 parent
91bea96
commit 7a10488
Showing
17 changed files
with
489 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175 changes: 175 additions & 0 deletions
175
lacommunaute/forum/tests/__snapshots__/test_subcategoryforum_listview.ambr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
# serializer version: 1 | ||
# name: test_listview_filtering[subcategoryforum_listview_filtering_on_existing_tag] | ||
''' | ||
<html><head></head><body><div class="container-fluid" id="subforums_area"> | ||
|
||
<div class="c-box"> | ||
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div> | ||
<div class="container-fluid d-flex justify-content-center"> | ||
|
||
|
||
|
||
<button aria-label="Supprimer ce filtre" class="tag bg-info text-white matomo-event" data-bs-placement="top" data-bs-title="Supprimer ce filtre" data-bs-toggle="tooltip" data-matomo-action="unfilter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-jazz"> | ||
<i class="ri-close-fill ri-xs"></i>Jazz | ||
</button> | ||
|
||
|
||
|
||
|
||
|
||
<button aria-label="Filtrer par Blues" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/?forum_tag=blues" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-blues">Blues</button> | ||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
|
||
<div class="row mt-4" id="documentation-category-subforums"> | ||
|
||
<div class="col-12 col-md-4 mb-3 mb-md-5"> | ||
<div class="card c-card has-one-link-inside h-100"> | ||
|
||
<div class="card-header card-header-thumbnail rounded"> | ||
<img alt="Ella Fitzgerald" class="img-fitcover img-fluid" loading="lazy" src="[img src]"/> | ||
</div> | ||
|
||
<div class="card-body pb-0"> | ||
<p class="h3 lh-base">Ella Fitzgerald</p> | ||
<div> | ||
|
||
<span class="tag bg-info-lighter text-info">Jazz</span> | ||
|
||
|
||
|
||
<span class="tag bg-info-lighter text-info">Blues</span> | ||
|
||
|
||
</div> | ||
<div class="mt-3">Test description</div> | ||
</div> | ||
<div class="card-footer text-end"> | ||
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="fiches_techniques" href="/forum/ella-fitzgerald-[PK of Forum]/"> | ||
<i class="ri-arrow-right-line ri-lg"></i> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</body></html> | ||
''' | ||
# --- | ||
# name: test_listview_filtering[subcategoryforum_listview_filtering_on_non_existing_tag] | ||
''' | ||
<html><head></head><body><div class="container-fluid" id="subforums_area"> | ||
|
||
<div class="c-box"> | ||
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div> | ||
<div class="container-fluid d-flex justify-content-center"> | ||
|
||
|
||
|
||
<button aria-label="Filtrer par Jazz" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/?forum_tag=jazz" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-jazz">Jazz</button> | ||
|
||
|
||
|
||
|
||
|
||
<button aria-label="Filtrer par Blues" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/?forum_tag=blues" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-blues">Blues</button> | ||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
|
||
<div class="row mt-4" id="documentation-category-subforums"> | ||
|
||
</div> | ||
</div> | ||
</body></html> | ||
''' | ||
# --- | ||
# name: test_listview_filtering[subcategoryforum_listview_without_filter] | ||
''' | ||
<html><head></head><body><div class="container-fluid" id="subforums_area"> | ||
|
||
<div class="c-box"> | ||
<div class="container-fluid d-flex justify-content-center mb-3">Afficher les fiches contenant l'étiquette</div> | ||
<div class="container-fluid d-flex justify-content-center"> | ||
|
||
|
||
|
||
<button aria-label="Filtrer par Jazz" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/?forum_tag=jazz" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-jazz">Jazz</button> | ||
|
||
|
||
|
||
|
||
|
||
<button aria-label="Filtrer par Blues" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="forum" hx-get="/forum/category-forum-[PK of Forum]/subs/?forum_tag=blues" hx-swap="outerHTML" hx-target="#subforums_area" id="filterforum-blues">Blues</button> | ||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
|
||
<div class="row mt-4" id="documentation-category-subforums"> | ||
|
||
<div class="col-12 col-md-4 mb-3 mb-md-5"> | ||
<div class="card c-card has-one-link-inside h-100"> | ||
|
||
<div class="card-header card-header-thumbnail rounded"> | ||
<img alt="Ella Fitzgerald" class="img-fitcover img-fluid" loading="lazy" src="[img src]"/> | ||
</div> | ||
|
||
<div class="card-body pb-0"> | ||
<p class="h3 lh-base">Ella Fitzgerald</p> | ||
<div> | ||
|
||
<span class="tag bg-info-lighter text-info">Jazz</span> | ||
|
||
|
||
|
||
<span class="tag bg-info-lighter text-info">Blues</span> | ||
|
||
|
||
</div> | ||
<div class="mt-3">Test description</div> | ||
</div> | ||
<div class="card-footer text-end"> | ||
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="fiches_techniques" href="/forum/ella-fitzgerald-[PK of Forum]/"> | ||
<i class="ri-arrow-right-line ri-lg"></i> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-12 col-md-4 mb-3 mb-md-5"> | ||
<div class="card c-card has-one-link-inside h-100"> | ||
|
||
<div class="card-header card-header-thumbnail rounded"> | ||
<img alt="Mayra Andrade" class="img-fitcover img-fluid" loading="lazy" src="[img src]"/> | ||
</div> | ||
|
||
<div class="card-body pb-0"> | ||
<p class="h3 lh-base">Mayra Andrade</p> | ||
<div> | ||
</div> | ||
<div class="mt-3">Test description</div> | ||
</div> | ||
<div class="card-footer text-end"> | ||
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="fiches_techniques" href="/forum/mayra-andrade-[PK of Forum]/"> | ||
<i class="ri-arrow-right-line ri-lg"></i> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</body></html> | ||
''' | ||
# --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.