fix(carto): include champ carto modifications in fork diff and show submit button

This commit is contained in:
Paul Chavard 2023-06-06 11:28:10 +02:00
parent b4cd367551
commit eac0e22c54
2 changed files with 9 additions and 1 deletions

View file

@ -39,6 +39,7 @@ class Champs::CarteController < ApplicationController
def destroy
champ = policy_scope(Champ).find(params[:champ_id])
champ.geo_areas.find(params[:id]).destroy!
champ.touch
head :no_content
end
@ -80,6 +81,9 @@ class Champs::CarteController < ApplicationController
if feature[:properties]
geo_area.properties.merge!(feature[:properties])
end
geo_area.save
if geo_area.save
geo_area.champ.touch
true
end
end
end

View file

@ -2,3 +2,7 @@
- if @focus
= turbo_stream.dispatch 'map:feature:focus', bbox: @champ.bounding_box
- if @champ.dossier.editing_fork?
= turbo_stream.replace_all '.dossier-edit-sticky-footer' do
= render Dossiers::EditFooterComponent.new(dossier: @champ.dossier, annotation: @champ.private?)