From 5549976fce489cfac9e431aa55bf886ad326f962 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 17 Dec 2024 15:35:19 +0100 Subject: [PATCH] fix(autosave): Add alternative text to icons --- .../autosave_footer_component.en.yml | 12 ++++++------ .../autosave_footer_component.fr.yml | 12 ++++++------ .../autosave_footer_component.html.haml | 12 ++++++------ spec/system/users/brouillon_spec.rb | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/components/dossiers/autosave_footer_component/autosave_footer_component.en.yml b/app/components/dossiers/autosave_footer_component/autosave_footer_component.en.yml index d03a8dd98cc..bc5977c4851 100644 --- a/app/components/dossiers/autosave_footer_component/autosave_footer_component.en.yml +++ b/app/components/dossiers/autosave_footer_component/autosave_footer_component.en.yml @@ -2,15 +2,15 @@ en: brouillon: explanation: Your draft is automatically saved. - confirmation: Draft saved - error: Impossible to save the draft + confirmation_html: Draft successfully saved. + error_html: 'Warning: Impossible to save the draft.' en_construction: explanation: Your modifications are automatically saved. submit_them: Submit them when you’re done. - confirmation: Modifications saved - error: Impossible to save the modifications. + confirmation_html: Modifications successfully saved. + error_html: 'Warning: Impossible to save the modifications.' annotations: explanation: Your annotations are automatically saved. - confirmation: Annotations saved - error: Impossible to save the annotations + confirmation_html: Annotations successfully saved. + error_html: 'Warning: Impossible to save the annotations.' more_information: More informations diff --git a/app/components/dossiers/autosave_footer_component/autosave_footer_component.fr.yml b/app/components/dossiers/autosave_footer_component/autosave_footer_component.fr.yml index 6d962ca27e2..384f4e7a137 100644 --- a/app/components/dossiers/autosave_footer_component/autosave_footer_component.fr.yml +++ b/app/components/dossiers/autosave_footer_component/autosave_footer_component.fr.yml @@ -2,15 +2,15 @@ fr: brouillon: explanation: Votre brouillon est automatiquement enregistré. - confirmation: Brouillon enregistré - error: Impossible d’enregistrer le brouillon + confirmation_html: 'Brouillon enregistré avec succès' + error_html: 'Attention : Impossible d’enregistrer le brouillon.' en_construction: explanation: Vos modifications sont automatiquement enregistrées. submit_them: Déposez-les quand vous aurez terminé. - confirmation: Modifications enregistrées. - error: Impossible d’enregistrer les modifications + confirmation_html: 'Modifications enregistrées avec succès' + error_html: 'Attention : Impossible d’enregistrer les modifications.' annotations: explanation: Vos annotations sont automatiquement enregistrées. - confirmation: Annotations enregistrées - error: Impossible d’enregistrer les annotations + confirmation_html: 'Annotations enregistrées avec succès' + error_html: 'Attention : Impossible d’enregistrer les annotations.' more_information: En savoir plus diff --git a/app/components/dossiers/autosave_footer_component/autosave_footer_component.html.haml b/app/components/dossiers/autosave_footer_component/autosave_footer_component.html.haml index 23787448488..1227eb4dbf8 100644 --- a/app/components/dossiers/autosave_footer_component/autosave_footer_component.html.haml +++ b/app/components/dossiers/autosave_footer_component/autosave_footer_component.html.haml @@ -16,11 +16,11 @@ %span.fr-icon-success-fill.autosave-icon{ 'aria-hidden': 'true' } %span.autosave-label - if annotation? - = t('.annotations.confirmation') + = t('.annotations.confirmation_html') - elsif dossier.editing_fork? - = t('.en_construction.confirmation') + = t('.en_construction.confirmation_html') - else - = t('.brouillon.confirmation') + = t('.brouillon.confirmation_html') - if !annotation? = link_to t('.more_information'), t("links.common.faq.autosave_url"), class: 'fr-link fr-link--sm', **external_link_attributes @@ -28,11 +28,11 @@ %span.fr-icon-warning-fill.autosave-icon{ 'aria-hidden': 'true' } %span.autosave-label - if annotation? - = t('.annotations.error') + = t('.annotations.error_html') - elsif dossier.editing_fork? - = t('.en_construction.error') + = t('.en_construction.error_html') - else - = t('.brouillon.error') + = t('.brouillon.error_html') %button.fr-btn.fr-btn--tertiary.fr-btn--sm.autosave-retry{ type: :button, data: { action: 'autosave-status#onClickRetryButton', autosave_status_target: 'retryButton' } } %span.autosave-retry-label Réessayer %span.autosave-retrying-label Enregistrement en cours… diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index 5199d74beb3..aa15aeab9ca 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -614,7 +614,7 @@ allow_any_instance_of(Users::DossiersController).to receive(:update).and_raise("Server is busy") fill_in('texte obligatoire', with: 'a valid user input') blur - expect(page).to have_css('span', text: 'Impossible d’enregistrer le brouillon', visible: true) + expect(page).to have_css('span', text: 'Attention : Impossible d’enregistrer le brouillon', visible: true) # Test that retrying after a failure works allow_any_instance_of(Users::DossiersController).to receive(:update).and_call_original