feat(instructeurs/dossiers): add summary to dossier.champs and dossier.champ_private views, also extract summary in
two component. one of type de champ editor. one for viewable champs
This commit is contained in:
parent
5a5ebfb235
commit
d46dc7055d
14 changed files with 146 additions and 61 deletions
|
@ -0,0 +1,17 @@
|
|||
class ViewableChamp::HeaderSectionsSummaryComponent < ApplicationComponent
|
||||
def initialize(dossier:, is_private:)
|
||||
@dossier = dossier
|
||||
@is_private = is_private
|
||||
end
|
||||
|
||||
def header_sections
|
||||
@dossier.revision
|
||||
.types_de_champ_for(scope: @is_private ? :private : :public)
|
||||
.filter(&:header_section?)
|
||||
.map { @dossier.project_champ(_1, nil) } # row_id not needed, do not link to repetiion header_sections
|
||||
end
|
||||
|
||||
def href(header_section) # used by viewable champs to anchor elements
|
||||
"##{header_section.input_group_id}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue