-
Notifications
You must be signed in to change notification settings - Fork 51
Feat/resultats_pesticides #179
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
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughLes identifiants des catégories et sous-catégories liées aux pesticides dans Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant polluants.ts
UI->>polluants.ts: Demande les catégories disponibles
polluants.ts-->>UI: Retourne availableCategories avec nouveaux IDs, statuts et labels mis à jour
Possibly related PRs
Suggested labels
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (2)
webapp/lib/polluants.ts (2)
324-368
:⚠️ Potential issueCouleurs du statut “non_recherche” : accessibilité couleur/fond identiques
couleur
etcouleurFond
sont tous deux#9B9B9B
. Sur fond gris identique le texte deviendra illisible (contraste WCAG < 1). Utilisez au moins un contraste 4.5:1 pour le texte.
Ex. : texte#313131
, fond#9B9B9B
.
195-206
: 💡 Verification agent🧩 Analysis chain
Changement d’ID potentiellement breaking : prévoir une compatibilité ascendante
Le passage deid: "pesticides"
àid: "pesticide"
risque de casser tout code, config ou données (ex. filtres d’API, routes Next.js, stockage local) qui s’appuient déjà sur l’ancien identifiant.
Pensez à :+// alias temporaire pour conserver la compatibilité +{ id: "pesticides", redirectTo: "pesticide" } // ou mapping dans getCategoryById()Ou, a minima, ajoutez un test d’intégration/CI pour attraper les régressions.
Pour bien évaluer le risque de rupture suite à la renumérotation de l’ID, identifions d’abord toutes les références à l’ID
"pesticides"
dans le code (constantes, tests, routes, etc.). Merci de lancer le script suivant :
🏁 Script executed:
#!/bin/bash # Recherche de l'ID "pesticides" dans tout le code rg 'id:\s*"pesticides"' -n . rg '"pesticides"' -n . # Recherche des usages potentiels de getCategoryById rg 'getCategoryById' -n -A2 .Length of output: 3006
Prévoir une compatibilité ascendante pour l’ID “pesticide”
Le passage de l’ID de
"pesticides"
à"pesticide"
va casser :
- le fixture/mock-data (
webapp/app/lib/mock-data.ts:213
contient encorecategorie_id: "pesticides"
)- toute logique ou test qui consommait l’ancien ID
Merci de :
- Ajouter un alias/mapping dans
getCategoryById()
avant la recherche, par exemple :const normalizedId = id === "pesticides" ? "pesticide" : id; // puis rechercher avec normalizedId- Mettre à jour ou remplacer les références dans le mock-data (
"pesticides"
→"pesticide"
)- Ajouter un test d’intégration/CI qui couvre à la fois l’ancien et le nouveau ID pour éviter les régressions
🧹 Nitpick comments (2)
webapp/lib/polluants.ts (2)
207-239
: Incohérence de clés dansresultats
par rapport à la catégorie “tous”
Vous avez bien harmonisé les clés pesticides ↔ PFAS, mais la catégorie “tous” conserveinf_limites
alors que vous introduisezinf_limite_qualite
ici. Si ces clés sont consommées par le même composant d’affichage, il va falloir gérer deux chemins distincts ou refactoriser “tous” pour rester aligné.
259-304
: Dupliquer la logique de renommage sans factorisation
Les mêmes clés (non_recherche
,inf_limite_qualite
,sup_limite_qualite
,sup_valeur_sanitaire
) se répètent entre la catégorie parente et la sous-catégorie. À moyen terme, envisagez une factory ou une fonction d’héritage pour éviter la duplication de configuration et réduire les risques d’incohérence sur les couleurs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (15)
dbt_/models/intermediate/int__union_resultats_udi.sql
is excluded by none and included by nonedbt_/models/intermediate/pesticide/_int__pesticide_models.yml
is excluded by none and included by nonedbt_/models/intermediate/pesticide/int__resultats_pesticide_udi_dernier.sql
is excluded by none and included by nonedbt_/models/intermediate/pesticide/metabolite/_int__metabolite_models.yml
is excluded by none and included by nonedbt_/models/intermediate/pesticide/metabolite/int__resultats_metabolite_udi_dernier.sql
is excluded by none and included by nonedbt_/models/intermediate/pesticide/metabolite_specifique/_int__metabolite_specifique_models.yml
is excluded by none and included by nonedbt_/models/intermediate/pesticide/metabolite_specifique/int__resultats_metabolite_specifique_commune_dernier.sql
is excluded by none and included by nonedbt_/models/intermediate/pesticide/metabolite_specifique/int__resultats_metabolite_specifique_udi_dernier.sql
is excluded by none and included by nonedbt_/models/intermediate/pesticide/sub_active/_int__sub_active_models.yml
is excluded by none and included by nonedbt_/models/intermediate/pesticide/sub_active/int__resultats_sub_active_udi_dernier.sql
is excluded by none and included by nonedbt_/models/website/_web__models.yml
is excluded by none and included by nonedbt_/models/website/web__resultats_udi.sql
is excluded by none and included by nonedbt_/tests/test_metabolite_results.sql
is excluded by none and included by nonedbt_/tests/test_pesticide_results.sql
is excluded by none and included by nonedbt_/tests/test_sub_active_results.sql
is excluded by none and included by none
📒 Files selected for processing (1)
webapp/lib/polluants.ts
(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pre-commit
- GitHub Check: test
- GitHub Check: Next.js Lint
No description provided.