correctif(demande): ETQ usager, instructeur, je ne souhaite pas voir les champs conditionné et non visible dans un bloc repetable
This commit is contained in:
parent
f3922c7e39
commit
71c4e93544
3 changed files with 7 additions and 5 deletions
|
@ -30,7 +30,7 @@ class Dossiers::ChampRowShowComponent < ApplicationComponent
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_champ(&block)
|
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
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
- each_champ do |champ|
|
- each_champ do |champ|
|
||||||
.fr-px-4v.fr-my-2v
|
.fr-px-4v.fr-my-2v
|
||||||
- if champ.repetition?
|
- if champ.repetition?
|
||||||
%p.champ-label= "#{champ.libelle} :"
|
- champ.rows.each.with_index do |row, i|
|
||||||
- champ.rows.each do |row|
|
.fr-background-alt--grey.fr-p-3v.fr-my-3w
|
||||||
= render Dossiers::ChampRowShowComponent.new(champs: row, demande_seen_at: @demande_seen_at, profile: @profile, repetition: true)
|
%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?
|
- elsif !champ.header_section?
|
||||||
.flex.d-block-sm
|
.flex.d-block-sm
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ViewableChamp::SectionComponent < ApplicationComponent
|
||||||
end
|
end
|
||||||
|
|
||||||
def champs
|
def champs
|
||||||
tail.filter { _1.is_a?(Champ) && _1.visible? && !_1.exclude_from_view? }
|
tail.filter { _1.is_a?(Champ) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def sections
|
def sections
|
||||||
|
|
Loading…
Reference in a new issue