diff --git a/app/assets/stylesheets/merci.scss b/app/assets/stylesheets/merci.scss deleted file mode 100644 index b73c2d8e6..000000000 --- a/app/assets/stylesheets/merci.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import "constants"; - -.merci .monavis { - img { - margin-top: 2 * $default-padding; - } -} diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 4459e741d..8aa68de19 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -8,6 +8,7 @@ class NotificationMailer < ApplicationMailer before_action :set_dossier, except: [:send_notification_for_tiers, :send_accuse_lecture_notification] before_action :set_services_publics_plus, only: :send_notification + before_action :set_jdma, only: :send_notification helper ServiceHelper helper MailerHelper @@ -88,6 +89,12 @@ class NotificationMailer < ApplicationMailer @services_publics_plus_url = ENV['SERVICES_PUBLICS_PLUS_URL'].presence end + def set_jdma + if params[:state] == Dossier.states.fetch(:en_construction) && @dossier.procedure.monavis_embed + @jdma_html = @dossier.procedure.monavis_embed_html_source("email") + end + end + def set_dossier @dossier = params[:dossier] configure_defaults_for_user(@dossier.user) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index cbdb7a5ed..7995bd49a 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -1019,6 +1019,10 @@ class Procedure < ApplicationRecord update!(closing_reason: nil, closing_details: nil, replaced_by_procedure_id: nil, closing_notification_brouillon: false, closing_notification_en_cours: false) end + def monavis_embed_html_source(source) + monavis_embed.gsub('nd_source=button', "nd_source=#{source}").gsub(' true).render(loader_service.find(\"#{params[:category]}/#{params[:slug]}\").content)", "render_path": [ @@ -203,6 +203,6 @@ "note": "Current is not a model" } ], - "updated": "2024-04-23 18:27:12 +0200", + "updated": "2024-06-10 11:21:19 +0200", "brakeman_version": "6.1.2" } diff --git a/config/locales/en.yml b/config/locales/en.yml index c4a9ea309..a7acde411 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -447,6 +447,8 @@ en: download_dossier: Download your file acces_dossier: Access your file submit_dossier: Submit an other file + jdma_l1: Help us improve this service! + jdma_l2: Give us your feedback, it only takes 2 minutes. show: header: summary: "Summary" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 24815f182..bbe658076 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -450,6 +450,8 @@ fr: download_dossier: Télécharger mon dossier acces_dossier: Accéder à votre dossier submit_dossier: Déposer un autre dossier + jdma_l1: Aidez-nous à améliorer ce service ! + jdma_l2: Donnez-nous votre avis, cela ne prend que 2 minutes. show: header: summary: "Résumé"