From 327bec0637468b2a10fe3107516904ab8edd2bba Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Sat, 1 May 2021 13:23:48 +0200 Subject: [PATCH 1/6] Use HELO --- config/environments/development.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 6de39bbfa..fa779f52c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -87,7 +87,21 @@ Rails.application.configure do authentication: :cram_md5 } else - config.action_mailer.delivery_method = :letter_opener_web + # https://usehelo.com + if ENV['HELO_ENABLED'] == 'enabled' + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + user_name: APPLICATION_NAME, + password: '', + address: '127.0.0.1', + domain: '127.0.0.1', + port: ENV.fetch('HELO_PORT', '2525'), + authentication: :plain + } + else + config.action_mailer.delivery_method = :letter_opener_web + end + config.action_mailer.default_url_options = { host: 'localhost', port: 3000 From f55c6ee371435afc2a3ff0b8bf85f53706f30ca6 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 26 Apr 2021 17:06:54 +0200 Subject: [PATCH 2/6] stick arrow with label --- app/assets/stylesheets/dossiers_table.scss | 2 -- app/views/instructeurs/procedures/_header_field.html.haml | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss index 64ec0dc9f..f91a2f7c0 100644 --- a/app/assets/stylesheets/dossiers_table.scss +++ b/app/assets/stylesheets/dossiers_table.scss @@ -46,8 +46,6 @@ } .notification-col { - width: 45px; - a { font-size: 16px; } diff --git a/app/views/instructeurs/procedures/_header_field.html.haml b/app/views/instructeurs/procedures/_header_field.html.haml index 58a73ba15..5ef47b161 100644 --- a/app/views/instructeurs/procedures/_header_field.html.haml +++ b/app/views/instructeurs/procedures/_header_field.html.haml @@ -1,8 +1,9 @@ %th{ class: classname } = link_to update_sort_instructeur_procedure_path(@procedure, table: field['table'], column: field['column']) do - = field['label'] - if @procedure_presentation.sort['table'] == field['table'] && @procedure_presentation.sort['column'] == field['column'] - if @procedure_presentation.sort['order'] == 'asc' - %img.caret-icon{ src: image_url("table/up_caret.svg"), width: 10, height: 6, loading: 'lazy' } + #{field['label']} ↑ - else - %img.caret-icon{ src: image_url("table/down_caret.svg"), width: 10, height: 6, loading: 'lazy' } + #{field['label']} ↓ + - else + #{field['label']} From 55b80df29d1474825670bba799cbc186f281e91b Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 26 Apr 2021 17:15:28 +0200 Subject: [PATCH 3/6] display count before text in tabs --- app/views/instructeurs/procedures/show.html.haml | 2 +- app/views/shared/_tab_item.html.haml | 2 +- spec/features/instructeurs/instruction_spec.rb | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 9edcc3e0a..fd13d41a2 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -38,7 +38,7 @@ badge: number_with_html_delimiter(@traites_count), notification: @has_termine_notifications) - = tab_item('tous les dossiers', + = tab_item('au total', instructeur_procedure_path(@procedure, statut: 'tous'), active: @statut == 'tous', badge: number_with_html_delimiter(@tous_count)) diff --git a/app/views/shared/_tab_item.html.haml b/app/views/shared/_tab_item.html.haml index 52e36cc36..972ebdd50 100644 --- a/app/views/shared/_tab_item.html.haml +++ b/app/views/shared/_tab_item.html.haml @@ -2,6 +2,6 @@ - if notification %span.notifications{ 'aria-label': 'notifications' } = link_to(url) do - = label - if badge.present? %span.badge= badge + = label diff --git a/spec/features/instructeurs/instruction_spec.rb b/spec/features/instructeurs/instruction_spec.rb index 257ca2a73..1b1bca949 100644 --- a/spec/features/instructeurs/instruction_spec.rb +++ b/spec/features/instructeurs/instruction_spec.rb @@ -216,11 +216,11 @@ feature 'Instructing a dossier:', js: true do def test_statut_bar(a_suivre: 0, suivi: 0, traite: 0, tous_les_dossiers: 0, archive: 0) texts = [ - "à suivre #{a_suivre}", - "suivi #{suivi}", - "traité #{traite}", - "tous les dossiers #{tous_les_dossiers}", - "archivé #{archive}" + "#{a_suivre} à suivre", + "#{suivi} suivi", + "#{traite} traité", + "#{tous_les_dossiers} au total", + "#{archive} archivé" ] texts.each { |text| expect(page).to have_text(text) } From 6086f05524ddabd54fa64242150decec9d5ff153 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Tue, 4 May 2021 16:08:53 +0200 Subject: [PATCH 4/6] corrige le lien annuaire lorsque le siren n'est pas connu --- app/helpers/dossier_helper.rb | 6 ++++++ app/views/shared/dossiers/_identite_entreprise.html.haml | 2 +- .../dossiers/etablissement/_infos_entreprise.html.haml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/dossier_helper.rb b/app/helpers/dossier_helper.rb index a67f65713..3812af890 100644 --- a/app/helpers/dossier_helper.rb +++ b/app/helpers/dossier_helper.rb @@ -101,4 +101,10 @@ module DossierHelper end end end + + def annuaire_link(siren) + base_url = "https://annuaire-entreprises.data.gouv.fr" + return base_url if siren.blank? + "#{base_url}/entreprise/#{siren}" + end end diff --git a/app/views/shared/dossiers/_identite_entreprise.html.haml b/app/views/shared/dossiers/_identite_entreprise.html.haml index ef0b2aeee..de626ac58 100644 --- a/app/views/shared/dossiers/_identite_entreprise.html.haml +++ b/app/views/shared/dossiers/_identite_entreprise.html.haml @@ -146,5 +146,5 @@ %p = link_to "➡ Autres informations sur l’organisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche d'immatriculation RNCS)", - "https://annuaire-entreprises.data.gouv.fr/entreprise/#{etablissement.siren}", + annuaire_link(etablissement.siren), target: "_blank" diff --git a/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml b/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml index cf95693a9..fc9458f5f 100644 --- a/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml +++ b/app/views/users/dossiers/etablissement/_infos_entreprise.html.haml @@ -31,5 +31,5 @@ %p.etablissement-exercices Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier. %p = link_to "➡ Autres informations sur l’organisme sur « annuaire-entreprises.data.gouv.fr »", - "https://annuaire-entreprises.data.gouv.fr/entreprise/#{etablissement.siren}", + annuaire_link(etablissement.siren), target: "_blank" From dc33f4a39560ec1204d00fd0f14686d7154575e5 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 6 May 2021 11:11:04 +0200 Subject: [PATCH 5/6] manager: use administrate helper to retrieve resource path This is lifted from the current default template provided by administrate. --- app/views/manager/application/_navigation.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/manager/application/_navigation.html.erb b/app/views/manager/application/_navigation.html.erb index f14689546..c247ac775 100644 --- a/app/views/manager/application/_navigation.html.erb +++ b/app/views/manager/application/_navigation.html.erb @@ -16,7 +16,7 @@ as defined by the routes in the `admin/` namespace <%= link_to( display_resource_name(resource), - [namespace, resource.path], + resource_index_route(resource), class: "navigation__link navigation__link--#{nav_link_state(resource)}" ) %> <% end %> From ce6a27d41660495b0fc53eb17e104c0302639005 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 6 May 2021 11:17:17 +0200 Subject: [PATCH 6/6] manager: upgrade administrate to be compatible with Rails 6.1.3.2 Rails 6.1.3.2 is a security upgrade, and we had to upgrade quickly. Unfortunately that broke the administrate gem. A PR has been opened to fix the issues with the newest Rails version, and will probably be merged quickly. Meanwhile we can fix the manager by using the version from the PR for now. Once the PR is merged and a new version of administrate is released, we can use a released version of administrate again. --- Gemfile | 2 +- Gemfile.lock | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 1fd7947eb..6c50d0d32 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'active_link_to' # Automatically set a class on active links gem 'active_model_serializers' gem 'activestorage-openstack' gem 'active_storage_validations' -gem 'administrate' +gem 'administrate', git: 'https://github.com/thoughtbot/administrate.git', ref: 'refs/pull/1972/head' # Provides an administration UI (pull request #1972 has fixes for Rails 6.1.3.2) gem 'after_party' gem 'anchored' gem 'bcrypt' diff --git a/Gemfile.lock b/Gemfile.lock index 9dc2bf25f..adf2a9b6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,6 +6,22 @@ GIT open4 (~> 1.3.4) rake +GIT + remote: https://github.com/thoughtbot/administrate.git + revision: 27404f6bbbfa8ae7227ff205ac8cc4ad194194dd + ref: refs/pull/1972/head + specs: + administrate (0.15.0) + actionpack (>= 5.0) + actionview (>= 5.0) + activerecord (>= 5.0) + datetime_picker_rails (~> 0.0.7) + jquery-rails (>= 4.0) + kaminari (>= 1.0) + momentjs-rails (~> 2.8) + sassc-rails (~> 2.1) + selectize-rails (~> 0.6) + GEM remote: https://rubygems.org/ specs: @@ -86,17 +102,6 @@ GEM zeitwerk (~> 2.3) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - administrate (0.14.0) - actionpack (>= 4.2) - actionview (>= 4.2) - activerecord (>= 4.2) - autoprefixer-rails (>= 6.0) - datetime_picker_rails (~> 0.0.7) - jquery-rails (>= 4.0) - kaminari (>= 1.0) - momentjs-rails (~> 2.8) - sassc-rails (~> 2.1) - selectize-rails (~> 0.6) aes_key_wrap (1.1.0) after_party (1.11.2) anchored (1.1.0) @@ -107,8 +112,6 @@ GEM attr_encrypted (3.1.0) encryptor (~> 3.0.0) attr_required (1.0.1) - autoprefixer-rails (10.2.4.0) - execjs axe-matchers (2.6.1) dumb_delegator (~> 0.8) virtus (~> 1.0) @@ -772,7 +775,7 @@ DEPENDENCIES active_model_serializers active_storage_validations activestorage-openstack - administrate + administrate! after_party anchored annotate