diff --git a/Gemfile.lock b/Gemfile.lock index 283f14923..232979df5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -727,7 +727,7 @@ GEM rails (>= 6.0.0) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext @@ -741,7 +741,7 @@ GEM activemodel (>= 3.0.0) public_suffix vcr (6.1.0) - view_component (2.53.0) + view_component (2.63.0) activesupport (>= 5.0.0, < 8.0) method_source (~> 1.0) virtus (2.0.0) diff --git a/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml b/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml index ed2bbe0ba..bd71535d4 100644 --- a/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml +++ b/app/components/types_de_champ_editor/conditions_component/conditions_component.html.haml @@ -1,5 +1,5 @@ .flex.justify-start.section{ id: dom_id(@tdc.stable_self, :conditions) } - = form_with url: admin_procedure_condition_path(@procedure_id, @tdc.stable_id), method: :patch, class: 'form width-100' do |f| + = form_tag admin_procedure_condition_path(@procedure_id, @tdc.stable_id), method: :patch, class: 'form width-100' do .conditionnel.mt-2.width-100 .flex %p.mr-2 Logique conditionnelle diff --git a/app/controllers/support_controller.rb b/app/controllers/support_controller.rb index b46d7183c..ccb738188 100644 --- a/app/controllers/support_controller.rb +++ b/app/controllers/support_controller.rb @@ -96,6 +96,6 @@ class SupportController < ApplicationController end def redirect_to_root - redirect_to root_path, alert: t('invisible_captcha.custom_message') + redirect_to root_path, alert: t('invisible_captcha.sentence_for_humans') end end diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index 5c7eda7d2..f96fe14f7 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -26,8 +26,6 @@ = t('.your_question') = hidden_field_tag :type, params[:type] - = invisible_captcha - %dl - @options.each do |(question, question_type, link)| %dt @@ -71,5 +69,7 @@ = hidden_field_tag :tags, @tags&.join(',') + = invisible_captcha + .send-wrapper = button_tag t('send_mail', scope: [:utils]), type: :submit, class: 'button send primary' diff --git a/config/application.rb b/config/application.rb index dcf4852e8..fd58bf731 100644 --- a/config/application.rb +++ b/config/application.rb @@ -88,8 +88,5 @@ module TPS config.view_component.show_previews_source = true config.view_component.default_preview_layout = 'component_preview' config.view_component.preview_paths << "#{Rails.root}/spec/components/previews" - - # see: https://viewcomponent.org/known_issues.html - config.view_component.use_global_output_buffer = true end end diff --git a/config/locales/en.yml b/config/locales/en.yml index d542d5b40..fc2089ce0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -31,7 +31,7 @@ en: invisible_captcha: - custom_message: 'If you are a human, ignore this field' + sentence_for_humans: 'If you are a human, ignore this field' help: 'Help' help_dropdown: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4b5310d64..3a7ddaaf4 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -21,7 +21,7 @@ fr: invisible_captcha: - custom_message: 'Si vous êtes un humain, veuillez ignorer ce champs' + sentence_for_humans: 'Si vous êtes un humain, laissez ce champ vide' help: 'Aide' help_dropdown: problem_title: Un problème avec le site ? diff --git a/spec/controllers/support_controller_spec.rb b/spec/controllers/support_controller_spec.rb index 1b7737469..ee1fbf312 100644 --- a/spec/controllers/support_controller_spec.rb +++ b/spec/controllers/support_controller_spec.rb @@ -122,7 +122,7 @@ describe SupportController, type: :controller do let(:params) { { subject: 'bonjour', text: 'un message', InvisibleCaptcha.honeypots.sample => 'boom' } } it 'does not create a conversation on HelpScout' do expect { subject }.not_to change(Commentaire, :count) - expect(flash[:alert]).to eq(I18n.t('invisible_captcha.custom_message')) + expect(flash[:alert]).to eq(I18n.t('invisible_captcha.sentence_for_humans')) end end end