From f4f036ce810fdffc52e595dc3be6b2fb0fe1e0c4 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Jul 2023 09:43:19 +0200 Subject: [PATCH] fix(demande): extract missing i18n title --- app/views/users/dossiers/demande.html.haml | 2 +- app/views/users/dossiers/show/_header.html.haml | 4 ++-- config/locales/en.yml | 5 ++--- config/locales/fr.yml | 5 ++--- spec/system/users/dossier_shared_examples.rb | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/views/users/dossiers/demande.html.haml b/app/views/users/dossiers/demande.html.haml index a902dde16..346b2cfa1 100644 --- a/app/views/users/dossiers/demande.html.haml +++ b/app/views/users/dossiers/demande.html.haml @@ -20,4 +20,4 @@ .fr-grid-row .fr-col-xl-8.fr-col-offset-xl-2 %p= link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(@dossier), class: 'fr-btn fr-btn-sm', - title: "Modifier mon dossier tant qu'il n'est pas passé en instruction" + title: t('views.users.dossiers.demande.edit_dossier_title') diff --git a/app/views/users/dossiers/show/_header.html.haml b/app/views/users/dossiers/show/_header.html.haml index 6d3e4e2b4..d2b3194de 100644 --- a/app/views/users/dossiers/show/_header.html.haml +++ b/app/views/users/dossiers/show/_header.html.haml @@ -17,8 +17,8 @@ .header-actions = render partial: 'invites/dropdown', locals: { dossier: dossier, morphing: false } - if dossier.can_be_updated_by_user? && !current_page?(modifier_dossier_path(dossier)) - = link_to t('views.users.dossiers.show.header.edit_dossier'), modifier_dossier_path(dossier), class: 'fr-btn fr-btn-sm', - title: t('views.users.dossiers.show.header.edit_dossier_title') + = link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(dossier), class: 'fr-btn fr-btn-sm', + title: t('views.users.dossiers.demande.edit_dossier_title') = render(partial: 'users/dossiers/show/print_dossier', locals: { dossier: dossier }) %nav.tabs diff --git a/config/locales/en.yml b/config/locales/en.yml index ec9dd32bc..4db39a6b1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -423,8 +423,6 @@ en: submit_dossier: Submit an other file show: header: - edit_dossier: Edit my file - edit_dossier_title: "Edit my file - You can modify your file as long as it has not been sent for processing" summary: "Summary" request: "Request" mailbox: "Mailbox" @@ -454,7 +452,8 @@ en: messagerie: mailbox: "The mailbox allows you to contact the instructor in charge of your file." demande: - edit_dossier: "Edit file" + edit_dossier: Edit file + 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) simple: Search diff --git a/config/locales/fr.yml b/config/locales/fr.yml index a62c1af9e..b7c96b0eb 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -425,8 +425,6 @@ fr: submit_dossier: Déposer un autre dossier show: header: - edit_dossier: Modifier mon dossier - edit_dossier_title: "Modifier mon dossier - Vous pouvez modifier votre dossier tant qu’il n’est pas passé en instruction" summary: "Résumé" request: "Demande" mailbox: "Messagerie" @@ -456,7 +454,8 @@ fr: messagerie: mailbox: "La messagerie vous permet de contacter l’instructeur en charge de votre dossier." demande: - edit_dossier: "Modifier le dossier" + edit_dossier: Modifier le dossier + 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) simple: Rechercher diff --git a/spec/system/users/dossier_shared_examples.rb b/spec/system/users/dossier_shared_examples.rb index ee50b85f6..67910e147 100644 --- a/spec/system/users/dossier_shared_examples.rb +++ b/spec/system/users/dossier_shared_examples.rb @@ -6,7 +6,7 @@ RSpec.shared_examples 'the user can edit the submitted demande' do click_on 'Demande' expect(page).to have_current_path(demande_dossier_path(dossier)) - click_on 'Modifier le dossier' + click_on 'Modifier le dossier', match: :first expect(page).to have_current_path(modifier_dossier_path(dossier)) fill_in('Texte obligatoire', with: 'Nouveau texte')