From d053a9bb8dbb474169c1fa11f6548a72ae8625bd Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Fri, 1 Mar 2019 18:25:15 +0100 Subject: [PATCH 1/5] Fix test for the 2 months following February The problem was caused by the variable lenght of 2.months.ago, used in the test. During the period from March 1st to April 29th, because February is so short, the message would change from 'delai de 2 mois' to 'delai de environ 2 mois', causing the test to fail. --- spec/features/new_user/dossier_details_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/features/new_user/dossier_details_spec.rb b/spec/features/new_user/dossier_details_spec.rb index b24744713..a3cc373bb 100644 --- a/spec/features/new_user/dossier_details_spec.rb +++ b/spec/features/new_user/dossier_details_spec.rb @@ -30,10 +30,14 @@ describe 'Dossier details:' do let(:dossier) { create(:dossier, :en_instruction, :for_individual, :with_commentaires, user: user, procedure: procedure) } before do - other_dossier = create(:dossier, :accepte, :for_individual, procedure: procedure, en_instruction_at: 2.months.ago, processed_at: Time.zone.now) + Timecop.freeze(Time.zone.local(2012, 12, 20)) + + other_dossier = create(:dossier, :accepte, :for_individual, procedure: procedure, en_instruction_at: 60.days.ago, processed_at: Time.zone.now) visit dossier_path(dossier) end + after { Timecop.return } + it { expect(page).to have_text("Habituellement, les dossiers de cette démarche sont traités dans un délai de 2 mois.") } end end From 83adb8dcba5284161a008dd3a8865efc52754186 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Tue, 26 Feb 2019 19:34:18 +0100 Subject: [PATCH 2/5] Bump shoulda matchers to avoid the warning about the deprecation of BigDecimal.new --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c9f39191f..83db7583d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -273,7 +273,7 @@ GEM domain_name (~> 0.5) http_parser.rb (0.6.0) httpclient (2.8.3) - i18n (1.4.0) + i18n (1.5.3) concurrent-ruby (~> 1.0) ipaddress (0.8.3) jaro_winkler (1.5.2) @@ -555,8 +555,8 @@ GEM faraday (>= 0.7.6, < 1.0) sexp_processor (4.11.0) shellany (0.0.1) - shoulda-matchers (3.1.2) - activesupport (>= 4.0.0) + shoulda-matchers (4.0.1) + activesupport (>= 4.2.0) simple_form (4.1.0) actionpack (>= 5.0) activemodel (>= 5.0) From 6bc820d16cb085b16e28f9f93a8e4ae2433785be Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 4 Mar 2019 12:31:31 +0100 Subject: [PATCH 3/5] link_sent: add link to faq --- app/views/users/sessions/link_sent.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/users/sessions/link_sent.html.haml b/app/views/users/sessions/link_sent.html.haml index 264b09955..ea479eda5 100644 --- a/app/views/users/sessions/link_sent.html.haml +++ b/app/views/users/sessions/link_sent.html.haml @@ -14,4 +14,7 @@ Attention, ce message peut mettre jusqu'à 15 minutes pour arriver. %p.help + Si vous voyez cette page trop souvent, consultez notre aide : #{link_to 'https://faq.demarches-simplifiees.fr/article/34-je-dois-confirmer-mon-compte-a-chaque-connexion', 'https://faq.demarches-simplifiees.fr/article/34-je-dois-confirmer-mon-compte-a-chaque-connexion', target: '_blank' } + %br + %br En cas de difficultés, nous restons joignables sur #{link_to 'contact@demarches-simplifiees.fr', 'mailto:contact@demarches-simplifiees.fr'}. From cb1895c515124599c0540559d7c31993ab1e7074 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 4 Mar 2019 12:37:15 +0100 Subject: [PATCH 4/5] send_login_token: add mention of one week validity --- app/views/gestionnaire_mailer/send_login_token.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/gestionnaire_mailer/send_login_token.html.haml b/app/views/gestionnaire_mailer/send_login_token.html.haml index df3b5f553..03210cc4a 100644 --- a/app/views/gestionnaire_mailer/send_login_token.html.haml +++ b/app/views/gestionnaire_mailer/send_login_token.html.haml @@ -5,4 +5,6 @@ Veuillez cliquer sur le lien suivant pour vous connecter sur le site demarches-simplifiees.fr :  = link_to(sign_in_by_link_url(@gestionnaire_id, jeton: @login_token), sign_in_by_link_url(@gestionnaire_id, jeton: @login_token)) +%p Ce lien est valide une semaine. + = render partial: "layouts/mailers/signature" From d54a0a46128640582be9e931733394813930c640 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Fri, 1 Mar 2019 17:54:17 +0100 Subject: [PATCH 5/5] Fix link to procedure brouillon in manager --- app/views/fields/procedure_link_field/_show.html.haml | 2 +- config/application.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/fields/procedure_link_field/_show.html.haml b/app/views/fields/procedure_link_field/_show.html.haml index 7d0ee3413..2fbf4006a 100644 --- a/app/views/fields/procedure_link_field/_show.html.haml +++ b/app/views/fields/procedure_link_field/_show.html.haml @@ -1,4 +1,4 @@ - if field.data.present? - = link_to "/commencer/#{field.data}", commencer_url(path: field.data), target: '_blank' + = link_to Addressable::URI.parse(procedure_lien(field.resource)).path, procedure_lien(field.resource), target: '_blank' - else Plus en ligne diff --git a/config/application.rb b/config/application.rb index bb00d8c27..663bcda18 100644 --- a/config/application.rb +++ b/config/application.rb @@ -36,5 +36,10 @@ module TPS config.active_job.queue_adapter = :delayed_job config.action_view.sanitized_allowed_tags = ActionView::Base.sanitized_allowed_tags + ['u'] + + config.to_prepare do + # Make main application helpers available in administrate + Administrate::ApplicationController.helper(TPS::Application.helpers) + end end end