From 4dc95417c5d9abeb9d6850b034fe826431d2428e Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 21 Mar 2023 11:23:33 +0100 Subject: [PATCH] fix(champ): use champ.mandatory? --- .../champ_label_content_component.html.haml | 2 +- .../linked_drop_down_list_component.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml index 6369facfd..c26b10a26 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml @@ -1,5 +1,5 @@ #{@champ.libelle} -- if @champ.type_de_champ.mandatory? +- if @champ.mandatory? %span.mandatory * - if @champ.updated_at.present? && @seen_at.present? diff --git a/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml b/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml index 75f82dd03..21c23d0d6 100644 --- a/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml +++ b/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml @@ -6,7 +6,7 @@ .secondary{ class: @champ.has_secondary_options_for_primary? ? '' : 'hidden' } = @form.label :secondary_value, for: "#{@champ.input_id}-secondary" do - - sanitize((@champ.drop_down_secondary_libelle.presence || "Valeur secondaire dépendant de la première") + (@champ.type_de_champ.mandatory? ? tag.span(' *', class: 'mandatory') : '')) + - sanitize((@champ.drop_down_secondary_libelle.presence || "Valeur secondaire dépendant de la première") + (@champ.mandatory? ? tag.span(' *', class: 'mandatory') : '')) - if @champ.drop_down_secondary_description.present? .notice{ id: "#{@champ.describedby_id}-secondary" }= render SimpleFormatComponent.new(@champ.drop_down_secondary_description, allow_a: true) = @form.select :secondary_value,