Merge branch 'main' into feature/add_rna_type_de_champs

This commit is contained in:
Damien Le Thiec 2022-10-11 15:36:46 +02:00 committed by GitHub
commit 73f6063c87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
173 changed files with 1194 additions and 1316 deletions

View file

@ -181,7 +181,14 @@ module Users
respond_to do |format|
format.html { render :brouillon }
format.turbo_stream { render layout: false }
format.turbo_stream do
@to_shows, @to_hides = @dossier.champs
.filter(&:conditional?)
.partition(&:visible?)
.map { |champs| champs_to_one_selector(champs) }
render(:update, layout: false)
end
end
end
@ -205,7 +212,14 @@ module Users
respond_to do |format|
format.html { render :modifier }
format.turbo_stream { render layout: false }
format.turbo_stream do
@to_shows, @to_hides = @dossier.champs
.filter(&:conditional?)
.partition(&:visible?)
.map { |champs| champs_to_one_selector(champs) }
render layout: false
end
end
end
@ -392,7 +406,7 @@ module Users
end
def dossier_with_champs
dossier_scope.with_champs.find(params[:id])
DossierPreloader.load_one(dossier)
end
def should_change_groupe_instructeur?
@ -520,5 +534,12 @@ module Users
# rubocop:enable Lint/BooleanSymbol
end
end
def champs_to_one_selector(champs)
champs
.map(&:input_group_id)
.map { |id| "##{id}" }
.join(',')
end
end
end