refactor(turbo): champ carte use turbo

This commit is contained in:
Paul Chavard 2022-05-03 19:43:25 +02:00
parent 1500a1cf28
commit 1c2bd5543f
5 changed files with 10 additions and 14 deletions

View file

@ -1,9 +0,0 @@
<%= render_flash(timeout: 5000, fixed: true) %>
<%= render_to_element("##{@champ.input_group_id} .geo-areas",
partial: 'shared/champs/carte/geo_areas',
locals: { champ: @champ, editing: true }) %>
<% if @focus %>
<%= fire_event('map:feature:focus', { bbox: @champ.bounding_box }.to_json) %>
<% end %>

View file

@ -0,0 +1,4 @@
= turbo_stream.update dom_id(@champ, :geo_areas), partial: 'shared/champs/carte/geo_areas', locals: { champ: @champ, editing: true }
- if @focus
= turbo_stream.dispatch 'map:feature:focus', bbox: @champ.bounding_box

View file

@ -1,4 +1,4 @@
= react_component("MapEditor", featureCollection: champ.to_feature_collection, url: champs_carte_features_path(champ), options: champ.render_options)
.geo-areas
.geo-areas{ id: dom_id(champ, :geo_areas) }
= render partial: 'shared/champs/carte/geo_areas', locals: { champ: champ, editing: true }