Formatage prettier (reformatage automatique)

This commit is contained in:
Colin Maudry
2026-04-16 11:13:08 +02:00
parent 71f21b733f
commit 035e6b7ac3
@@ -15,7 +15,7 @@ Flat query parameters with short, readable keys. Multi-value filters use repeate
## URL Parameter Mapping
| Component ID | URL key | Type | Default (omitted) |
|---|---|---|---|
| -------------------------------------------------- | ---------------- | --------------- | ----------------- |
| `dashboard_year` | `annee` | single | `None` |
| `dashboard_acheteur_id` | `acheteur_id` | single | `None` |
| `dashboard_acheteur_categorie` | `acheteur_cat` | single | `None` |
@@ -35,6 +35,7 @@ Flat query parameters with short, readable keys. Multi-value filters use repeate
| `dashboard_marche_considerationsEnvironnementales` | `env` | multi | `[]`/`None` |
Example URL:
```
/observatoire?annee=2024&acheteur_id=12345678901234&acheteur_dept=75&acheteur_dept=13&montant_min=10000&innovant=oui
```
@@ -79,6 +80,7 @@ FILTER_PARAMS = [
**Current:** Extracts only `acheteur_id` and `titulaire_id` from URL.
**New:**
- Iterates over `FILTER_PARAMS` to extract all values from `parse_qs`
- For multi-value params: reads the full list from `parse_qs` (returns lists natively)
- For number params (`montant_min`, `montant_max`): casts to `float`
@@ -102,12 +104,14 @@ Links generated by `add_links()` in `src/utils.py` (used on search results to li
### Fix broken test `test_010_observatoire_montant_filter`
This test imports `_apply_filters` from `pages.observatoire`, which no longer exists (replaced by `prepare_dashboard_data` in `src/utils.py`). Fix:
- Replace import with `from src.utils import prepare_dashboard_data`
- Update the call to match `prepare_dashboard_data`'s signature: rename `marche_type` keyword to `type`, and add missing params `objet`, `code_cpv`, `techniques`, `marche_innovant`, `sous_traitance_declaree` (all as `None`)
### New test: multi-param URL round-trip
Add a test that navigates to `/observatoire?annee=2024&acheteur_id=<test_id>&montant_min=10000` and verifies that:
- `dashboard_year` dropdown shows "2024"
- `dashboard_acheteur_id` input contains the test ID
- `dashboard_montant_min` input contains "10000"