From 5fed1c03301f11a2554df23a85705eabee90499f Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Wed, 6 Sep 2023 12:40:01 +0200 Subject: [PATCH] make dropdown filter for instructeur to DSFR --- app/assets/stylesheets/buttons.scss | 17 ----------------- .../instructeur_filter_component.html.haml | 16 +++++++++------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/buttons.scss b/app/assets/stylesheets/buttons.scss index 98840f1d6..0d4016b15 100644 --- a/app/assets/stylesheets/buttons.scss +++ b/app/assets/stylesheets/buttons.scss @@ -310,23 +310,6 @@ ul.dropdown-items { width: 340px; } - label { - width: 100px; - display: inline-block; - margin-bottom: 2 * $default-spacer; - } - - input:not(.fr-btn) { - width: 200px; - display: inline-block; - background-color: $light-grey; - border: 1px solid $border-grey; - } - - [disabled] { - display: none; - } - ul { list-style: none; } diff --git a/app/components/dossiers/instructeur_filter_component/instructeur_filter_component.html.haml b/app/components/dossiers/instructeur_filter_component/instructeur_filter_component.html.haml index e3b5342de..0197a6c48 100644 --- a/app/components/dossiers/instructeur_filter_component/instructeur_filter_component.html.haml +++ b/app/components/dossiers/instructeur_filter_component/instructeur_filter_component.html.haml @@ -1,13 +1,15 @@ = form_tag add_filter_instructeur_procedure_path(procedure), method: :post, class: 'dropdown-form large', id: 'filter-component', data: { turbo: true, controller: 'autosubmit' } do - = label_tag :field, t('.column') - = select_tag :field, options_for_select(filterable_fields_for_select, field_id), include_blank: field_id.nil? - %input.hidden{ type: 'submit', formaction: update_filter_instructeur_procedure_path(procedure), data: { autosubmit_target: 'submitter' } } - %br - = label_tag :value, t('.value'), for: 'value' + .fr-select-group + = label_tag :field, t('.column'), class: 'fr-label fr-m-0' + = select_tag :field, options_for_select(filterable_fields_for_select, field_id), include_blank: field_id.nil?, class: 'fr-select' + + %input.hidden{ type: 'submit', formaction: update_filter_instructeur_procedure_path(procedure), data: { autosubmit_target: 'submitter' } } + + = label_tag :value, t('.value'), for: 'value', class: 'fr-label' - if field_type == :enum - = select_tag :value, options_for_select(options_for_select_of_field), id: 'value', name: 'value', data: { no_autosubmit: true } + = select_tag :value, options_for_select(options_for_select_of_field), id: 'value', name: 'value', class: 'fr-select', data: { no_autosubmit: true } - else - %input#value{ type: field_type, name: :value, maxlength: ProcedurePresentation::FILTERS_VALUE_MAX_LENGTH, disabled: field_id.nil? ? true : false, data: { no_autosubmit: true } } + %input#value.fr-input{ type: field_type, name: :value, disabled: field_id.nil? ? true : false, data: { no_autosubmit: true } } = hidden_field_tag :statut, statut = submit_tag t('.add_filter'), class: 'fr-btn fr-btn--secondary fr-mt-2w'