diff --git a/app/assets/stylesheets/conditions_component.scss b/app/assets/stylesheets/conditions_component.scss index 585819cbc..34605fbc5 100644 --- a/app/assets/stylesheets/conditions_component.scss +++ b/app/assets/stylesheets/conditions_component.scss @@ -74,13 +74,4 @@ form.form > .conditionnel { border-color: $dark-red; } } - - .add-row { - background: none; - border: none; - cursor: pointer; - font-size: 16px; - line-height: 25px; - margin: 0 $default-padding $default-padding; - } } diff --git a/app/assets/stylesheets/forms.scss b/app/assets/stylesheets/forms.scss index 13d707ba7..7605088e9 100644 --- a/app/assets/stylesheets/forms.scss +++ b/app/assets/stylesheets/forms.scss @@ -184,9 +184,6 @@ } } - .add-row { - margin-bottom: $default-fields-spacer; - } input[type=checkbox] { &.small-margin { diff --git a/app/assets/stylesheets/procedure_champs_editor.scss b/app/assets/stylesheets/procedure_champs_editor.scss index b8d524eff..bb2e6fe1e 100644 --- a/app/assets/stylesheets/procedure_champs_editor.scss +++ b/app/assets/stylesheets/procedure_champs_editor.scss @@ -91,10 +91,6 @@ .conditionnel { color: $white; - - .add-row { - background-color: $white; - } } } @@ -151,6 +147,7 @@ border-bottom: none; padding-bottom: 15px; padding-top: 15px; + z-index: 10; // above DSFR buttons } .fill-duration { diff --git a/app/components/types_de_champ_editor/conditions_component.rb b/app/components/types_de_champ_editor/conditions_component.rb index 7d2324e49..34ba642d9 100644 --- a/app/components/types_de_champ_editor/conditions_component.rb +++ b/app/components/types_de_champ_editor/conditions_component.rb @@ -21,11 +21,13 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent end def logic_conditionnel_button + html_class = 'fr-btn fr-btn--tertiary fr-btn--sm' + if @condition.nil? submit_tag( t('.enable_conditionnel'), formaction: add_row_admin_procedure_condition_path(@procedure_id, @tdc.stable_id), - class: 'button small' + class: html_class ) else submit_tag( @@ -33,7 +35,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent formmethod: 'delete', formnovalidate: true, data: { confirm: t('.disable_conditionnel_alert') }, - class: 'button small' + class: html_class ) end end @@ -187,10 +189,10 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent def add_condition_tag tag.button( - tag.span('', class: 'icon add') + tag.span(t('.add_condition')), + t('.add_condition'), formaction: add_row_admin_procedure_condition_path(@procedure_id, @tdc.stable_id), formnovalidate: true, - class: 'add-row button small' + class: 'fr-btn fr-btn--secondary fr-btn--sm fr-icon-add-circle-line fr-btn--icon-left' ) end diff --git a/app/components/types_de_champ_editor/conditions_component/conditions_component.fr.yml b/app/components/types_de_champ_editor/conditions_component/conditions_component.fr.yml index 1593ff1f9..e5e675b3d 100644 --- a/app/components/types_de_champ_editor/conditions_component/conditions_component.fr.yml +++ b/app/components/types_de_champ_editor/conditions_component/conditions_component.fr.yml @@ -3,7 +3,7 @@ fr: display_if: Afficher si enable_conditionnel: cliquer pour activer disable_conditionnel: cliquer pour désactiver - disable_conditionnel_alert: "La logique conditionnelle appliquée à ce champ sera désactivé.\nVoulez-vous continuer ?" + disable_conditionnel_alert: "La logique conditionnelle appliquée à ce champ sera désactivée.\nVoulez-vous continuer ?" select: Sélectionner add_condition: Ajouter une condition remove_a_row: Supprimer la ligne diff --git a/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml b/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml index bd71535d4..03be628eb 100644 --- a/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml +++ b/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml @@ -2,8 +2,9 @@ = form_tag admin_procedure_condition_path(@procedure_id, @tdc.stable_id), method: :patch, class: 'form width-100' do .conditionnel.mt-2.width-100 .flex - %p.mr-2 Logique conditionnelle - = logic_conditionnel_button + %p + Logique conditionnelle + = logic_conditionnel_button = render TypesDeChampEditor::ConditionsErrorsComponent.new(conditions: condition_per_row, upper_tdcs: @upper_tdcs)