diff --git a/app/components/dossiers/champ_row_show_component.rb b/app/components/dossiers/champ_row_show_component.rb index 906f6c47f..974085718 100644 --- a/app/components/dossiers/champ_row_show_component.rb +++ b/app/components/dossiers/champ_row_show_component.rb @@ -30,7 +30,7 @@ class Dossiers::ChampRowShowComponent < ApplicationComponent end def each_champ(&block) - @champs.filter { show_champ?(_1) }.each(&block) + @champs.filter { show_champ?(_1) && _1.visible? && !_1.exclude_from_view? }.each(&block) end private diff --git a/app/components/dossiers/champ_row_show_component/champ_row_show_component.html.haml b/app/components/dossiers/champ_row_show_component/champ_row_show_component.html.haml index 9e9c3afb8..299821eed 100644 --- a/app/components/dossiers/champ_row_show_component/champ_row_show_component.html.haml +++ b/app/components/dossiers/champ_row_show_component/champ_row_show_component.html.haml @@ -1,9 +1,11 @@ - each_champ do |champ| .fr-px-4v.fr-my-2v - if champ.repetition? - %p.champ-label= "#{champ.libelle} :" - - champ.rows.each do |row| - = render Dossiers::ChampRowShowComponent.new(champs: row, demande_seen_at: @demande_seen_at, profile: @profile, repetition: true) + - champ.rows.each.with_index do |row, i| + .fr-background-alt--grey.fr-p-3v.fr-my-3w + %p.champ-label= "#{champ.libelle}  #{i +1}:" + + = render Dossiers::ChampRowShowComponent.new(champs: row, demande_seen_at: @demande_seen_at, profile: @profile, repetition: true) - elsif !champ.header_section? .flex.d-block-sm diff --git a/app/components/viewable_champ/section_component.rb b/app/components/viewable_champ/section_component.rb index 703eb8b09..481410c78 100644 --- a/app/components/viewable_champ/section_component.rb +++ b/app/components/viewable_champ/section_component.rb @@ -19,7 +19,7 @@ class ViewableChamp::SectionComponent < ApplicationComponent end def champs - tail.filter { _1.is_a?(Champ) && _1.visible? && !_1.exclude_from_view? } + tail.filter { _1.is_a?(Champ) } end def sections