From c14f9900d669c5ae5ebc2eec28a694fcf0f93b6f Mon Sep 17 00:00:00 2001 From: pedong Date: Thu, 29 Nov 2018 17:03:32 +0100 Subject: [PATCH 1/9] [fix #2969] use JS replace semicolon by comma in the list email --- app/javascript/new_design/avis.js | 4 ++++ app/javascript/packs/application.js | 4 +++- app/views/new_gestionnaire/shared/avis/_form.html.haml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/javascript/new_design/avis.js b/app/javascript/new_design/avis.js index 99b4f869c..1d84d4d67 100644 --- a/app/javascript/new_design/avis.js +++ b/app/javascript/new_design/avis.js @@ -3,3 +3,7 @@ import { toggle } from '@utils'; export function toggleCondidentielExplanation() { toggle(document.querySelector('.confidentiel-explanation')); } + +export function replaceSemicolonByComma(event) { + event.target.value = event.target.value.replace(/;/g, ','); +} diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index a8ec784e8..206b4526f 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -25,6 +25,7 @@ import { toggleCondidentielExplanation } from '../new_design/avis'; import { scrollMessagerie } from '../new_design/messagerie'; import { showMotivation, motivationCancel } from '../new_design/state-button'; import { toggleChart } from '../new_design/toggle-chart'; +import { replaceSemicolonByComma } from '../new_design/avis'; // This is the global application namespace where we expose helpers used from rails views const DS = { @@ -32,7 +33,8 @@ const DS = { scrollMessagerie, showMotivation, motivationCancel, - toggleChart + toggleChart, + replaceSemicolonByComma }; // Start Rails helpers diff --git a/app/views/new_gestionnaire/shared/avis/_form.html.haml b/app/views/new_gestionnaire/shared/avis/_form.html.haml index 609d871e3..15f317f8f 100644 --- a/app/views/new_gestionnaire/shared/avis/_form.html.haml +++ b/app/views/new_gestionnaire/shared/avis/_form.html.haml @@ -3,7 +3,7 @@ %p.avis-notice Les invités pourront consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais ils ne pourront pas le modifier. = form_for avis, url: url, html: { class: 'form' } do |f| - = f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true + = f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true, onchange: "javascript:DS.replaceSemicolonByComma(event);" = f.text_area :introduction, rows: 3, value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true .flex.justify-between.align-baseline - if must_be_confidentiel From 1532d287aedde533f8eb92331228ce2a839776b6 Mon Sep 17 00:00:00 2001 From: pedong Date: Thu, 29 Nov 2018 16:12:02 +0100 Subject: [PATCH 2/9] [fix #3026] change champ date for archivage auto --- app/views/admin/procedures/_informations.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index 751a0f5e5..bad8e62ed 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -146,7 +146,7 @@ %h4 Options avancées %label{ for: :auto_archive_on } Archivage automatique le - = f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-language' => 'fr', 'date-format' => 'dd/mm/yyyy' } + = f.date_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on (à 00h00) %p.help-block %i.fa.fa-info-circle From b3d0a113eb1a71c9868222047d6fd7482fe18312 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 8 Oct 2018 18:44:19 +0200 Subject: [PATCH 3/9] Use non-breaking spaces in tests --- spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb | 2 +- spec/views/new_user/dossiers/demande.html.haml_spec.rb | 2 +- spec/views/new_user/dossiers/show.html.haml_spec.rb | 2 +- spec/views/new_user/dossiers/show/_header.html.haml_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb b/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb index 561fb278c..2ff909600 100644 --- a/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb +++ b/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb @@ -10,7 +10,7 @@ describe 'new_gestionnaire/dossiers/show.html.haml', type: :view do subject! { render } it 'renders the header' do - expect(rendered).to have_text("Dossier nº #{dossier.id}") + expect(rendered).to have_text("Dossier nº #{dossier.id}") end it 'renders the dossier infos' do diff --git a/spec/views/new_user/dossiers/demande.html.haml_spec.rb b/spec/views/new_user/dossiers/demande.html.haml_spec.rb index cad147eed..074c55d78 100644 --- a/spec/views/new_user/dossiers/demande.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/demande.html.haml_spec.rb @@ -12,7 +12,7 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do subject! { render } it 'renders the header' do - expect(rendered).to have_text("Dossier nº #{dossier.id}") + expect(rendered).to have_text("Dossier nº #{dossier.id}") end it 'renders the dossier infos' do diff --git a/spec/views/new_user/dossiers/show.html.haml_spec.rb b/spec/views/new_user/dossiers/show.html.haml_spec.rb index 977b5677b..e81b50482 100644 --- a/spec/views/new_user/dossiers/show.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/show.html.haml_spec.rb @@ -11,7 +11,7 @@ describe 'new_user/dossiers/show.html.haml', type: :view do subject! { render } it 'renders a summary of the dossier state' do - expect(rendered).to have_text("Dossier nº #{dossier.id}") + expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_selector('.status-overview') end diff --git a/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb b/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb index 9eaa1d342..ad082af8a 100644 --- a/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb @@ -9,7 +9,7 @@ describe 'new_user/dossiers/show/header.html.haml', type: :view do it 'affiche les informations du dossier' do expect(rendered).to have_text(dossier.procedure.libelle) - expect(rendered).to have_text("Dossier nº #{dossier.id}") + expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("en construction") expect(rendered).to have_selector("ul.tabs") From 94b6783a655b52335b3cb814f7f4bd8e2b2fca21 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 8 Oct 2018 18:44:21 +0200 Subject: [PATCH 4/9] Slightly change some tests to comply with puma --- spec/controllers/support_controller_spec.rb | 2 +- spec/features/new_user/brouillon_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/support_controller_spec.rb b/spec/controllers/support_controller_spec.rb index abf9a8187..4852a3b4b 100644 --- a/spec/controllers/support_controller_spec.rb +++ b/spec/controllers/support_controller_spec.rb @@ -111,7 +111,7 @@ describe SupportController, type: :controller do get :index expect(response.status).to eq(200) - expect(response.body).to have_content("Email *") + expect(response.body).to have_text("Email") end end diff --git a/spec/features/new_user/brouillon_spec.rb b/spec/features/new_user/brouillon_spec.rb index 244cf9b8d..7113da210 100644 --- a/spec/features/new_user/brouillon_spec.rb +++ b/spec/features/new_user/brouillon_spec.rb @@ -22,7 +22,7 @@ feature 'The user' do # fill data fill_in('text', with: 'super texte') fill_in('textarea', with: 'super textarea') - fill_in('date', with: '12/12/2012') + fill_in('date', with: '2012-12-12') select_date_and_time(Time.zone.parse('06/01/1985 7h05'), form_id_for('datetime')) fill_in('number', with: '42') check('checkbox') From 478fb88618ed5eaca527055fd40691ddfa8e8231 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Wed, 12 Sep 2018 22:25:57 +0200 Subject: [PATCH 5/9] =?UTF-8?q?Bump=20capybara=20(2.18.0=20=E2=86=92=203.1?= =?UTF-8?q?1.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 16 +++++++++------- spec/features/new_user/brouillon_spec.rb | 2 +- spec/mailers/avis_mailer_spec.rb | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1afdb378f..ab15dab72 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,13 +115,14 @@ GEM browser (2.5.3) builder (3.2.3) byebug (10.0.2) - capybara (2.18.0) + capybara (3.11.0) addressable mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (>= 2.0, < 4.0) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.2) + xpath (~> 3.2) capybara-email (3.0.1) capybara (>= 2.4, < 4.0) mail @@ -416,7 +417,7 @@ GEM pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) - public_suffix (3.0.2) + public_suffix (3.0.3) puma (3.12.0) rack (2.0.6) rack-handlers (0.7.3) @@ -476,6 +477,7 @@ GEM ffi rbnacl-libsodium (1.0.16) rbnacl (>= 3.0.1) + regexp_parser (1.3.0) request_store (1.4.1) rack (>= 1.4) responders (2.4.0) @@ -643,7 +645,7 @@ GEM websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) - xpath (3.0.0) + xpath (3.2.0) nokogiri (~> 1.8) xray-rails (0.3.1) rails (>= 3.1.0) diff --git a/spec/features/new_user/brouillon_spec.rb b/spec/features/new_user/brouillon_spec.rb index 7113da210..748572433 100644 --- a/spec/features/new_user/brouillon_spec.rb +++ b/spec/features/new_user/brouillon_spec.rb @@ -22,7 +22,7 @@ feature 'The user' do # fill data fill_in('text', with: 'super texte') fill_in('textarea', with: 'super textarea') - fill_in('date', with: '2012-12-12') + fill_in('date', with: '12-12-2012') select_date_and_time(Time.zone.parse('06/01/1985 7h05'), form_id_for('datetime')) fill_in('number', with: '42') check('checkbox') diff --git a/spec/mailers/avis_mailer_spec.rb b/spec/mailers/avis_mailer_spec.rb index 70f826b13..de8482ed1 100644 --- a/spec/mailers/avis_mailer_spec.rb +++ b/spec/mailers/avis_mailer_spec.rb @@ -7,7 +7,7 @@ RSpec.describe AvisMailer, type: :mailer do subject { described_class.avis_invitation(avis) } it { expect(subject.subject).to eq("Donnez votre avis sur le dossier nº #{avis.dossier.id} (#{avis.dossier.procedure.libelle})") } - it { expect(subject.body).to have_text("Vous avez été invité par #{avis.claimant.email} à donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche : #{avis.dossier.procedure.libelle}") } + it { expect(subject.body).to have_text("Vous avez été invité par\n#{avis.claimant.email}\nà donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche :\n#{avis.dossier.procedure.libelle}") } it { expect(subject.body).to include(avis.introduction) } it { expect(subject.body).to include(gestionnaire_avis_url(avis)) } From 873bf2fc0f64f8d234a5a132493103b15b44123f Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 8 Oct 2018 18:43:40 +0200 Subject: [PATCH 6/9] Tell puma to STFU --- spec/spec_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7056b9f81..7c9d40bcc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -48,6 +48,9 @@ Capybara.register_driver :headless_chrome do |app| desired_capabilities: capabilities end +# FIXME: remove this line when https://github.com/rspec/rspec-rails/issues/1897 has been fixed +Capybara.server = :puma, { Silent: true } + Capybara.default_max_wait_time = 2 # Save a snapshot of the HTML page when an integration test fails From fd90774717fa4f3ee702b17e4f80ed96dd5908c9 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Fri, 16 Nov 2018 12:00:08 +0100 Subject: [PATCH 7/9] =?UTF-8?q?Bump=20capybara-screenshot=20(1.0.21=20?= =?UTF-8?q?=E2=86=92=201.0.22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ab15dab72..88687fc5d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,7 +126,7 @@ GEM capybara-email (3.0.1) capybara (>= 2.4, < 4.0) mail - capybara-screenshot (1.0.21) + capybara-screenshot (1.0.22) capybara (>= 1.0, < 4) launchy capybara-selenium (0.0.6) From f2f8770bb563c601441bb10074dc24bfe9972340 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 27 Nov 2018 16:20:55 +0100 Subject: [PATCH 8/9] Fix wording on services page --- app/views/new_administrateur/services/edit.html.haml | 2 +- app/views/new_administrateur/services/index.html.haml | 2 +- app/views/new_administrateur/services/new.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/new_administrateur/services/edit.html.haml b/app/views/new_administrateur/services/edit.html.haml index e23460425..7542bdd10 100644 --- a/app/views/new_administrateur/services/edit.html.haml +++ b/app/views/new_administrateur/services/edit.html.haml @@ -1,5 +1,5 @@ = render partial: 'new_administrateur/breadcrumbs', - locals: { steps: [link_to('Procedures', admin_procedures_path), + locals: { steps: [link_to('Démarches', admin_procedures_path), link_to(@procedure.libelle, admin_procedure_path(@procedure)), link_to('choix du service', services_path(procedure_id: @procedure.id)), 'modifier le service'] } diff --git a/app/views/new_administrateur/services/index.html.haml b/app/views/new_administrateur/services/index.html.haml index 95d41d8bf..28ab6d9df 100644 --- a/app/views/new_administrateur/services/index.html.haml +++ b/app/views/new_administrateur/services/index.html.haml @@ -1,5 +1,5 @@ = render partial: 'new_administrateur/breadcrumbs', - locals: { steps: [link_to('Procedures', admin_procedures_path), + locals: { steps: [link_to('Démarches', admin_procedures_path), link_to(@procedure.libelle, admin_procedure_path(@procedure)), 'choix du service'] } diff --git a/app/views/new_administrateur/services/new.html.haml b/app/views/new_administrateur/services/new.html.haml index 158eb8f73..4ae80edf5 100644 --- a/app/views/new_administrateur/services/new.html.haml +++ b/app/views/new_administrateur/services/new.html.haml @@ -1,5 +1,5 @@ = render partial: 'new_administrateur/breadcrumbs', - locals: { steps: [link_to('Procedures', admin_procedures_path), + locals: { steps: [link_to('Démarches', admin_procedures_path), link_to(@procedure.libelle, admin_procedure_path(@procedure)), link_to('choix du service', services_path(procedure_id: @procedure.id)), 'nouveau service'] } From 121086eeddae0c2c0a83a0e4183973eea4456185 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 4 Dec 2018 11:06:04 +0100 Subject: [PATCH 9/9] Bump rails --- Gemfile.lock | 76 ++++++++++++++++---------------- spec/mailers/avis_mailer_spec.rb | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 88687fc5d..1a9c681e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,25 +22,25 @@ GEM specs: aasm (5.0.1) concurrent-ruby (~> 1.0) - actioncable (5.2.1) - actionpack (= 5.2.1) + actioncable (5.2.1.1) + actionpack (= 5.2.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.1) - actionpack (= 5.2.1) - actionview (= 5.2.1) - activejob (= 5.2.1) + actionmailer (5.2.1.1) + actionpack (= 5.2.1.1) + actionview (= 5.2.1.1) + activejob (= 5.2.1.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.1) - actionview (= 5.2.1) - activesupport (= 5.2.1) + actionpack (5.2.1.1) + actionview (= 5.2.1.1) + activesupport (= 5.2.1.1) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.1) - activesupport (= 5.2.1) + actionview (5.2.1.1) + activesupport (= 5.2.1.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -53,24 +53,24 @@ GEM activemodel (>= 4.1, < 6) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (5.2.1) - activesupport (= 5.2.1) + activejob (5.2.1.1) + activesupport (= 5.2.1.1) globalid (>= 0.3.6) - activemodel (5.2.1) - activesupport (= 5.2.1) + activemodel (5.2.1.1) + activesupport (= 5.2.1.1) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (5.2.1) - activemodel (= 5.2.1) - activesupport (= 5.2.1) + activerecord (5.2.1.1) + activemodel (= 5.2.1.1) + activesupport (= 5.2.1.1) arel (>= 9.0) - activestorage (5.2.1) - actionpack (= 5.2.1) - activerecord (= 5.2.1) + activestorage (5.2.1.1) + actionpack (= 5.2.1.1) + activerecord (= 5.2.1.1) marcel (~> 0.3.1) - activesupport (5.2.1) + activesupport (5.2.1.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -333,13 +333,13 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.0.13) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) mailjet (1.5.4) activesupport (>= 3.1.0) rack (>= 1.4.0) rest-client - marcel (0.3.2) + marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) mime-types (3.2.2) @@ -436,18 +436,18 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.1) - actioncable (= 5.2.1) - actionmailer (= 5.2.1) - actionpack (= 5.2.1) - actionview (= 5.2.1) - activejob (= 5.2.1) - activemodel (= 5.2.1) - activerecord (= 5.2.1) - activestorage (= 5.2.1) - activesupport (= 5.2.1) + rails (5.2.1.1) + actioncable (= 5.2.1.1) + actionmailer (= 5.2.1.1) + actionpack (= 5.2.1.1) + actionview (= 5.2.1.1) + activejob (= 5.2.1.1) + activemodel (= 5.2.1.1) + activerecord (= 5.2.1.1) + activestorage (= 5.2.1.1) + activesupport (= 5.2.1.1) bundler (>= 1.3.0) - railties (= 5.2.1) + railties (= 5.2.1.1) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -461,9 +461,9 @@ GEM rails-i18n (5.1.2) i18n (>= 0.7, < 2) railties (>= 5.0, < 6) - railties (5.2.1) - actionpack (= 5.2.1) - activesupport (= 5.2.1) + railties (5.2.1.1) + actionpack (= 5.2.1.1) + activesupport (= 5.2.1.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) diff --git a/spec/mailers/avis_mailer_spec.rb b/spec/mailers/avis_mailer_spec.rb index de8482ed1..37d3e6674 100644 --- a/spec/mailers/avis_mailer_spec.rb +++ b/spec/mailers/avis_mailer_spec.rb @@ -7,7 +7,7 @@ RSpec.describe AvisMailer, type: :mailer do subject { described_class.avis_invitation(avis) } it { expect(subject.subject).to eq("Donnez votre avis sur le dossier nº #{avis.dossier.id} (#{avis.dossier.procedure.libelle})") } - it { expect(subject.body).to have_text("Vous avez été invité par\n#{avis.claimant.email}\nà donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche :\n#{avis.dossier.procedure.libelle}") } + it { expect(subject.body).to have_text("Vous avez été invité par\r\n#{avis.claimant.email}\r\nà donner votre avis sur le dossier nº #{avis.dossier.id} de la démarche :\r\n#{avis.dossier.procedure.libelle}") } it { expect(subject.body).to include(avis.introduction) } it { expect(subject.body).to include(gestionnaire_avis_url(avis)) }