Merge pull request #9018 from tchak/fix-exclude-repetitions-from-filters

ETQ Instructeur, je ne devrai pas pouvoir sélectionner des champs non filtrables/affichables
This commit is contained in:
Paul Chavard 2023-05-09 10:51:47 +00:00 committed by GitHub
commit 94b9873bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,7 @@ class ProcedurePresentation < ApplicationRecord
fields.concat procedure.types_de_champ_for_procedure_presentation
.pluck(:type_champ, :libelle, :private, :stable_id)
.reject { |(type_champ)| type_champ == TypeDeChamp.type_champs.fetch(:repetition) }
.map { |(type_champ, libelle, is_private, stable_id)| field_hash(is_private ? TYPE_DE_CHAMP_PRIVATE : TYPE_DE_CHAMP, stable_id.to_s, label: libelle, type: (TypeDeChamp.options_for_select?(type_champ) ? :enum : :text)) }
fields