From 9741108094f02e742f98bc8da3faf620a2fb0984 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 12:55:03 +0000 Subject: [PATCH 01/18] lib: remove the 'migrated' key on filters In a9a4f6e2a801b19b127aae8eaec0d1f384b1a53a, a task to migrate ProcedurePresentation's filters was added. This task added a "migrated: true" key to all migrated filters. Now that this task has run, we can safely remove the extra key. In a previous version of this commit, the migration would fail for invalid ProcedurePresentation records. This is now fixed. --- ...39_remove_migration_status_on_filters.rake | 24 +++++++ lib/tasks/task_helper.rb | 11 +++ ...remove_migration_status_on_filters_spec.rb | 68 +++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 lib/tasks/deployment/20210720133539_remove_migration_status_on_filters.rake create mode 100644 spec/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters_spec.rb diff --git a/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters.rake b/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters.rake new file mode 100644 index 000000000..897a564f8 --- /dev/null +++ b/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters.rake @@ -0,0 +1,24 @@ +namespace :after_party do + desc 'Deployment task: remove_migration_status_on_filters' + task remove_migration_status_on_filters: :environment do + rake_puts "Running deploy task 'remove_migration_status_on_filters'" + + # In a9a4f6e2a801b19b127aae8eaec0d1f384b1a53a, a task to migrate ProcedurePresentation's filters + # was added. + # This task added a "migrated: true" key to all migrated filters. + # + # Now that this task has run, we can safely remove the extra key. + + procedure_presentations = ProcedurePresentation.where("filters -> 'migrated' IS NOT NULL") + progress = ProgressReport.new(procedure_presentations.count) + + procedure_presentations.find_each do |pp| + pp.update_column(:filters, pp.filters.except('migrated')) + progress.inc + end + progress.finish + + AfterParty::TaskRecord + .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end diff --git a/lib/tasks/task_helper.rb b/lib/tasks/task_helper.rb index ef6a0bd95..8323773d7 100644 --- a/lib/tasks/task_helper.rb +++ b/lib/tasks/task_helper.rb @@ -15,6 +15,17 @@ def rake_print(*args) end end +# Display progress of a long-running Rake task. +# +# Usage: +# +# ``` +# progress = ProgressReport.new(100) +# (0..100).times do +# progress.inc +# end +# progress.finish +# ```` class ProgressReport def initialize(total) @start = Time.zone.now diff --git a/spec/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters_spec.rb b/spec/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters_spec.rb new file mode 100644 index 000000000..17828822d --- /dev/null +++ b/spec/lib/tasks/deployment/20210720133539_remove_migration_status_on_filters_spec.rb @@ -0,0 +1,68 @@ +describe '20201001161931_migrate_filters_to_use_stable_id' do + let(:rake_task) { Rake::Task['after_party:remove_migration_status_on_filters'] } + + let(:procedure) { create(:simple_procedure) } + let(:instructeur_1) { create(:instructeur) } + let(:instructeur_2) { create(:instructeur) } + + let(:assign_to_1) { create(:assign_to, procedure: procedure, instructeur: instructeur_1) } + let(:assign_to_2) { create(:assign_to, procedure: procedure, instructeur: instructeur_2) } + + let(:procedure_presentation_with_migration) { create(:procedure_presentation, assign_to: assign_to_1, filters: filters.merge('migrated': true)) } + let(:procedure_presentation_without_migration) { create(:procedure_presentation, assign_to: assign_to_2, filters: filters) } + + let(:filters) do + { "suivis" => [{ "table" => "user", "column" => "email", "value" => "test@example.com" }] } + end + + subject(:run_task) do + procedure_presentation_with_migration + procedure_presentation_without_migration + + rake_task.invoke + + procedure_presentation_with_migration.reload + procedure_presentation_without_migration.reload + end + + after { rake_task.reenable } + + context 'when the procedure presentation has a "migrated" key' do + it 'removes the "migrated" key' do + run_task + expect(procedure_presentation_with_migration.filters).not_to have_key('migrated') + end + + it 'leaves other keys unchanged' do + run_task + expect(procedure_presentation_with_migration.filters['suivis']).to be_present + end + end + + context 'when the procedure presentation doesn’t have a "migrated" key' do + it 'leaves keys unchanged' do + run_task + expect(procedure_presentation_without_migration.filters['suivis']).to be_present + end + end + + context 'when the procedure presentation is invalid' do + before do + procedure_presentation_with_migration.update_column( + :sort, + { table: 'invalid-table', column: 'invalid-column', order: 'invalid-order' } + ) + end + + it 'removes the "migrated" key properly' do + run_task + expect(procedure_presentation_with_migration).not_to be_valid + expect(procedure_presentation_with_migration.filters).not_to have_key('migrated') + end + + it 'leaves the other keys unchanged' do + run_task + expect(procedure_presentation_without_migration.filters['suivis']).to be_present + end + end +end From ef16424fa8c44f966472769dcfdf25f88c0165eb Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 24 Aug 2021 16:00:27 +0200 Subject: [PATCH 02/18] fix(i18n): use correct translation namespace --- app/views/users/passwords/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 5513f1890..e70a5f128 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -11,7 +11,7 @@ %h1= t('devise.passwords.new.forgot_your_password') - %p.notice= t('views.passwords.new.send_me_reset_password_instructions') + %p.notice= t('devise.passwords.new.send_me_reset_password_instructions') = f.label :email, 'Email' = f.email_field :email, autofocus: true From db803c2522847c27fa84761486f0f396390e5955 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 09:26:49 -0500 Subject: [PATCH 03/18] i18n: fix capitalization in the locale dropdown --- app/views/layouts/_locale_dropdown.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_locale_dropdown.html.haml b/app/views/layouts/_locale_dropdown.html.haml index 7198b8f5e..003f7bca7 100644 --- a/app/views/layouts/_locale_dropdown.html.haml +++ b/app/views/layouts/_locale_dropdown.html.haml @@ -8,4 +8,4 @@ EN – English %li = link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link" do - FR – français + FR – Français From 83b04aca59abe23447fbc42bd52e88b3e0bc0053 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 14:43:43 +0000 Subject: [PATCH 04/18] i18n: move 'layouts' locales to their proper location --- app/views/layouts/commencer/_no_procedure.html.haml | 6 +++--- config/locales/en.yml | 12 ++++++------ config/locales/fr.yml | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/layouts/commencer/_no_procedure.html.haml b/app/views/layouts/commencer/_no_procedure.html.haml index 971726f97..50037d4ad 100644 --- a/app/views/layouts/commencer/_no_procedure.html.haml +++ b/app/views/layouts/commencer/_no_procedure.html.haml @@ -2,8 +2,8 @@ = image_tag "landing/hero/dematerialiser.svg", class: "paperless-logo", alt: "moins de papier" .baseline.center %p - %span.simple= t('views.layouts.commencer.no_procedure.line1') + %span.simple= t('.line1') %br - = t('views.layouts.commencer.no_procedure.line2') + = t('.line2') %br - = t('views.layouts.commencer.no_procedure.line3') + = t('.line3') diff --git a/config/locales/en.yml b/config/locales/en.yml index 79733ad87..b0d97b8c8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -45,6 +45,12 @@ en: commentaire: send_message_to_instructeur: "Send a message to the instructor" reply_in_mailbox: "Reply in mailbox" + layouts: + commencer: + no_procedure: + line1: A simple tool + line2: to manage dematerialized + line3: administrative forms. views: commencer: show: @@ -85,12 +91,6 @@ en: want_to_withdraw_permission: "Would you like to withdraw the permission?" edit_dossier: "These people can edit this file." submit_dossier_yourself: "You must submit the file yourself when it is complete." - layouts: - commencer: - no_procedure: - line1: A simple tool - line2: to manage dematerialized - line3: administrative forms. pagination: next: Next last: Last diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6e1b0fdf9..3c93c09de 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -35,6 +35,12 @@ fr: commentaire: send_message_to_instructeur: "Envoyer un message à l’instructeur" reply_in_mailbox: "Répondre dans la messagerie." + layouts: + commencer: + no_procedure: + line1: Un outil simple + line2: pour gérer les formulaires + line3: administratifs dématérialisés. views: commencer: show: @@ -76,12 +82,6 @@ fr: want_to_withdraw_permission: "Souhaitez-vous supprimer l’autorisation ?" edit_dossier: "Ces personnes peuvent modifier ce dossier." submit_dossier_yourself: "Une fois le dossier complet, vous devez le déposer vous-même." - layouts: - commencer: - no_procedure: - line1: Un outil simple - line2: pour gérer les formulaires - line3: administratifs dématérialisés. pagination: next: Suivant last: Dernier From 47e1555dceb1fb55398d40b29ce340ce73ee3a03 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 09:45:47 -0500 Subject: [PATCH 05/18] i18n: properly translate the locale dropdown title --- app/views/layouts/_locale_dropdown.html.haml | 6 +++--- config/locales/en.yml | 2 ++ config/locales/fr.yml | 2 ++ spec/features/i18n_spec.rb | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/_locale_dropdown.html.haml b/app/views/layouts/_locale_dropdown.html.haml index 003f7bca7..7a7c39487 100644 --- a/app/views/layouts/_locale_dropdown.html.haml +++ b/app/views/layouts/_locale_dropdown.html.haml @@ -1,7 +1,7 @@ .dropdown.locale-dropdown.header-menu-opener - %button.button.dropdown-button.icon-only.header-menu-button{ title: "Translate", aria: { expanded: 'false', controls: 'locale_menu' } } - .hidden Translate - = image_tag "icons/translate-icon.svg", alt: 'Translate', width: 24, height: 24, lazy: true, aria: { hidden: true } + %button.button.dropdown-button.icon-only.header-menu-button{ title: t('.languages'), aria: { expanded: 'false', controls: 'locale_menu' } } + .hidden t('.languages') + = image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, lazy: true, aria: { hidden: true } %ul.header-menu.dropdown-content %li = link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link" do diff --git a/config/locales/en.yml b/config/locales/en.yml index b0d97b8c8..95f01432b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -51,6 +51,8 @@ en: line1: A simple tool line2: to manage dematerialized line3: administrative forms. + locale_dropdown: + languages: "Languages" views: commencer: show: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 3c93c09de..5a2797a64 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -41,6 +41,8 @@ fr: line1: Un outil simple line2: pour gérer les formulaires line3: administratifs dématérialisés. + locale_dropdown: + languages: "Langues" views: commencer: show: diff --git a/spec/features/i18n_spec.rb b/spec/features/i18n_spec.rb index cfe40915b..0c372a0cd 100644 --- a/spec/features/i18n_spec.rb +++ b/spec/features/i18n_spec.rb @@ -7,8 +7,8 @@ feature 'Accessing the website in different languages:' do visit new_user_session_path expect(page).to have_text('Connectez-vous') - click_on 'Translate' - click_on 'EN – English' + click_on 'Langues' + click_on 'English' # The page is now in English expect(page).to have_text('Sign in') From 227b1dc462f07bf8dd0ac6b61e6e36a20ec8755e Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 09:46:40 -0500 Subject: [PATCH 06/18] i18n: remove language code from the locale dropdown --- app/views/layouts/_locale_dropdown.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_locale_dropdown.html.haml b/app/views/layouts/_locale_dropdown.html.haml index 7a7c39487..90d08168a 100644 --- a/app/views/layouts/_locale_dropdown.html.haml +++ b/app/views/layouts/_locale_dropdown.html.haml @@ -5,7 +5,7 @@ %ul.header-menu.dropdown-content %li = link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link" do - EN – English + English %li = link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link" do - FR – Français + Français From 02a19587b727d2f0d0c3765751051fc8421364c8 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 09:54:57 -0500 Subject: [PATCH 07/18] i18n: display selected locale as active wit bold text --- app/assets/stylesheets/new_header.scss | 4 ++++ app/views/layouts/_locale_dropdown.html.haml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/new_header.scss b/app/assets/stylesheets/new_header.scss index f3613af3f..9f87af792 100644 --- a/app/assets/stylesheets/new_header.scss +++ b/app/assets/stylesheets/new_header.scss @@ -234,6 +234,10 @@ $header-mobile-breakpoint: 550px; display: flex; color: $black; + &.active { + font-weight: bold; + } + &:hover { background: $light-grey; } diff --git a/app/views/layouts/_locale_dropdown.html.haml b/app/views/layouts/_locale_dropdown.html.haml index 90d08168a..40f8d8a95 100644 --- a/app/views/layouts/_locale_dropdown.html.haml +++ b/app/views/layouts/_locale_dropdown.html.haml @@ -4,8 +4,8 @@ = image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, lazy: true, aria: { hidden: true } %ul.header-menu.dropdown-content %li - = link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link" do + = active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do English %li - = link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link" do + = active_link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link", active: I18n.locale == :fr do Français From bb15d5fadc5011a9a60d8c238a30691c566484d1 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 24 Aug 2021 09:57:43 -0500 Subject: [PATCH 08/18] i18n: put french first in the locales list Because French is the reference locale, and we should reflect this to users. --- app/views/layouts/_locale_dropdown.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_locale_dropdown.html.haml b/app/views/layouts/_locale_dropdown.html.haml index 40f8d8a95..15ef75f61 100644 --- a/app/views/layouts/_locale_dropdown.html.haml +++ b/app/views/layouts/_locale_dropdown.html.haml @@ -3,9 +3,9 @@ .hidden t('.languages') = image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, lazy: true, aria: { hidden: true } %ul.header-menu.dropdown-content - %li - = active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do - English %li = active_link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link", active: I18n.locale == :fr do Français + %li + = active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do + English From 1399d9bba9d854e7ffe6d443d65311a0d4fa56fb Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 19 Aug 2021 10:23:27 +0100 Subject: [PATCH 09/18] feat(graphql): expose demarche descriptor on dossier type We don't want to expose full demarche type on dossiers because it would open the door for recursive queries that we want to avoid. DemarcheDescriptorType is a lightweight representation of demarche metadata. --- app/graphql/schema.graphql | 69 +++++++++++++++++-- app/graphql/types/demarche_descriptor_type.rb | 24 +++++++ app/graphql/types/demarche_type.rb | 10 +-- app/graphql/types/dossier_type.rb | 2 + .../api/v2/graphql_controller_spec.rb | 10 +++ 5 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 app/graphql/types/demarche_descriptor_type.rb diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 6e140c7c7..c1620765c 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -406,7 +406,7 @@ interface Demandeur { } """ -Une demarche +Une démarche """ type Demarche { annotationDescriptors: [ChampDescriptor!]! @@ -438,7 +438,7 @@ type Demarche { datePublication: ISO8601DateTime """ - L’état de dossier pour une démarche déclarative + Pour une démarche déclarative, état cible des dossiers à valider automatiquement """ declarative: DossierDeclarativeState @@ -551,7 +551,7 @@ type Demarche { id: ID! """ - Le numero de la démarche. + Numero de la démarche. """ number: Int! publishedRevision: Revision @@ -559,12 +559,70 @@ type Demarche { service: Service! """ - L’état de la démarche. + État de la démarche. """ state: DemarcheState! """ - Le titre de la démarche. + Titre de la démarche. + """ + title: String! +} + +""" +Une démarche (métadonnées) +Ceci est une version abrégée du type `Demarche`, qui n’expose que les métadonnées. +Cela évite l’accès récursif aux dossiers. +""" +type DemarcheDescriptor { + """ + Date de la création. + """ + dateCreation: ISO8601DateTime! + + """ + Date de la dépublication. + """ + dateDepublication: ISO8601DateTime + + """ + Date de la dernière modification. + """ + dateDerniereModification: ISO8601DateTime! + + """ + Date de la fermeture. + """ + dateFermeture: ISO8601DateTime + + """ + Date de la publication. + """ + datePublication: ISO8601DateTime + + """ + Pour une démarche déclarative, état cible des dossiers à valider automatiquement + """ + declarative: DossierDeclarativeState + + """ + Description de la démarche. + """ + description: String! + id: ID! + + """ + Numero de la démarche. + """ + number: Int! + + """ + État de la démarche. + """ + state: DemarcheState! + + """ + Titre de la démarche. """ title: String! } @@ -650,6 +708,7 @@ type Dossier { """ dateTraitement: ISO8601DateTime demandeur: Demandeur! + demarche: DemarcheDescriptor! """ L’URL du GeoJSON contenant les données cartographiques du dossier. diff --git a/app/graphql/types/demarche_descriptor_type.rb b/app/graphql/types/demarche_descriptor_type.rb new file mode 100644 index 000000000..8090f0593 --- /dev/null +++ b/app/graphql/types/demarche_descriptor_type.rb @@ -0,0 +1,24 @@ +module Types + class DemarcheDescriptorType < Types::BaseObject + description "Une démarche (métadonnées) +Ceci est une version abrégée du type `Demarche`, qui n’expose que les métadonnées. +Cela évite l’accès récursif aux dossiers." + + global_id_field :id + field :number, Int, "Numero de la démarche.", null: false, method: :id + field :title, String, "Titre de la démarche.", null: false, method: :libelle + field :description, String, "Description de la démarche.", null: false + field :state, Types::DemarcheType::DemarcheState, "État de la démarche.", null: false + field :declarative, Types::DemarcheType::DossierDeclarativeState, "Pour une démarche déclarative, état cible des dossiers à valider automatiquement", null: true, method: :declarative_with_state + + field :date_creation, GraphQL::Types::ISO8601DateTime, "Date de la création.", null: false, method: :created_at + field :date_publication, GraphQL::Types::ISO8601DateTime, "Date de la publication.", null: true, method: :published_at + field :date_derniere_modification, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification.", null: false, method: :updated_at + field :date_depublication, GraphQL::Types::ISO8601DateTime, "Date de la dépublication.", null: true, method: :unpublished_at + field :date_fermeture, GraphQL::Types::ISO8601DateTime, "Date de la fermeture.", null: true, method: :closed_at + + def state + object.aasm.current_state + end + end +end diff --git a/app/graphql/types/demarche_type.rb b/app/graphql/types/demarche_type.rb index 3202fed20..4c69ea966 100644 --- a/app/graphql/types/demarche_type.rb +++ b/app/graphql/types/demarche_type.rb @@ -14,14 +14,14 @@ module Types end end - description "Une demarche" + description "Une démarche" global_id_field :id - field :number, Int, "Le numero de la démarche.", null: false, method: :id - field :title, String, "Le titre de la démarche.", null: false, method: :libelle + field :number, Int, "Numero de la démarche.", null: false, method: :id + field :title, String, "Titre de la démarche.", null: false, method: :libelle field :description, String, "Description de la démarche.", null: false - field :state, DemarcheState, "L’état de la démarche.", null: false - field :declarative, DossierDeclarativeState, "L’état de dossier pour une démarche déclarative", null: true, method: :declarative_with_state + field :state, DemarcheState, "État de la démarche.", null: false + field :declarative, DossierDeclarativeState, "Pour une démarche déclarative, état cible des dossiers à valider automatiquement", null: true, method: :declarative_with_state field :date_creation, GraphQL::Types::ISO8601DateTime, "Date de la création.", null: false, method: :created_at field :date_publication, GraphQL::Types::ISO8601DateTime, "Date de la publication.", null: true, method: :published_at diff --git a/app/graphql/types/dossier_type.rb b/app/graphql/types/dossier_type.rb index 3e9ecec5a..16e08aff1 100644 --- a/app/graphql/types/dossier_type.rb +++ b/app/graphql/types/dossier_type.rb @@ -12,6 +12,8 @@ module Types field :number, Int, "Le numero du dossier.", null: false, method: :id field :state, DossierState, "L’état du dossier.", null: false + field :demarche, Types::DemarcheDescriptorType, null: false, method: :procedure + field :date_passage_en_construction, GraphQL::Types::ISO8601DateTime, "Date de dépôt.", null: false, method: :en_construction_at field :date_passage_en_instruction, GraphQL::Types::ISO8601DateTime, "Date de passage en instruction.", null: true, method: :en_instruction_at field :date_traitement, GraphQL::Types::ISO8601DateTime, "Date de traitement.", null: true, method: :processed_at diff --git a/spec/controllers/api/v2/graphql_controller_spec.rb b/spec/controllers/api/v2/graphql_controller_spec.rb index ee0bf80b4..831786fb5 100644 --- a/spec/controllers/api/v2/graphql_controller_spec.rb +++ b/spec/controllers/api/v2/graphql_controller_spec.rb @@ -310,6 +310,11 @@ describe API::V2::GraphqlController do motivationAttachment { url } + demarche { + number + title + state + } usager { id email @@ -382,6 +387,11 @@ describe API::V2::GraphqlController do dateTraitement: nil, motivation: nil, motivationAttachment: nil, + demarche: { + number: dossier.procedure.id, + title: dossier.procedure.libelle, + state: 'publiee' + }, usager: { id: dossier.user.to_typed_id, email: dossier.user.email From 8e1bfb469f8a33aaaf1fd1a52993866883ca1533 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 10:14:23 +0200 Subject: [PATCH 10/18] fix(dossier): send expiration notifications 2 weeks prior to supression instead of a month --- app/models/dossier.rb | 2 +- .../fr.yml | 8 ++--- .../notify_near_deletion_to_user/fr.yml | 4 +-- spec/mailers/dossier_mailer_spec.rb | 8 ++--- spec/models/dossier_spec.rb | 6 ++-- .../expired_dossiers_deletion_service_spec.rb | 34 +++++++++---------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 902dada56..3a1958cb3 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -57,7 +57,7 @@ class Dossier < ApplicationRecord REMAINING_DAYS_BEFORE_CLOSING = 2 INTERVAL_BEFORE_CLOSING = "#{REMAINING_DAYS_BEFORE_CLOSING} days" - INTERVAL_BEFORE_EXPIRATION = '1 month' + INTERVAL_BEFORE_EXPIRATION = '2 weeks' INTERVAL_EXPIRATION = '1 month 5 days' has_one :etablissement, dependent: :destroy diff --git a/config/locales/views/dossier_mailer/notify_near_deletion_to_administration/fr.yml b/config/locales/views/dossier_mailer/notify_near_deletion_to_administration/fr.yml index c1bd54250..6e679332f 100644 --- a/config/locales/views/dossier_mailer/notify_near_deletion_to_administration/fr.yml +++ b/config/locales/views/dossier_mailer/notify_near_deletion_to_administration/fr.yml @@ -14,8 +14,8 @@ fr: one: "Le dossier suivant dont le traitement est terminé sera bientôt automatiquement supprimé :" other: "Les dossiers suivant dont le traitement est terminé seront bientôt automatiquement supprimés :" footer_en_construction: - one: "Vous avez un mois pour commencer l’instruction du dossier." - other: "Vous avez un mois pour commencer l’instruction des dossiers." + one: "Vous avez deux semaines pour commencer l’instruction du dossier." + other: "Vous avez deux semaines pour commencer l’instruction des dossiers." footer_termine: - one: "Vous avez un mois pour archiver le dossier." - other: "Vous avez un mois pour archiver les dossiers." + one: "Vous avez deux semaines pour archiver le dossier." + other: "Vous avez deux semaines pour archiver les dossiers." diff --git a/config/locales/views/dossier_mailer/notify_near_deletion_to_user/fr.yml b/config/locales/views/dossier_mailer/notify_near_deletion_to_user/fr.yml index f168c63dc..32b3aa810 100644 --- a/config/locales/views/dossier_mailer/notify_near_deletion_to_user/fr.yml +++ b/config/locales/views/dossier_mailer/notify_near_deletion_to_user/fr.yml @@ -14,8 +14,8 @@ fr: one: "Afin de limiter la conservation de vos données personnelles, le dossier suivant dont le traitement est terminé sera bientôt automatiquement supprimé :" other: "Afin de limiter la conservation de vos données personnelles, les dossiers suivant dont le traitement est terminé seront bientôt automatiquement supprimés :" footer: - one: "Vous pouvez retrouver votre dossier pendant encore un mois. Vous n’avez rien à faire." - other: "Vous pouvez retrouver vos dossiers pendant encore un mois. Vous n’avez rien à faire." + one: "Vous pouvez retrouver votre dossier pendant encore deux semaines. Vous n’avez rien à faire." + other: "Vous pouvez retrouver vos dossiers pendant encore deux semaines. Vous n’avez rien à faire." footer_en_construction: one: "Si vous souhaitez conserver votre dossier plus longtemps, vous pouvez prolonger sa durée de conservation dans l’interface." other: "Si vous souhaitez conserver vos dossiers plus longtemps, vous pouvez prolonger leur durée de conservation au cas par cas dans l’interface." diff --git a/spec/mailers/dossier_mailer_spec.rb b/spec/mailers/dossier_mailer_spec.rb index db4598fa7..e68a073ee 100644 --- a/spec/mailers/dossier_mailer_spec.rb +++ b/spec/mailers/dossier_mailer_spec.rb @@ -151,7 +151,7 @@ RSpec.describe DossierMailer, type: :mailer do it { expect(subject.body).to include("n° #{dossier.id} ") } it { expect(subject.body).to include(dossier.procedure.libelle) } it { expect(subject.body).to include("PDF") } - it { expect(subject.body).to include("Vous avez un mois pour commencer l’instruction du dossier.") } + it { expect(subject.body).to include("Vous avez deux semaines pour commencer l’instruction du dossier.") } end describe 'termine' do @@ -163,7 +163,7 @@ RSpec.describe DossierMailer, type: :mailer do it { expect(subject.body).to include("n° #{dossier.id} ") } it { expect(subject.body).to include(dossier.procedure.libelle) } it { expect(subject.body).to include("PDF") } - it { expect(subject.body).to include("Vous avez un mois pour archiver le dossier.") } + it { expect(subject.body).to include("Vous avez deux semaines pour archiver le dossier.") } end end @@ -178,7 +178,7 @@ RSpec.describe DossierMailer, type: :mailer do it { expect(subject.body).to include("n° #{dossier.id} ") } it { expect(subject.body).to include(dossier.procedure.libelle) } it { expect(subject.body).to include("PDF") } - it { expect(subject.body).to include("Vous pouvez retrouver votre dossier pendant encore un mois. Vous n’avez rien à faire.") } + it { expect(subject.body).to include("Vous pouvez retrouver votre dossier pendant encore deux semaines. Vous n’avez rien à faire.") } it { expect(subject.body).to include("Si vous souhaitez conserver votre dossier plus longtemps, vous pouvez prolonger sa durée de conservation dans l’interface.") } end @@ -192,7 +192,7 @@ RSpec.describe DossierMailer, type: :mailer do it { expect(subject.body).to include("n° #{dossier.id} ") } it { expect(subject.body).to include(dossier.procedure.libelle) } it { expect(subject.body).to include("PDF") } - it { expect(subject.body).to include("Vous pouvez retrouver votre dossier pendant encore un mois. Vous n’avez rien à faire.") } + it { expect(subject.body).to include("Vous pouvez retrouver votre dossier pendant encore deux semaines. Vous n’avez rien à faire.") } end end diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index 1a3521090..213cef8b0 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -40,7 +40,7 @@ describe Dossier do describe 'brouillon_close_to_expiration' do let(:procedure) { create(:procedure, :published, duree_conservation_dossiers_dans_ds: 6) } let!(:young_dossier) { create(:dossier, :en_construction, procedure: procedure) } - let!(:expiring_dossier) { create(:dossier, created_at: 170.days.ago, procedure: procedure) } + let!(:expiring_dossier) { create(:dossier, created_at: 175.days.ago, procedure: procedure) } let!(:just_expired_dossier) { create(:dossier, created_at: (6.months + 1.hour + 10.seconds).ago, procedure: procedure) } let!(:long_expired_dossier) { create(:dossier, created_at: 1.year.ago, procedure: procedure) } @@ -66,7 +66,7 @@ describe Dossier do describe 'en_construction_close_to_expiration' do let(:procedure) { create(:procedure, :published, duree_conservation_dossiers_dans_ds: 6) } let!(:young_dossier) { create(:dossier, procedure: procedure) } - let!(:expiring_dossier) { create(:dossier, :en_construction, en_construction_at: 170.days.ago, procedure: procedure) } + let!(:expiring_dossier) { create(:dossier, :en_construction, en_construction_at: 175.days.ago, procedure: procedure) } let!(:just_expired_dossier) { create(:dossier, :en_construction, en_construction_at: (6.months + 1.hour + 10.seconds).ago, procedure: procedure) } let!(:long_expired_dossier) { create(:dossier, :en_construction, en_construction_at: 1.year.ago, procedure: procedure) } @@ -92,7 +92,7 @@ describe Dossier do describe 'en_instruction_close_to_expiration' do let(:procedure) { create(:procedure, :published, duree_conservation_dossiers_dans_ds: 6) } let!(:young_dossier) { create(:dossier, procedure: procedure) } - let!(:expiring_dossier) { create(:dossier, :en_instruction, en_instruction_at: 170.days.ago, procedure: procedure) } + let!(:expiring_dossier) { create(:dossier, :en_instruction, en_instruction_at: 175.days.ago, procedure: procedure) } let!(:just_expired_dossier) { create(:dossier, :en_instruction, en_instruction_at: (6.months + 1.hour + 10.seconds).ago, procedure: procedure) } let!(:long_expired_dossier) { create(:dossier, :en_instruction, en_instruction_at: 1.year.ago, procedure: procedure) } diff --git a/spec/services/expired_dossiers_deletion_service_spec.rb b/spec/services/expired_dossiers_deletion_service_spec.rb index 97de70859..69a5944f1 100644 --- a/spec/services/expired_dossiers_deletion_service_spec.rb +++ b/spec/services/expired_dossiers_deletion_service_spec.rb @@ -8,7 +8,7 @@ describe ExpiredDossiersDeletionService do describe '#process_expired_dossiers_brouillon' do let(:today) { Time.zone.now.at_midnight } - let(:date_close_to_expiration) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 1.month } + let(:date_close_to_expiration) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 2.weeks } let(:date_expired) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months - 6.days } let(:date_not_expired) { Date.today - procedure.duree_conservation_dossiers_dans_ds.months + 2.months } @@ -56,15 +56,15 @@ describe ExpiredDossiersDeletionService do before { ExpiredDossiersDeletionService.send_brouillon_expiration_notices } - context 'when the dossier is not closed to expiration' do - let(:created_at) { (conservation_par_defaut - 1.month - 1.day).ago } + context 'when the dossier is not close to expiration' do + let(:created_at) { (conservation_par_defaut - 2.weeks - 1.day).ago } it { expect(dossier.reload.brouillon_close_to_expiration_notice_sent_at).to be_nil } it { expect(DossierMailer).not_to have_received(:notify_brouillon_near_deletion) } end - context 'when the dossier is closed to expiration' do - let(:created_at) { (conservation_par_defaut - 1.month + 1.day).ago } + context 'when the dossier is close to expiration' do + let(:created_at) { (conservation_par_defaut - 2.weeks + 1.day).ago } it { expect(dossier.reload.brouillon_close_to_expiration_notice_sent_at).not_to be_nil } it { expect(DossierMailer).to have_received(:notify_brouillon_near_deletion).once } @@ -73,8 +73,8 @@ describe ExpiredDossiersDeletionService do end context 'with 2 dossiers to notice' do - let!(:dossier_1) { create(:dossier, procedure: procedure, user: user, created_at: (conservation_par_defaut - 1.month + 1.day).ago) } - let!(:dossier_2) { create(:dossier, procedure: procedure_2, user: user, created_at: (conservation_par_defaut - 1.month + 1.day).ago) } + let!(:dossier_1) { create(:dossier, procedure: procedure, user: user, created_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } + let!(:dossier_2) { create(:dossier, procedure: procedure_2, user: user, created_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } before { ExpiredDossiersDeletionService.send_brouillon_expiration_notices } @@ -146,7 +146,7 @@ describe ExpiredDossiersDeletionService do before { ExpiredDossiersDeletionService.send_en_construction_expiration_notices } context 'when the dossier is not near deletion' do - let(:en_construction_at) { (conservation_par_defaut - 1.month - 1.day).ago } + let(:en_construction_at) { (conservation_par_defaut - 2.weeks - 1.day).ago } it { expect(dossier.reload.en_construction_close_to_expiration_notice_sent_at).to be_nil } it { expect(DossierMailer).not_to have_received(:notify_near_deletion_to_user) } @@ -154,7 +154,7 @@ describe ExpiredDossiersDeletionService do end context 'when the dossier is near deletion' do - let(:en_construction_at) { (conservation_par_defaut - 1.month + 1.day).ago } + let(:en_construction_at) { (conservation_par_defaut - 2.weeks + 1.day).ago } it { expect(dossier.reload.en_construction_close_to_expiration_notice_sent_at).not_to be_nil } @@ -167,8 +167,8 @@ describe ExpiredDossiersDeletionService do end context 'with 2 dossiers to notice' do - let!(:dossier_1) { create(:dossier, :en_construction, procedure: procedure, user: user, en_construction_at: (conservation_par_defaut - 1.month + 1.day).ago) } - let!(:dossier_2) { create(:dossier, :en_construction, procedure: procedure_2, user: user, en_construction_at: (conservation_par_defaut - 1.month + 1.day).ago) } + let!(:dossier_1) { create(:dossier, :en_construction, procedure: procedure, user: user, en_construction_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } + let!(:dossier_2) { create(:dossier, :en_construction, procedure: procedure_2, user: user, en_construction_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } let!(:instructeur) { create(:instructeur) } @@ -187,7 +187,7 @@ describe ExpiredDossiersDeletionService do context 'when an instructeur is also administrateur' do let!(:administrateur) { procedure.administrateurs.first } - let!(:dossier) { create(:dossier, :en_construction, procedure: procedure, en_construction_at: (conservation_par_defaut - 1.month + 1.day).ago) } + let!(:dossier) { create(:dossier, :en_construction, procedure: procedure, en_construction_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } before do administrateur.instructeur.followed_dossiers << dossier @@ -290,7 +290,7 @@ describe ExpiredDossiersDeletionService do before { ExpiredDossiersDeletionService.send_termine_expiration_notices } context 'when the dossier is not near deletion' do - let(:processed_at) { (conservation_par_defaut - 1.month - 1.day).ago } + let(:processed_at) { (conservation_par_defaut - 2.weeks - 1.day).ago } it { expect(dossier.reload.termine_close_to_expiration_notice_sent_at).to be_nil } it { expect(DossierMailer).not_to have_received(:notify_near_deletion_to_user) } @@ -298,7 +298,7 @@ describe ExpiredDossiersDeletionService do end context 'when the dossier is near deletion' do - let(:processed_at) { (conservation_par_defaut - 1.month + 1.day).ago } + let(:processed_at) { (conservation_par_defaut - 2.weeks + 1.day).ago } it { expect(dossier.reload.termine_close_to_expiration_notice_sent_at).not_to be_nil } @@ -311,8 +311,8 @@ describe ExpiredDossiersDeletionService do end context 'with 2 dossiers to notice' do - let!(:dossier_1) { create(:dossier, :accepte, procedure: procedure, user: user, processed_at: (conservation_par_defaut - 1.month + 1.day).ago) } - let!(:dossier_2) { create(:dossier, :accepte, procedure: procedure_2, user: user, processed_at: (conservation_par_defaut - 1.month + 1.day).ago) } + let!(:dossier_1) { create(:dossier, :accepte, procedure: procedure, user: user, processed_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } + let!(:dossier_2) { create(:dossier, :accepte, procedure: procedure_2, user: user, processed_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } let!(:instructeur) { create(:instructeur) } @@ -331,7 +331,7 @@ describe ExpiredDossiersDeletionService do context 'when an instructeur is also administrateur' do let!(:administrateur) { procedure.administrateurs.first } - let!(:dossier) { create(:dossier, :accepte, procedure: procedure, processed_at: (conservation_par_defaut - 1.month + 1.day).ago) } + let!(:dossier) { create(:dossier, :accepte, procedure: procedure, processed_at: (conservation_par_defaut - 2.weeks + 1.day).ago) } before do administrateur.instructeur.followed_dossiers << dossier From 8c6978c0cb2cabe81edde5aaeafdc2c8cb19d162 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 09:50:28 +0200 Subject: [PATCH 11/18] feat(i18n): translate devise related emails --- .../confirmation_instructions.en.html.haml | 23 ++++++++++++++++++ .../devise_mailer/email_changed.en.html.haml | 14 +++++++++++ .../password_change.en.html.haml | 9 +++++++ .../reset_password_instructions.en.html.haml | 12 ++++++++++ .../unlock_instructions.en.html.haml | 15 ++++++++++++ .../notify_new_draft.en.html.haml | 24 +++++++++++++++++++ .../layouts/mailers/_signature.html.haml | 2 +- config/locales/en.yml | 2 ++ config/locales/fr.yml | 2 ++ 9 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 app/views/devise_mailer/confirmation_instructions.en.html.haml create mode 100644 app/views/devise_mailer/email_changed.en.html.haml create mode 100644 app/views/devise_mailer/password_change.en.html.haml create mode 100644 app/views/devise_mailer/reset_password_instructions.en.html.haml create mode 100644 app/views/devise_mailer/unlock_instructions.en.html.haml create mode 100644 app/views/dossier_mailer/notify_new_draft.en.html.haml diff --git a/app/views/devise_mailer/confirmation_instructions.en.html.haml b/app/views/devise_mailer/confirmation_instructions.en.html.haml new file mode 100644 index 000000000..ec5d38fd4 --- /dev/null +++ b/app/views/devise_mailer/confirmation_instructions.en.html.haml @@ -0,0 +1,23 @@ +-# ugly hack to know if the mail is creation confirmation or a password change confirmation +- if @user.unconfirmed_email.nil? + - content_for(:title, 'Activate account') + + %p + Dear Sir or Madam, + + %p + You have entered your details to create an account on #{APPLICATION_NAME}. To confirm your email and finish creating your account, select the following link: + - link = confirmation_url(@user, confirmation_token: @token, procedure_id: @procedure&.id) + = link_to(link, link) + +- else + - content_for(:title, "Change email address") + + %p + Dear Sir or Madam, + + %p + To confirm your account email change on #{APPLICATION_NAME}, select the following link: + = link_to(confirmation_url(@user, confirmation_token: @token), confirmation_url(@user, confirmation_token: @token)) + += render partial: "layouts/mailers/signature" diff --git a/app/views/devise_mailer/email_changed.en.html.haml b/app/views/devise_mailer/email_changed.en.html.haml new file mode 100644 index 000000000..644a59424 --- /dev/null +++ b/app/views/devise_mailer/email_changed.en.html.haml @@ -0,0 +1,14 @@ +- content_for(:title, 'New email address') + +%p + Dear Sir or Madam, + +- unconfirmed_email = @resource.try(:unconfirmed_email?) +- if unconfirmed_email.present? + %p + We recieved a request to change the email address associated with your account #{@email} on #{APPLICATION_NAME}. The new email address will be #{unconfirmed_email}. +- else + %p + A change to the email address associated with your account #{@email} was made on #{APPLICATION_NAME}. You can now connect with the email address #{@resource.email}. + += render partial: "layouts/mailers/signature" diff --git a/app/views/devise_mailer/password_change.en.html.haml b/app/views/devise_mailer/password_change.en.html.haml new file mode 100644 index 000000000..1cdfac54d --- /dev/null +++ b/app/views/devise_mailer/password_change.en.html.haml @@ -0,0 +1,9 @@ +- content_for(:title, 'New password') + +%p + Dear Sir or Madam, + +%p + A request to change your password on #{APPLICATION_NAME} for the account #{@resource.email} was successfully processed. + += render partial: "layouts/mailers/signature" diff --git a/app/views/devise_mailer/reset_password_instructions.en.html.haml b/app/views/devise_mailer/reset_password_instructions.en.html.haml new file mode 100644 index 000000000..be27aee1a --- /dev/null +++ b/app/views/devise_mailer/reset_password_instructions.en.html.haml @@ -0,0 +1,12 @@ +%p + Dear Sir or Madam, + +%p + Someone has requested to change your account password on #{APPLICATION_NAME}. To define a new password, select the following link: + += round_button 'Change the password', edit_password_url(@resource, reset_password_token: @token), :primary + +%p + If you didn't request this, please ignore this email. Your password won't change. + += render partial: "layouts/mailers/signature" diff --git a/app/views/devise_mailer/unlock_instructions.en.html.haml b/app/views/devise_mailer/unlock_instructions.en.html.haml new file mode 100644 index 000000000..ead124008 --- /dev/null +++ b/app/views/devise_mailer/unlock_instructions.en.html.haml @@ -0,0 +1,15 @@ +- content_for(:title, 'Reactivate account') + +%p + Dear Sir or Madam, + +%p + Someone made too many unsuccessful attempts to connect to your account #{@resource.email} on #{APPLICATION_NAME}. + As a security measure, we temporarily locked access to your account. + +%p + To unlock access to your account, select the following link: + +%p= link_to 'Unlock account', unlock_url(@resource, unlock_token: @token) + += render partial: "layouts/mailers/signature" diff --git a/app/views/dossier_mailer/notify_new_draft.en.html.haml b/app/views/dossier_mailer/notify_new_draft.en.html.haml new file mode 100644 index 000000000..f3e6b1e8f --- /dev/null +++ b/app/views/dossier_mailer/notify_new_draft.en.html.haml @@ -0,0 +1,24 @@ +- content_for :procedure_logo do + = render 'layouts/mailers/logo', url: @logo_url + +%p + Dear Sir or Madam, + +%p + You started filling a File on the procedure: + = succeed '.' do + %strong « #{@dossier.procedure.libelle} » + +%p + You can access your File, to review or complete, by clicking on the following button: + += round_button('Access your File', dossier_url(@dossier), :primary) + +- if @dossier.procedure.auto_archive_on + %p + Your File needs to be submitted before #{procedure_auto_archive_datetime(@dossier.procedure)}. + += render 'layouts/mailers/signature' + +- content_for :footer do + = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier diff --git a/app/views/layouts/mailers/_signature.html.haml b/app/views/layouts/mailers/_signature.html.haml index 985288c7b..7273cd7b5 100644 --- a/app/views/layouts/mailers/_signature.html.haml +++ b/app/views/layouts/mailers/_signature.html.haml @@ -1,5 +1,5 @@ %p - Bonne journée, + = t(:best_regards, scope: [:layouts, :signature]) %br - if defined?(service) && service && service.nom.present? = service.nom diff --git a/config/locales/en.yml b/config/locales/en.yml index 95f01432b..7afc13b1f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -53,6 +53,8 @@ en: line3: administrative forms. locale_dropdown: languages: "Languages" + signature: + best_regards: Best Regards, views: commencer: show: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5a2797a64..e446339a3 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -43,6 +43,8 @@ fr: line3: administratifs dématérialisés. locale_dropdown: languages: "Langues" + signature: + best_regards: Bonne journée, views: commencer: show: From ff575db4b3d3df9d51e573d31e4c8f72473d2048 Mon Sep 17 00:00:00 2001 From: lydiasan <> Date: Thu, 26 Aug 2021 14:56:12 +0200 Subject: [PATCH 12/18] i18n: request new password translation --- app/views/users/passwords/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index e70a5f128..0f7ea8480 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -16,4 +16,4 @@ = f.label :email, 'Email' = f.email_field :email, autofocus: true - = f.submit 'Demander un nouveau mot de passe', class: 'button expand primary' + = f.submit t('devise.passwords.edit.new_password'), class: 'button expand primary' From 156b9894fe5d32d50bb27b827ec286e12f7d6740 Mon Sep 17 00:00:00 2001 From: lydiasan <> Date: Thu, 26 Aug 2021 17:43:00 +0200 Subject: [PATCH 13/18] ajout des traductions pour la demande de mdp --- app/views/users/passwords/new.html.haml | 2 +- config/locales/devise.en.yml | 5 +++++ config/locales/devise.fr.yml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 config/locales/devise.en.yml create mode 100644 config/locales/devise.fr.yml diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 0f7ea8480..ec02b04e2 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -16,4 +16,4 @@ = f.label :email, 'Email' = f.email_field :email, autofocus: true - = f.submit t('devise.passwords.edit.new_password'), class: 'button expand primary' + = f.submit t('devise.passwords.new.request_new_password'), class: 'button expand primary' diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml new file mode 100644 index 000000000..9a8aea664 --- /dev/null +++ b/config/locales/devise.en.yml @@ -0,0 +1,5 @@ +en: + devise: + passwords: + new: + request_new_password: Request new password diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml new file mode 100644 index 000000000..098f3e3f3 --- /dev/null +++ b/config/locales/devise.fr.yml @@ -0,0 +1,5 @@ +fr: + devise: + passwords: + new: + request_new_password: Demander un nouveau mot de passe From 6eb072e69fa86546a0c0a06fcc1120a554d2ee9d Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 12:40:20 +0200 Subject: [PATCH 14/18] feat(i18n): translate email greetings --- .../devise_mailer/confirmation_instructions.en.html.haml | 6 ++---- app/views/devise_mailer/confirmation_instructions.html.haml | 6 ++---- app/views/devise_mailer/email_changed.en.html.haml | 3 +-- app/views/devise_mailer/email_changed.html.haml | 3 +-- app/views/devise_mailer/password_change.en.html.haml | 3 +-- app/views/devise_mailer/password_change.html.haml | 3 +-- .../devise_mailer/reset_password_instructions.en.html.haml | 3 +-- .../devise_mailer/reset_password_instructions.html.haml | 3 +-- app/views/devise_mailer/unlock_instructions.en.html.haml | 3 +-- app/views/devise_mailer/unlock_instructions.html.haml | 3 +-- .../notify_automatic_deletion_to_administration.html.haml | 3 +-- .../notify_automatic_deletion_to_user.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_deletion.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_near_deletion.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_not_submitted.html.haml | 3 +-- .../notify_deletion_to_administration.html.haml | 3 +-- app/views/dossier_mailer/notify_deletion_to_user.html.haml | 3 +-- .../notify_groupe_instructeur_changed.html.haml | 2 ++ .../notify_instructeur_deletion_to_user.html.haml | 3 +-- .../notify_near_deletion_to_administration.html.haml | 3 +-- .../dossier_mailer/notify_near_deletion_to_user.html.haml | 3 +-- app/views/dossier_mailer/notify_new_answer.html.haml | 3 +-- .../notify_new_commentaire_to_instructeur.html.haml | 3 +-- .../notify_new_dossier_depose_to_instructeur.html.haml | 3 +-- app/views/dossier_mailer/notify_new_draft.en.html.haml | 3 +-- app/views/dossier_mailer/notify_new_draft.html.haml | 3 +-- .../dossier_mailer/notify_revert_to_instruction.html.haml | 3 +-- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 29 files changed, 32 insertions(+), 56 deletions(-) diff --git a/app/views/devise_mailer/confirmation_instructions.en.html.haml b/app/views/devise_mailer/confirmation_instructions.en.html.haml index ec5d38fd4..63f5525bb 100644 --- a/app/views/devise_mailer/confirmation_instructions.en.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.en.html.haml @@ -2,8 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activate account') - %p - Dear Sir or Madam, + %p= t(:greeting, scope: [:layouts, :signature]) %p You have entered your details to create an account on #{APPLICATION_NAME}. To confirm your email and finish creating your account, select the following link: @@ -13,8 +12,7 @@ - else - content_for(:title, "Change email address") - %p - Dear Sir or Madam, + %p= t(:greeting, scope: [:layouts, :signature]) %p To confirm your account email change on #{APPLICATION_NAME}, select the following link: diff --git a/app/views/devise_mailer/confirmation_instructions.html.haml b/app/views/devise_mailer/confirmation_instructions.html.haml index 25710acc4..1c091764f 100644 --- a/app/views/devise_mailer/confirmation_instructions.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.html.haml @@ -2,8 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activez votre compte') - %p - Bonjour, + %p= t(:greeting, scope: [:layouts, :signature]) %p Pour activer votre compte sur #{APPLICATION_NAME}, veuillez cliquer sur le lien suivant : @@ -13,8 +12,7 @@ - else - content_for(:title, "Changement d’adresse email") - %p - Bonjour, + %p= t(:greeting, scope: [:layouts, :signature]) %p Pour confirmer votre changement d’adresse email, veuillez cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/email_changed.en.html.haml b/app/views/devise_mailer/email_changed.en.html.haml index 644a59424..e60c5bc43 100644 --- a/app/views/devise_mailer/email_changed.en.html.haml +++ b/app/views/devise_mailer/email_changed.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'New email address') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/email_changed.html.haml b/app/views/devise_mailer/email_changed.html.haml index e8db96fe0..51ba99204 100644 --- a/app/views/devise_mailer/email_changed.html.haml +++ b/app/views/devise_mailer/email_changed.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Votre nouvelle adresse email') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/password_change.en.html.haml b/app/views/devise_mailer/password_change.en.html.haml index 1cdfac54d..845357aed 100644 --- a/app/views/devise_mailer/password_change.en.html.haml +++ b/app/views/devise_mailer/password_change.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'New password') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p A request to change your password on #{APPLICATION_NAME} for the account #{@resource.email} was successfully processed. diff --git a/app/views/devise_mailer/password_change.html.haml b/app/views/devise_mailer/password_change.html.haml index 02c297634..0a4531a3e 100644 --- a/app/views/devise_mailer/password_change.html.haml +++ b/app/views/devise_mailer/password_change.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Votre nouveau mot de passe') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p La demande de changement de mot de passe pour votre compte #{@resource.email} sur diff --git a/app/views/devise_mailer/reset_password_instructions.en.html.haml b/app/views/devise_mailer/reset_password_instructions.en.html.haml index be27aee1a..774610c4a 100644 --- a/app/views/devise_mailer/reset_password_instructions.en.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.en.html.haml @@ -1,5 +1,4 @@ -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p Someone has requested to change your account password on #{APPLICATION_NAME}. To define a new password, select the following link: diff --git a/app/views/devise_mailer/reset_password_instructions.html.haml b/app/views/devise_mailer/reset_password_instructions.html.haml index 051a5d054..72db8073d 100644 --- a/app/views/devise_mailer/reset_password_instructions.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.html.haml @@ -1,5 +1,4 @@ -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Vous avez demandé à changer votre mot de passe sur #{APPLICATION_NAME}. Pour ceci, merci de cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/unlock_instructions.en.html.haml b/app/views/devise_mailer/unlock_instructions.en.html.haml index ead124008..092071373 100644 --- a/app/views/devise_mailer/unlock_instructions.en.html.haml +++ b/app/views/devise_mailer/unlock_instructions.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Reactivate account') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p Someone made too many unsuccessful attempts to connect to your account #{@resource.email} on #{APPLICATION_NAME}. diff --git a/app/views/devise_mailer/unlock_instructions.html.haml b/app/views/devise_mailer/unlock_instructions.html.haml index 123009049..5f883f21e 100644 --- a/app/views/devise_mailer/unlock_instructions.html.haml +++ b/app/views/devise_mailer/unlock_instructions.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Réactivez votre compte') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Quelqu’un a tenté de se connecter un grand nombre de fois sans succès à votre diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml index 373b78d11..042d4916d 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml index bf35cabe2..e3264eec3 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml index a621b7009..a7af936c2 100644 --- a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @dossier_hashes.count) diff --git a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml index bce0ad8dc..3c9e3389d 100644 --- a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml index dfc1f4610..ac0ca1042 100644 --- a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Le dossier n°#{@dossier.id} pour la démarche «  diff --git a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml index e64cab4b6..f95a80e08 100644 --- a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_deletion_to_user.html.haml index e64cab4b6..f95a80e08 100644 --- a/app/views/dossier_mailer/notify_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml index f87c675f9..bc04bc8e6 100644 --- a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml +++ b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml @@ -1,5 +1,7 @@ - content_for(:title, "#{@subject}") +%p= t(:greeting, scope: [:layouts, :signature]) + %p = "Vous suiviez jusqu'à maintenant le dossier n°#{@dossier_id} de la démarche #{@demarche}." L’usager a modifié le groupe de routage. Son dossier appartient maintenant à un groupe instructeur dont vous ne faites pas partie. diff --git a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml index 0dde82206..2031e390c 100644 --- a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body_html', dossier_id: @deleted_dossier.dossier_id, libelle_demarche: @deleted_dossier.procedure.libelle, deleted_dossiers_link: dossiers_url(statut: 'dossiers-supprimes')) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml index 485757f6d..af16fd23c 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml index a4af7f504..3813ea154 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_new_answer.html.haml b/app/views/dossier_mailer/notify_new_answer.html.haml index de623db62..e8397babe 100644 --- a/app/views/dossier_mailer/notify_new_answer.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) - if !@dossier.brouillon? %p diff --git a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml index cfb294aa6..85060326a 100644 --- a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml index 1d05aa596..fd3c4e2a8 100644 --- a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_draft.en.html.haml b/app/views/dossier_mailer/notify_new_draft.en.html.haml index f3e6b1e8f..8d6a2404a 100644 --- a/app/views/dossier_mailer/notify_new_draft.en.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.en.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p You started filling a File on the procedure: diff --git a/app/views/dossier_mailer/notify_new_draft.html.haml b/app/views/dossier_mailer/notify_new_draft.html.haml index 4553738bf..2a6c8ce5b 100644 --- a/app/views/dossier_mailer/notify_new_draft.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Vous avez commencé à remplir un dossier pour la démarche diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml index f5b8caa5e..4f0388899 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque. diff --git a/config/locales/en.yml b/config/locales/en.yml index 7afc13b1f..6f544e646 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -54,6 +54,7 @@ en: locale_dropdown: languages: "Languages" signature: + greeting: Dear Sir or Madam, best_regards: Best Regards, views: commencer: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e446339a3..6daa7d7ab 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -44,6 +44,7 @@ fr: locale_dropdown: languages: "Langues" signature: + greeting: Bonjour, best_regards: Bonne journée, views: commencer: From 89d9a4a4772ba50ab2e06904b5b3967182c5811b Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 12:47:23 +0200 Subject: [PATCH 15/18] feat(i18n): translate notification emails actions --- app/views/notification_mailer/_actions.html.haml | 6 +++--- config/locales/en.yml | 5 +++++ config/locales/fr.yml | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/views/notification_mailer/_actions.html.haml b/app/views/notification_mailer/_actions.html.haml index 7bf754962..339fce65b 100644 --- a/app/views/notification_mailer/_actions.html.haml +++ b/app/views/notification_mailer/_actions.html.haml @@ -4,10 +4,10 @@ - variant = (index == 0 ? :primary : :secondary) - case action - when MailTemplateConcern::Actions::SHOW - = round_button('Consulter mon dossier', dossier_url(@dossier), variant) + = round_button(t(:access, scope: [:layouts, :notifications, :actions]), dossier_url(@dossier), variant) - when MailTemplateConcern::Actions::ASK_QUESTION - = round_button('J’ai une question', messagerie_dossier_url(@dossier), variant) + = round_button(t(:question, scope: [:layouts, :notifications, :actions]), messagerie_dossier_url(@dossier), variant) - when MailTemplateConcern::Actions::REPLY - = round_button('Répondre à ce message', messagerie_dossier_url(@dossier), variant) + = round_button(t(:reply, scope: [:layouts, :notifications, :actions]), messagerie_dossier_url(@dossier), variant) = vertical_margin(5) diff --git a/config/locales/en.yml b/config/locales/en.yml index 6f544e646..47a8cc137 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,6 +56,11 @@ en: signature: greeting: Dear Sir or Madam, best_regards: Best Regards, + notifications: + actions: + access: View your File + question: I have a question + reply: Reply to this message views: commencer: show: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6daa7d7ab..7578bd1d1 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -46,6 +46,12 @@ fr: signature: greeting: Bonjour, best_regards: Bonne journée, + notifications: + actions: + access: Consulter mon dossier + question: J’ai une question + reply: Répondre à ce message + views: commencer: show: From c1c45613cc54c5b6721e6c364be46114129adb7e Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 14:25:23 +0200 Subject: [PATCH 16/18] feat(i18n): translate reexamin and new message emails --- .../notify_new_answer.en.html.haml | 31 +++++++++++++++++++ .../notify_revert_to_instruction.en.html.haml | 21 +++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/views/dossier_mailer/notify_new_answer.en.html.haml create mode 100644 app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml diff --git a/app/views/dossier_mailer/notify_new_answer.en.html.haml b/app/views/dossier_mailer/notify_new_answer.en.html.haml new file mode 100644 index 000000000..dd0641807 --- /dev/null +++ b/app/views/dossier_mailer/notify_new_answer.en.html.haml @@ -0,0 +1,31 @@ +- content_for :procedure_logo do + = render 'layouts/mailers/logo', url: @logo_url + +%p= t(:greeting, scope: [:layouts, :signature]) + +- if !@dossier.brouillon? + %p + You received + %strong a new message + from the service in charge of examine your File. + %p + To read the message and answer it, select the following link: + + = round_button('Read the message', messagerie_dossier_url(@dossier), :primary) +- else + %p + You received + %strong a new message + from the service in charge of examine the File you started a draft for on the procedure #{@dossier.procedure.libelle}. + %p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" } + = @body + + %p + If you chose to contact the service, please use the email available below in the page. + + = round_button('Open the File', dossier_url(@dossier), :primary) + += render 'layouts/mailers/signature', service: @service + +- content_for :footer do + = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml new file mode 100644 index 000000000..a894592f2 --- /dev/null +++ b/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml @@ -0,0 +1,21 @@ +- content_for :procedure_logo do + = render 'layouts/mailers/logo', url: @logo_url + +%p= t(:greeting, scope: [:layouts, :signature]) + +%p + Your File will be reexamined. All previous decisions are void. + To see the File created on procedure + %strong= @dossier.procedure.libelle + , select the following link: + = link_to dossier_url(@dossier), dossier_url(@dossier), target: '_blank', rel: 'noopener' + +- if @dossier.procedure.service.present? + %p + In order to get more details about the decision to reexamin, please contact the following service: + = mail_to @dossier.procedure.service.email, @dossier.procedure.service.email + += render 'layouts/mailers/signature' + +- content_for :footer do + = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier From 241f564ecc9812ff156d5e2b40a39379c24aa7c8 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 17:50:39 +0200 Subject: [PATCH 17/18] refactor(i18n): move signature translation keys to shared --- .../devise_mailer/confirmation_instructions.en.html.haml | 4 ++-- app/views/devise_mailer/confirmation_instructions.html.haml | 4 ++-- app/views/devise_mailer/email_changed.en.html.haml | 2 +- app/views/devise_mailer/email_changed.html.haml | 2 +- app/views/devise_mailer/password_change.en.html.haml | 2 +- app/views/devise_mailer/password_change.html.haml | 2 +- .../devise_mailer/reset_password_instructions.en.html.haml | 2 +- .../devise_mailer/reset_password_instructions.html.haml | 2 +- app/views/devise_mailer/unlock_instructions.en.html.haml | 2 +- app/views/devise_mailer/unlock_instructions.html.haml | 2 +- .../notify_automatic_deletion_to_administration.html.haml | 2 +- .../notify_automatic_deletion_to_user.html.haml | 2 +- .../dossier_mailer/notify_brouillon_deletion.html.haml | 2 +- .../dossier_mailer/notify_brouillon_near_deletion.html.haml | 2 +- .../dossier_mailer/notify_brouillon_not_submitted.html.haml | 2 +- .../notify_deletion_to_administration.html.haml | 2 +- app/views/dossier_mailer/notify_deletion_to_user.html.haml | 2 +- .../notify_groupe_instructeur_changed.html.haml | 2 +- .../notify_instructeur_deletion_to_user.html.haml | 2 +- .../notify_near_deletion_to_administration.html.haml | 2 +- .../dossier_mailer/notify_near_deletion_to_user.html.haml | 2 +- app/views/dossier_mailer/notify_new_answer.en.html.haml | 2 +- app/views/dossier_mailer/notify_new_answer.html.haml | 2 +- .../notify_new_commentaire_to_instructeur.html.haml | 2 +- .../notify_new_dossier_depose_to_instructeur.html.haml | 2 +- app/views/dossier_mailer/notify_new_draft.en.html.haml | 2 +- app/views/dossier_mailer/notify_new_draft.html.haml | 2 +- .../notify_revert_to_instruction.en.html.haml | 2 +- .../dossier_mailer/notify_revert_to_instruction.html.haml | 2 +- app/views/layouts/mailers/_signature.html.haml | 2 +- config/locales/en.yml | 6 +++--- config/locales/fr.yml | 6 +++--- 32 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/views/devise_mailer/confirmation_instructions.en.html.haml b/app/views/devise_mailer/confirmation_instructions.en.html.haml index 63f5525bb..7f5d3c3db 100644 --- a/app/views/devise_mailer/confirmation_instructions.en.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.en.html.haml @@ -2,7 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activate account') - %p= t(:greeting, scope: [:layouts, :signature]) + %p= t(:hello, scope: [:views, :shared, :greetings]) %p You have entered your details to create an account on #{APPLICATION_NAME}. To confirm your email and finish creating your account, select the following link: @@ -12,7 +12,7 @@ - else - content_for(:title, "Change email address") - %p= t(:greeting, scope: [:layouts, :signature]) + %p= t(:hello, scope: [:views, :shared, :greetings]) %p To confirm your account email change on #{APPLICATION_NAME}, select the following link: diff --git a/app/views/devise_mailer/confirmation_instructions.html.haml b/app/views/devise_mailer/confirmation_instructions.html.haml index 1c091764f..cab00c327 100644 --- a/app/views/devise_mailer/confirmation_instructions.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.html.haml @@ -2,7 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activez votre compte') - %p= t(:greeting, scope: [:layouts, :signature]) + %p= t(:hello, scope: [:views, :shared, :greetings]) %p Pour activer votre compte sur #{APPLICATION_NAME}, veuillez cliquer sur le lien suivant : @@ -12,7 +12,7 @@ - else - content_for(:title, "Changement d’adresse email") - %p= t(:greeting, scope: [:layouts, :signature]) + %p= t(:hello, scope: [:views, :shared, :greetings]) %p Pour confirmer votre changement d’adresse email, veuillez cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/email_changed.en.html.haml b/app/views/devise_mailer/email_changed.en.html.haml index e60c5bc43..4371b4709 100644 --- a/app/views/devise_mailer/email_changed.en.html.haml +++ b/app/views/devise_mailer/email_changed.en.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'New email address') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/email_changed.html.haml b/app/views/devise_mailer/email_changed.html.haml index 51ba99204..04fc96449 100644 --- a/app/views/devise_mailer/email_changed.html.haml +++ b/app/views/devise_mailer/email_changed.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'Votre nouvelle adresse email') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/password_change.en.html.haml b/app/views/devise_mailer/password_change.en.html.haml index 845357aed..3f5acd006 100644 --- a/app/views/devise_mailer/password_change.en.html.haml +++ b/app/views/devise_mailer/password_change.en.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'New password') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p A request to change your password on #{APPLICATION_NAME} for the account #{@resource.email} was successfully processed. diff --git a/app/views/devise_mailer/password_change.html.haml b/app/views/devise_mailer/password_change.html.haml index 0a4531a3e..56403e9fd 100644 --- a/app/views/devise_mailer/password_change.html.haml +++ b/app/views/devise_mailer/password_change.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'Votre nouveau mot de passe') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p La demande de changement de mot de passe pour votre compte #{@resource.email} sur diff --git a/app/views/devise_mailer/reset_password_instructions.en.html.haml b/app/views/devise_mailer/reset_password_instructions.en.html.haml index 774610c4a..d5eb8744a 100644 --- a/app/views/devise_mailer/reset_password_instructions.en.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.en.html.haml @@ -1,4 +1,4 @@ -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Someone has requested to change your account password on #{APPLICATION_NAME}. To define a new password, select the following link: diff --git a/app/views/devise_mailer/reset_password_instructions.html.haml b/app/views/devise_mailer/reset_password_instructions.html.haml index 72db8073d..c4cfd37aa 100644 --- a/app/views/devise_mailer/reset_password_instructions.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.html.haml @@ -1,4 +1,4 @@ -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Vous avez demandé à changer votre mot de passe sur #{APPLICATION_NAME}. Pour ceci, merci de cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/unlock_instructions.en.html.haml b/app/views/devise_mailer/unlock_instructions.en.html.haml index 092071373..acdde6627 100644 --- a/app/views/devise_mailer/unlock_instructions.en.html.haml +++ b/app/views/devise_mailer/unlock_instructions.en.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'Reactivate account') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Someone made too many unsuccessful attempts to connect to your account #{@resource.email} on #{APPLICATION_NAME}. diff --git a/app/views/devise_mailer/unlock_instructions.html.haml b/app/views/devise_mailer/unlock_instructions.html.haml index 5f883f21e..3fa534fc4 100644 --- a/app/views/devise_mailer/unlock_instructions.html.haml +++ b/app/views/devise_mailer/unlock_instructions.html.haml @@ -1,6 +1,6 @@ - content_for(:title, 'Réactivez votre compte') -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Quelqu’un a tenté de se connecter un grand nombre de fois sans succès à votre diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml index 042d4916d..286f30134 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml index e3264eec3..afbfc3fac 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml index a7af936c2..4461c9c98 100644 --- a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.header', count: @dossier_hashes.count) diff --git a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml index 3c9e3389d..450abf898 100644 --- a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.header', count: @dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml index ac0ca1042..b4a62cfed 100644 --- a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Le dossier n°#{@dossier.id} pour la démarche «  diff --git a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml index f95a80e08..55da5cfe9 100644 --- a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_deletion_to_user.html.haml index f95a80e08..55da5cfe9 100644 --- a/app/views/dossier_mailer/notify_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_user.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml index bc04bc8e6..c45087d0f 100644 --- a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml +++ b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = "Vous suiviez jusqu'à maintenant le dossier n°#{@dossier_id} de la démarche #{@demarche}." diff --git a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml index 2031e390c..f1959341f 100644 --- a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.body_html', dossier_id: @deleted_dossier.dossier_id, libelle_demarche: @deleted_dossier.procedure.libelle, deleted_dossiers_link: dossiers_url(statut: 'dossiers-supprimes')) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml index af16fd23c..ff752e469 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml index 3813ea154..d888955fe 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_new_answer.en.html.haml b/app/views/dossier_mailer/notify_new_answer.en.html.haml index dd0641807..88ef43b79 100644 --- a/app/views/dossier_mailer/notify_new_answer.en.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.en.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) - if !@dossier.brouillon? %p diff --git a/app/views/dossier_mailer/notify_new_answer.html.haml b/app/views/dossier_mailer/notify_new_answer.html.haml index e8397babe..932b6e4f1 100644 --- a/app/views/dossier_mailer/notify_new_answer.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) - if !@dossier.brouillon? %p diff --git a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml index 85060326a..4f5b6346f 100644 --- a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml index fd3c4e2a8..7363bd1ea 100644 --- a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml @@ -1,6 +1,6 @@ - content_for(:title, "#{@subject}") -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_draft.en.html.haml b/app/views/dossier_mailer/notify_new_draft.en.html.haml index 8d6a2404a..2c6e001b3 100644 --- a/app/views/dossier_mailer/notify_new_draft.en.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.en.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p You started filling a File on the procedure: diff --git a/app/views/dossier_mailer/notify_new_draft.html.haml b/app/views/dossier_mailer/notify_new_draft.html.haml index 2a6c8ce5b..fdb341967 100644 --- a/app/views/dossier_mailer/notify_new_draft.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Vous avez commencé à remplir un dossier pour la démarche diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml index a894592f2..2f64e85ae 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.en.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Your File will be reexamined. All previous decisions are void. diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml index 4f0388899..0f75d8070 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml @@ -1,7 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p= t(:greeting, scope: [:layouts, :signature]) +%p= t(:hello, scope: [:views, :shared, :greetings]) %p Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque. diff --git a/app/views/layouts/mailers/_signature.html.haml b/app/views/layouts/mailers/_signature.html.haml index 7273cd7b5..c26f14396 100644 --- a/app/views/layouts/mailers/_signature.html.haml +++ b/app/views/layouts/mailers/_signature.html.haml @@ -1,5 +1,5 @@ %p - = t(:best_regards, scope: [:layouts, :signature]) + = t(:best_regards, scope: [:views, :shared, :greetings]) %br - if defined?(service) && service && service.nom.present? = service.nom diff --git a/config/locales/en.yml b/config/locales/en.yml index 47a8cc137..17244f9b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -53,9 +53,6 @@ en: line3: administrative forms. locale_dropdown: languages: "Languages" - signature: - greeting: Dear Sir or Madam, - best_regards: Best Regards, notifications: actions: access: View your File @@ -108,6 +105,9 @@ en: first: First truncate: '…' shared: + greetings: + hello: Dear Sir or Madam, + best_regards: Best Regards, dossiers: edit: autosave: Your file is automatically saved after each modification. You can close the window at any time and pick up where you left off later. diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7578bd1d1..4d8bc3e5a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -43,9 +43,6 @@ fr: line3: administratifs dématérialisés. locale_dropdown: languages: "Langues" - signature: - greeting: Bonjour, - best_regards: Bonne journée, notifications: actions: access: Consulter mon dossier @@ -100,6 +97,9 @@ fr: first: Premier truncate: '…' shared: + greetings: + hello: Bonjour, + best_regards: Bonne journée, dossiers: edit: autosave: Votre dossier est enregistré automatiquement après chaque modification. Vous pouvez à tout moment fermer la fenêtre et reprendre plus tard là où vous en étiez. From b80f6a9f1b52278e8256241233fdd24f4db5d002 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 26 Aug 2021 07:52:31 -0500 Subject: [PATCH 18/18] spec: fix some manager tests not running --- spec/controllers/manager/administrateurs_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/manager/administrateurs_controller_spec.rb b/spec/controllers/manager/administrateurs_controller_spec.rb index ebd41fe36..58f0f4877 100644 --- a/spec/controllers/manager/administrateurs_controller_spec.rb +++ b/spec/controllers/manager/administrateurs_controller_spec.rb @@ -1,4 +1,4 @@ -xdescribe Manager::AdministrateursController, type: :controller do +describe Manager::AdministrateursController, type: :controller do let(:super_admin) { create(:super_admin) } let(:administrateur) { create(:administrateur) }