correctif(validation-des-conditions): les conditions dans un bloc repetable identifient les conditions invalident

Update app/models/procedure_revision.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>
This commit is contained in:
Martin 2023-03-31 10:28:29 +02:00
parent 92f5e7663e
commit a53c32b41e

View file

@ -392,6 +392,7 @@ class ProcedureRevision < ApplicationRecord
public_tdcs = types_de_champ_public.to_a
public_tdcs
.flat_map { _1.repetition? ? children_of(_1) : _1 }
.map.with_index
.filter_map { |tdc, i| tdc.condition? ? [tdc, i] : nil }
.map { |tdc, i| [tdc, tdc.condition.errors(public_tdcs.take(i))] }