display condition change between version

This commit is contained in:
simon lehericey 2022-07-13 12:35:11 +02:00
parent 00c4076b32
commit 2cad0e11d3
6 changed files with 125 additions and 3 deletions

View file

@ -1,8 +1,8 @@
- rendered = render @condition_component
- if rendered.present?
= turbo_stream.morph dom_id(@tdc, :conditions) do
= turbo_stream.morph "conditions_type_de_champ_#{@tdc.stable_id}" do
- rendered
end
- else
= turbo_stream.remove dom_id(@tdc, :conditions)
= turbo_stream.remove "conditions_type_de_champ_#{@tdc.stable_id}"

View file

@ -54,3 +54,11 @@
%li= t(:add_option, scope: [:administrateurs, :revision_changes], items: added.map{ |term| "« #{t(term, scope: [:administrateurs, :carte_layers])} »" }.join(", "))
- if removed.present?
%li= t(:remove_option, scope: [:administrateurs, :revision_changes], items: removed.map{ |term| "« #{t(term, scope: [:administrateurs, :carte_layers])} »" }.join(", "))
- when :condition
- case change[:condition_op]
- when :add
%li= t(:add_condition, scope: [:administrateurs, :revision_changes], label: change[:label], to: change[:to])
- when :remove
%li= t(:remove_condition, scope: [:administrateurs, :revision_changes], label: change[:label], to: change[:to])
- when :update
%li= t(:update_condition, scope: [:administrateurs, :revision_changes], label: change[:label], to: change[:to])