MTES-MCT / dialog

Intégration de la réglementation de circulation dans les solutions numériques
https://dialog.beta.gouv.fr
GNU Affero General Public License v3.0
8 stars 0 forks source link

Fix json encoding #806

Closed mmarchois closed 3 weeks ago

mmarchois commented 3 weeks ago

Cette PR permet de formater correctement le JSON qui est utilisé par la map.

Avant :

<turbo-stream action="update" target="locations_as_geojson">
  <template>
    {&quot;type&quot;:&quot;FeatureCollection&quot;,&quot;features&quot;:[{&quot;type&quot;:&quot;Feature&quot;,&quot;geometry&quot;:{&quot;type&quot;:&quot;MultiLineString&quot;,&quot;coordinates&quot;:[[[2.34941313,48.904575394],[2.348095478,48.905107817]],[[2.348095478,48.905107817],[2.347268658,48.905443254]],[[2.345377814,48.906206343],[2.34496091,48.90637943],[2.344158604,48.906714979]],[[2.345416213,48.906190365],[2.345377814,48.906206343]],[[2.347268658,48.905443254],[2.346126485,48.905903767]],[[2.346126485,48.905903767],[2.345416213,48.906190365]]]},&quot;properties&quot;:{&quot;location_uuid&quot;:&quot;018fbf49-7216-7782-ba48-c81c0545c609&quot;,&quot;measure_type&quot;:&quot;noEntry&quot;}}]}
  </template>
</turbo-stream>

Après :

<turbo-stream action="update" target="locations_as_geojson">
  <template>
    {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"MultiLineString","coordinates":[[[2.34941313,48.904575394],[2.348095478,48.905107817]],[[2.348095478,48.905107817],[2.347268658,48.905443254]],[[2.345377814,48.906206343],[2.34496091,48.90637943],[2.344158604,48.906714979]],[[2.345416213,48.906190365],[2.345377814,48.906206343]],[[2.347268658,48.905443254],[2.346126485,48.905903767]],[[2.346126485,48.905903767],[2.345416213,48.906190365]]]},"properties":{"location_uuid":"018fbf49-7216-7782-ba48-c81c0545c609","measure_type":"noEntry"}}]}
  </template>
</turbo-stream>
codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.10%. Comparing base (d7ca5f1) to head (405b921). Report is 1 commits behind head on main.

:exclamation: Current head 405b921 differs from pull request most recent head 49f07ae

Please upload reports for the commit 49f07ae to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #806 +/- ## ========================================= Coverage 99.10% 99.10% Complexity 1165 1165 ========================================= Files 218 218 Lines 4929 4929 ========================================= Hits 4885 4885 Misses 44 44 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.