From 035e6b7ac3c29b1bf1c3e41ea524d3a3a01baabd Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Thu, 16 Apr 2026 11:13:08 +0200 Subject: [PATCH] Formatage prettier (reformatage automatique) --- ...21-observatoire-full-url-sharing-design.md | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/superpowers/specs/2026-03-21-observatoire-full-url-sharing-design.md b/docs/superpowers/specs/2026-03-21-observatoire-full-url-sharing-design.md index 9f910df..887bd9e 100644 --- a/docs/superpowers/specs/2026-03-21-observatoire-full-url-sharing-design.md +++ b/docs/superpowers/specs/2026-03-21-observatoire-full-url-sharing-design.md @@ -14,27 +14,28 @@ 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` | -| `dashboard_acheteur_departement_code` | `acheteur_dept` | multi | `[]`/`None` | -| `dashboard_titulaire_id` | `titulaire_id` | single | `None` | -| `dashboard_titulaire_categorie` | `titulaire_cat` | single | `None` | -| `dashboard_titulaire_departement_code` | `titulaire_dept` | multi | `[]`/`None` | -| `dashboard_marche_type` | `type` | single | `None` | -| `dashboard_marche_objet` | `objet` | single | `None` | -| `dashboard_marche_code_cpv` | `cpv` | single | `None` | -| `dashboard_montant_min` | `montant_min` | single (number) | `None` | -| `dashboard_montant_max` | `montant_max` | single (number) | `None` | -| `dashboard_marche_techniques` | `techniques` | multi | `[]`/`None` | -| `dashboard_marche_innovant` | `innovant` | single | `"all"` | -| `dashboard_marche_sousTraitanceDeclaree` | `sous_traitance` | single | `"all"` | -| `dashboard_marche_considerationsSociales` | `social` | multi | `[]`/`None` | -| `dashboard_marche_considerationsEnvironnementales` | `env` | multi | `[]`/`None` | +| 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` | +| `dashboard_acheteur_departement_code` | `acheteur_dept` | multi | `[]`/`None` | +| `dashboard_titulaire_id` | `titulaire_id` | single | `None` | +| `dashboard_titulaire_categorie` | `titulaire_cat` | single | `None` | +| `dashboard_titulaire_departement_code` | `titulaire_dept` | multi | `[]`/`None` | +| `dashboard_marche_type` | `type` | single | `None` | +| `dashboard_marche_objet` | `objet` | single | `None` | +| `dashboard_marche_code_cpv` | `cpv` | single | `None` | +| `dashboard_montant_min` | `montant_min` | single (number) | `None` | +| `dashboard_montant_max` | `montant_max` | single (number) | `None` | +| `dashboard_marche_techniques` | `techniques` | multi | `[]`/`None` | +| `dashboard_marche_innovant` | `innovant` | single | `"all"` | +| `dashboard_marche_sousTraitanceDeclaree` | `sous_traitance` | single | `"all"` | +| `dashboard_marche_considerationsSociales` | `social` | multi | `[]`/`None` | +| `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=&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"