From 93c7b3f817c4f5d89ab38465763c9dc51966aea3 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 11:39:40 +0200 Subject: [PATCH 01/10] Fix typo --- .../user_procedure_filter_component.en.yml | 2 +- .../user_procedure_filter_component.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml index d6e123c4a..0d24cc437 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml @@ -1,4 +1,4 @@ -fr: +en: procedures: label: Filter by procedure prompt: All procedures diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml index 570ec76ff..810f7ecc0 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml @@ -1,5 +1,5 @@ = form_with(url: dossiers_path, method: :get, data: { controller: 'autosubmit' } ) do |f| = f.hidden_field :q, value: params[:q], id: nil - = f.label :procedure_id, t('.procedure.label'), class: 'sr-only' + = f.label :procedure_id, t('.procedures.label'), class: 'sr-only' .fr-input-group = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select' From ac6b552acbbca274b8a20258dffb34f3a5a8231c Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 12:25:24 +0200 Subject: [PATCH 02/10] Modify 'Filter by procedure' label --- .../user_procedure_filter_component.en.yml | 4 ++-- .../user_procedure_filter_component.fr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml index 0d24cc437..2aaa11f4e 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml @@ -1,4 +1,4 @@ en: procedures: - label: Filter by procedure - prompt: All procedures + label: Show files by procedure + prompt: Select a procedure diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml index ae421496a..8ddedc3ae 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml @@ -1,4 +1,4 @@ fr: procedures: - label: Filtrer par démarche - prompt: Toutes les démarches + label: Afficher les dossiers par démarche + prompt: Sélectionner une démarche From 32114c01329c9e25e0a0ff8c718a72be815ec321 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 12:27:19 +0200 Subject: [PATCH 03/10] Modify 'Search a file' label --- app/views/users/dossiers/index.html.haml | 4 ++-- config/locales/en.yml | 2 ++ config/locales/fr.yml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index b481b94c3..12172d3b9 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -13,8 +13,8 @@ #search-2.fr-search-bar = form_tag dossiers_path, method: :get, :role => "search", class: "flex width-100 fr-mb-5w" do = hidden_field_tag :procedure_id, params[:procedure_id] - = label_tag "q", t('views.users.dossiers.search.search_file'), class: 'fr-label' - = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), class: "fr-input" + = label_tag "q", t('views.users.dossiers.search.label'), class: 'fr-label' + = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" %button.fr-btn.fr-btn--sm = t('views.users.dossiers.search.simple') - if @procedures_for_select.size > 1 diff --git a/config/locales/en.yml b/config/locales/en.yml index ed95ea081..c8810859b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -485,6 +485,8 @@ en: edit_dossier_title: "Edit my file - You can modify your file as long as it has not been sent for processing" search: search_file: Search a file (File number, keywords) + prompt: (File number, last name / first name, keywords) + label: Search a file simple: Search result_term_title: Search result for « %{search_terms} » result_procedure_title: and procedure « %{procedure_libelle} » diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f9f16fcee..a86999cf0 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -488,6 +488,8 @@ fr: edit_dossier_title: "Modifier mon dossier - Vous pouvez modifier votre dossier tant qu’il n’est pas passé en instruction" search: search_file: Rechercher un dossier (N° de dossier, mots-clés) + prompt: (N° de dossier, nom / prénom, mots-clés) + label: Rechercher un dossier simple: Rechercher result_term_title: Résultat de la recherche pour « %{search_terms} » result_procedure_title: et pour la procédure « %{procedure_libelle} » From 03409a798f67ef8f0a286d21d2af4798f3f13893 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 12:42:13 +0200 Subject: [PATCH 04/10] Display 'Filter by procedure' label --- .../user_procedure_filter_component.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml index 810f7ecc0..3b9ac3d64 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml @@ -1,5 +1,4 @@ = form_with(url: dossiers_path, method: :get, data: { controller: 'autosubmit' } ) do |f| = f.hidden_field :q, value: params[:q], id: nil - = f.label :procedure_id, t('.procedures.label'), class: 'sr-only' - .fr-input-group - = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select' + = f.label :procedure_id, t('.procedures.label'), class: 'fr-label' + = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select' From 6f1b41b1a7d3fb801dede0f28e730533f6832fb0 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 14:54:46 +0200 Subject: [PATCH 05/10] Remove .fr-search-bar .fr-label styles. And unse .sr-only instead --- app/assets/stylesheets/dsfr.scss | 15 +++++++++++++++ .../groupes_search_component.html.haml | 2 +- app/views/layouts/_search_dossiers_form.html.haml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index f1e0344d4..89e2e966b 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -164,3 +164,18 @@ button.fr-tag-bug { border: 2px solid var(--border-action-high-grey); } } + +// On restaure la visibilité des éléments .fr-search-bar .fr-label (en appliquant les valeurs par défaut des différentes propriétés) +// Et on utilise la classe .sr-only pour masquer les éléments souhaités au cas par cas +.fr-search-bar .fr-label { + position: initial; + width: initial; + height: initial; + padding: initial; + margin: initial; + overflow: initial; + clip: initial; + white-space: initial; + border: initial; + display: block; // Pour cette valeur spécifique, on récupère celle de .fr-label +} diff --git a/app/components/procedure/groupes_search_component/groupes_search_component.html.haml b/app/components/procedure/groupes_search_component/groupes_search_component.html.haml index 7b5308e51..569e3f247 100644 --- a/app/components/procedure/groupes_search_component/groupes_search_component.html.haml +++ b/app/components/procedure/groupes_search_component/groupes_search_component.html.haml @@ -1,7 +1,7 @@ = form_with(url: admin_procedure_groupe_instructeurs_path(@procedure), method: :get) do #header-search.fr-search-bar.fr-mb-2w{ role: "search" } - = label_tag :q, 'Rechercher par nom', class: 'fr-label' + = label_tag :q, 'Rechercher par nom', class: 'sr-only' = text_field_tag :q, @query, class: 'fr-input', type: 'search', autocomplete: 'off', placeholder: 'Rechercher par nom' %button.fr-btn{ title: "Rechercher" } Rechercher - if @query.present? diff --git a/app/views/layouts/_search_dossiers_form.html.haml b/app/views/layouts/_search_dossiers_form.html.haml index f0aab616e..959616163 100644 --- a/app/views/layouts/_search_dossiers_form.html.haml +++ b/app/views/layouts/_search_dossiers_form.html.haml @@ -3,7 +3,7 @@ %button.fr-btn--close.fr-btn{ "aria-controls" => "search-modal", :title => t('close_modal', scope: [:layouts, :header]) }= t('close_modal', scope: [:layouts, :header]) #search-473.fr-search-bar.fr-search-bar--lg = form_tag recherche_index_path, method: :get, :role => "search", class: "flex width-100" do - = label_tag "q", t('views.users.dossiers.search.search_file'), class: 'fr-label' + = label_tag "q", t('views.users.dossiers.search.search_file'), class: 'sr-only' = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), class: "fr-input" %button.fr-btn = t('views.users.dossiers.search.simple') From df489cc688acb24391a66f1b82c4accc30961761 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 16:20:37 +0200 Subject: [PATCH 06/10] Modify id and for values to avoid conflict due to duplicate identifiers --- .../user_procedure_filter_component.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml index 3b9ac3d64..49a652197 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml @@ -1,4 +1,4 @@ = form_with(url: dossiers_path, method: :get, data: { controller: 'autosubmit' } ) do |f| = f.hidden_field :q, value: params[:q], id: nil - = f.label :procedure_id, t('.procedures.label'), class: 'fr-label' - = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select' + = f.label :procedure_id, t('.procedures.label'), class: 'fr-label', for: 'procedure_select' + = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select', id: 'procedure_select' From beda1814c87267bdf837312bbb000edfc3cc17c3 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 3 May 2024 16:26:37 +0200 Subject: [PATCH 07/10] Improve searchbar layout --- app/views/users/dossiers/index.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 12172d3b9..b06a6deb7 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -11,12 +11,13 @@ - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 .fr-col #search-2.fr-search-bar - = form_tag dossiers_path, method: :get, :role => "search", class: "flex width-100 fr-mb-5w" do + = form_tag dossiers_path, method: :get, :role => "search", class: "width-100 fr-mb-5w" do = hidden_field_tag :procedure_id, params[:procedure_id] - = label_tag "q", t('views.users.dossiers.search.label'), class: 'fr-label' - = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" - %button.fr-btn.fr-btn--sm - = t('views.users.dossiers.search.simple') + = label_tag "q", t('views.users.dossiers.search.label'), class: 'fr-label fr-mb-1w' + .flex + = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" + %button.fr-btn.fr-btn--sm + = t('views.users.dossiers.search.simple') - if @procedures_for_select.size > 1 .fr-col = render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select) From 3c6133276b666718a1e61d36b94ce4f02801c97a Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Mon, 13 May 2024 11:30:18 +0200 Subject: [PATCH 08/10] Replace autosubmit by submit button --- .../user_procedure_filter_component.en.yml | 1 + .../user_procedure_filter_component.fr.yml | 1 + .../user_procedure_filter_component.html.haml | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml index 2aaa11f4e..8577aa87d 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.en.yml @@ -2,3 +2,4 @@ en: procedures: label: Show files by procedure prompt: Select a procedure + button: Show diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml index 8ddedc3ae..5bad01303 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.fr.yml @@ -2,3 +2,4 @@ fr: procedures: label: Afficher les dossiers par démarche prompt: Sélectionner une démarche + button: Afficher diff --git a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml index 49a652197..5dc7f9c04 100644 --- a/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml +++ b/app/components/dossiers/user_procedure_filter_component/user_procedure_filter_component.html.haml @@ -1,4 +1,7 @@ -= form_with(url: dossiers_path, method: :get, data: { controller: 'autosubmit' } ) do |f| += form_with(url: dossiers_path, method: :get ) do |f| = f.hidden_field :q, value: params[:q], id: nil - = f.label :procedure_id, t('.procedures.label'), class: 'fr-label', for: 'procedure_select' - = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select', id: 'procedure_select' + = f.label :procedure_id, t('.procedures.label'), class: 'fr-label fr-mb-1w', for: 'procedure_select' + .flex + = f.select :procedure_id, options_for_select(@procedures_for_select, params[:procedure_id]), { prompt: t('.procedures.prompt') }, class: 'fr-select fr-mr-1w', id: 'procedure_select' + %button.fr-btn.fr-btn--sm{ 'aria-label': t('.procedures.label') } + = t('.procedures.button') From e4979bc1a1dcac63de91f33cfcc08babec444a48 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Mon, 13 May 2024 11:31:16 +0200 Subject: [PATCH 09/10] Specifie the function of the submit button --- app/views/users/dossiers/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index b06a6deb7..9a50902c1 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -17,7 +17,7 @@ .flex = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.prompt'), class: "fr-input" %button.fr-btn.fr-btn--sm - = t('views.users.dossiers.search.simple') + = t('views.users.dossiers.search.label') - if @procedures_for_select.size > 1 .fr-col = render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select) From b81c6db96dda68dba77e2486c1b3c07032bad4ba Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Mon, 13 May 2024 11:54:06 +0200 Subject: [PATCH 10/10] Update .rb file, fix specs --- spec/system/users/list_dossiers_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/system/users/list_dossiers_spec.rb b/spec/system/users/list_dossiers_spec.rb index 5325c2cc0..1ca3277ce 100644 --- a/spec/system/users/list_dossiers_spec.rb +++ b/spec/system/users/list_dossiers_spec.rb @@ -280,6 +280,7 @@ describe 'user access to the list of their dossiers', js: true do it "can be filtered by procedure and display the result - one item" do select dossier_en_construction.procedure.libelle, from: 'procedure_id' + click_on 'Afficher' expect(page).to have_link(dossier_en_construction.procedure.libelle) expect(page).not_to have_link(dossier_with_champs.procedure.libelle) expect(page).to have_text("1 dossier") @@ -287,6 +288,7 @@ describe 'user access to the list of their dossiers', js: true do it "can be filtered by procedure and display the result - no item" do select dossier_brouillon.procedure.libelle, from: 'procedure_id' + click_on 'Afficher' expect(page).not_to have_link(String(dossier_en_construction.id)) expect(page).not_to have_link(String(dossier_with_champs.id)) expect(page).to have_content("Résultat de la recherche pour « #{dossier_en_construction.champs_public.first.value} » et pour la procédure « #{dossier_brouillon.procedure.libelle} » ") @@ -301,8 +303,9 @@ describe 'user access to the list of their dossiers', js: true do it "can filter by procedure" do expect(page).to have_text('7 en cours') expect(page).to have_text('3 traités') - expect(page).to have_select('procedure_id', selected: 'Toutes les démarches') + expect(page).to have_select('procedure_id', selected: 'Sélectionner une démarche') select dossier_brouillon.procedure.libelle, from: 'procedure_id' + click_on 'Afficher' expect(page).to have_text('1 en cours') end end