From 1226d703fe21cb15169b8166cc82c650b7110d85 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 1 Apr 2019 10:27:16 +0200 Subject: [PATCH 1/6] Rename license file Fix #3711 --- LICENSE.agpl-3.0.txt => LICENSE.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.agpl-3.0.txt => LICENSE.txt (100%) diff --git a/LICENSE.agpl-3.0.txt b/LICENSE.txt similarity index 100% rename from LICENSE.agpl-3.0.txt rename to LICENSE.txt From 031c40aa55db71a181dd10b8939dae08c504e123 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 2 Apr 2019 14:29:00 +0200 Subject: [PATCH 2/6] stats: display 12 weeks of feedbacks --- app/controllers/stats_controller.rb | 2 +- spec/controllers/stats_controller_spec.rb | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index a2c1f0214..a6febb8e3 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -132,7 +132,7 @@ class StatsController < ApplicationController Feedback.ratings.fetch(:happy) => "Satisfaits" } - number_of_weeks = 6 + number_of_weeks = 12 totals = Feedback .group_by_week(:created_at, last: number_of_weeks, current: false) .count diff --git a/spec/controllers/stats_controller_spec.rb b/spec/controllers/stats_controller_spec.rb index 0744ba38c..b70d75fab 100644 --- a/spec/controllers/stats_controller_spec.rb +++ b/spec/controllers/stats_controller_spec.rb @@ -228,20 +228,17 @@ describe StatsController, type: :controller do it 'returns weekly ratios between a given feedback and all feedback' do happy_data = stats.find { |g| g[:name] == 'Satisfaits' }[:data] - expect(happy_data.values[0]).to eq 0 - expect(happy_data.values[1]).to eq 0 - expect(happy_data.values[2]).to eq 0 - expect(happy_data.values[3]).to eq 25.0 - expect(happy_data.values[4]).to eq 50.0 - expect(happy_data.values[5]).to eq 75.0 + + expect(happy_data.values[-4]).to eq 0 + expect(happy_data.values[-3]).to eq 25.0 + expect(happy_data.values[-2]).to eq 50.0 + expect(happy_data.values[-1]).to eq 75.0 unhappy_data = stats.find { |g| g[:name] == 'Mécontents' }[:data] - expect(unhappy_data.values[0]).to eq 0 - expect(unhappy_data.values[1]).to eq 0 - expect(unhappy_data.values[2]).to eq 0 - expect(unhappy_data.values[3]).to eq 75.0 - expect(unhappy_data.values[4]).to eq 50.0 - expect(unhappy_data.values[5]).to eq 25.0 + expect(unhappy_data.values[-4]).to eq 0 + expect(unhappy_data.values[-3]).to eq 75.0 + expect(unhappy_data.values[-2]).to eq 50.0 + expect(unhappy_data.values[-1]).to eq 25.0 end it 'excludes values still in the current week' do From a8050ce13646f705e9c5c91cd4454a21d294b0af Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 2 Apr 2019 14:29:17 +0200 Subject: [PATCH 3/6] stats: display only the last year of contact rate --- app/controllers/stats_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index a6febb8e3..571e6d79f 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -162,7 +162,9 @@ class StatsController < ApplicationController end def contact_percentage - from = Date.new(2018, 1) + number_of_months = 13 + + from = Date.today.prev_month(number_of_months) to = Date.today.prev_month adapter = Helpscout::UserConversationsAdapter.new(from, to) From e71cdcd12c3e2c157e598f6185f2a7c894495475 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 26 Mar 2019 16:02:08 +0100 Subject: [PATCH 4/6] Move all the trackers to a separate js pack --- .eslintrc.js | 3 +- Gemfile | 1 + Gemfile.lock | 5 + app/controllers/application_controller.rb | 56 +++++++++++ app/helpers/application_helper.rb | 13 --- app/javascript/packs/application-old.js | 1 - app/javascript/packs/application.js | 1 - app/javascript/packs/sendinblue.js | 1 + app/javascript/packs/track.js | 2 + app/javascript/shared/data.js | 13 --- app/javascript/shared/sentry.js | 14 --- app/javascript/shared/track/matomo.js | 47 +++++++++ app/javascript/shared/track/sendinblue.js | 22 ++++ app/javascript/shared/track/sentry.js | 14 +++ app/views/layouts/_matomo.html.haml | 35 ------- app/views/layouts/_sendinblue.html.haml | 14 --- app/views/layouts/application.html.haml | 16 ++- app/views/layouts/application_old.html.haml | 12 +-- config/env.example | 5 + config/secrets.yml | 7 ++ package.json | 2 +- yarn.lock | 106 ++++++++------------ 22 files changed, 216 insertions(+), 174 deletions(-) create mode 100644 app/javascript/packs/sendinblue.js create mode 100644 app/javascript/packs/track.js delete mode 100644 app/javascript/shared/data.js delete mode 100644 app/javascript/shared/sentry.js create mode 100644 app/javascript/shared/track/matomo.js create mode 100644 app/javascript/shared/track/sendinblue.js create mode 100644 app/javascript/shared/track/sentry.js delete mode 100644 app/views/layouts/_matomo.html.haml delete mode 100644 app/views/layouts/_sendinblue.html.haml diff --git a/.eslintrc.js b/.eslintrc.js index 98251b315..eb5759ea0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,7 +5,8 @@ module.exports = { sourceType: 'module' }, globals: { - 'process': true + 'process': true, + 'gon': true }, plugins: ['prettier'], extends: ['eslint:recommended', 'prettier'], diff --git a/Gemfile b/Gemfile index 0d559692a..f99de3a28 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,7 @@ gem 'dotenv-rails', require: 'dotenv/rails-now' # dotenv should always be loaded gem 'flipflop' gem 'fog-openstack' gem 'font-awesome-rails' +gem 'gon' gem 'groupdate' gem 'haml-rails' gem 'hashie' diff --git a/Gemfile.lock b/Gemfile.lock index 1698f81a4..7b73b165c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -224,6 +224,10 @@ GEM formatador (0.2.5) globalid (0.4.2) activesupport (>= 4.2.0) + gon (6.2.1) + actionpack (>= 3.0) + multi_json + request_store (>= 1.0) groupdate (4.1.1) activesupport (>= 4.2) guard (2.15.0) @@ -686,6 +690,7 @@ DEPENDENCIES flipflop fog-openstack font-awesome-rails + gon groupdate guard guard-livereload diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9893212ad..46a6d155e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -15,6 +15,7 @@ class ApplicationController < ActionController::Base before_action :staging_authenticate before_action :set_active_storage_host + before_action :setup_tracking def staging_authenticate if StagingAuthService.enabled? && !authenticate_with_http_basic { |username, password| StagingAuthService.authenticate(username, password) } @@ -89,6 +90,15 @@ class ApplicationController < ActionController::Base ActiveStorage::Current.host = request.base_url end + def setup_tracking + gon.matomo = matomo_config + gon.sentry = sentry_config + + if administrateur_signed_in? + gon.sendinblue = sendinblue_config + end + end + def logged_users @logged_users ||= [ current_user, @@ -190,4 +200,50 @@ class ApplicationController < ActionController::Base true end end + + def sentry_config + sentry = Rails.application.secrets.sentry + + { + key: sentry[:client_key], + enabled: sentry[:enabled], + user: { + id: current_user&.id, + email: current_email + } + } + end + + def matomo_config + matomo = Rails.application.secrets.matomo + + { + key: matomo[:client_key], + enabled: matomo[:enabled] + } + end + + def sendinblue_config + sendinblue = Rails.application.secrets.sendinblue + + { + key: sendinblue[:client_key], + enabled: sendinblue[:enabled], + administrateur: { + email: current_administrateur&.email, + payload: { + DS_SIGN_IN_COUNT: current_administrateur&.sign_in_count, + DS_CREATED_AT: current_administrateur&.created_at, + DS_ACTIVE: current_administrateur&.active, + DS_ID: current_administrateur&.id + } + } + } + end + + def current_email + current_user&.email || + current_gestionnaire&.email || + current_administrateur&.email + end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 28dc0af2a..08565167f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -106,17 +106,4 @@ module ApplicationHelper root_path end end - - def sentry_config - sentry = Rails.application.secrets.sentry - if sentry - { - dsn: sentry[:browser], - id: current_user&.id, - email: current_email - }.to_json - else - {} - end - end end diff --git a/app/javascript/packs/application-old.js b/app/javascript/packs/application-old.js index 4e327c228..2b457ccb1 100644 --- a/app/javascript/packs/application-old.js +++ b/app/javascript/packs/application-old.js @@ -5,7 +5,6 @@ import * as ActiveStorage from 'activestorage'; import jQuery from 'jquery'; import '../shared/activestorage/ujs'; -import '../shared/sentry'; import '../shared/rails-ujs-fix'; import '../shared/safari-11-file-xhr-workaround'; import '../shared/autocomplete'; diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index df20804b9..78a1712f5 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -6,7 +6,6 @@ import Chartkick from 'chartkick'; import Highcharts from 'highcharts'; import '../shared/activestorage/ujs'; -import '../shared/sentry'; import '../shared/rails-ujs-fix'; import '../shared/safari-11-file-xhr-workaround'; import '../shared/autocomplete'; diff --git a/app/javascript/packs/sendinblue.js b/app/javascript/packs/sendinblue.js new file mode 100644 index 000000000..01e9b8317 --- /dev/null +++ b/app/javascript/packs/sendinblue.js @@ -0,0 +1 @@ +import '../shared/track/sendinblue'; diff --git a/app/javascript/packs/track.js b/app/javascript/packs/track.js new file mode 100644 index 000000000..32e8033b7 --- /dev/null +++ b/app/javascript/packs/track.js @@ -0,0 +1,2 @@ +import '../shared/track/matomo'; +import '../shared/track/sentry'; diff --git a/app/javascript/shared/data.js b/app/javascript/shared/data.js deleted file mode 100644 index 9947abfd8..000000000 --- a/app/javascript/shared/data.js +++ /dev/null @@ -1,13 +0,0 @@ -const _DATA = {}; - -function setupData() { - if (window.DATA.length) { - Object.assign(_DATA, ...window.DATA); - window.DATA.length = 0; - } -} - -export function getData(namespace) { - setupData(); - return namespace ? _DATA[namespace] : _DATA; -} diff --git a/app/javascript/shared/sentry.js b/app/javascript/shared/sentry.js deleted file mode 100644 index 7332390d0..000000000 --- a/app/javascript/shared/sentry.js +++ /dev/null @@ -1,14 +0,0 @@ -import { init, configureScope } from '@sentry/browser'; -import { getData } from './data'; - -const { dsn, email, id } = getData('sentry'); - -if (dsn) { - init({ dsn }); - - if (email) { - configureScope(scope => { - scope.setUser({ id, email }); - }); - } -} diff --git a/app/javascript/shared/track/matomo.js b/app/javascript/shared/track/matomo.js new file mode 100644 index 000000000..533c5a817 --- /dev/null +++ b/app/javascript/shared/track/matomo.js @@ -0,0 +1,47 @@ +const { key, enabled } = gon.matomo || {}; + +if (enabled) { + window._paq = window._paq || []; + + const url = '//stats.data.gouv.fr/'; + const trackerUrl = `${url}piwik.php`; + const jsUrl = `${url}piwik.js`; + + // Configure Matomo analytics + window._paq.push(['setCookieDomain', '*.www.demarches-simplifiees.fr']); + window._paq.push(['setDomains', ['*.www.demarches-simplifiees.fr']]); + window._paq.push(['setDoNotTrack', true]); + window._paq.push(['trackPageView']); + window._paq.push(['enableLinkTracking']); + + // Load script from Matomo + window._paq.push(['setTrackerUrl', trackerUrl]); + window._paq.push(['setSiteId', key]); + + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.type = 'text/javascript'; + script.id = 'matomo-js'; + script.async = true; + script.src = jsUrl; + firstScript.parentNode.insertBefore(script, firstScript); + + // Send Matomo a new event when navigating to a new page using Turbolinks + // (see https://developer.matomo.org/guides/spa-tracking) + let previousPageUrl = null; + addEventListener('turbolinks:load', event => { + if (previousPageUrl) { + window._paq.push(['setReferrerUrl', previousPageUrl]); + window._paq.push(['setCustomUrl', window.location.href]); + window._paq.push(['setDocumentTitle', document.title]); + if (event.data && event.data.timing) { + window._paq.push([ + 'setGenerationTimeMs', + event.data.timing.visitEnd - event.data.timing.visitStart + ]); + } + window._paq.push(['trackPageView']); + } + previousPageUrl = window.location.href; + }); +} diff --git a/app/javascript/shared/track/sendinblue.js b/app/javascript/shared/track/sendinblue.js new file mode 100644 index 000000000..c0ef1706f --- /dev/null +++ b/app/javascript/shared/track/sendinblue.js @@ -0,0 +1,22 @@ +const { key, enabled, administrateur } = gon.sendinblue || {}; + +if (enabled) { + window.sib = { + equeue: [], + client_key: key, + email_id: administrateur.email + }; + + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.type = 'text/javascript'; + script.id = 'sendinblue-js'; + script.async = true; + script.src = `https://sibautomation.com/sa.js?key=${window.sib.client_key}`; + firstScript.parentNode.insertBefore(script, firstScript); + + window.sib.equeue.push({ page: [] }); + window.sib.equeue.push({ + identify: [administrateur.email, administrateur.payload] + }); +} diff --git a/app/javascript/shared/track/sentry.js b/app/javascript/shared/track/sentry.js new file mode 100644 index 000000000..ffeb0b69e --- /dev/null +++ b/app/javascript/shared/track/sentry.js @@ -0,0 +1,14 @@ +import * as Sentry from '@sentry/browser'; + +const { key, enabled, user } = gon.sentry || {}; + +// We need to check for key presence here as we do not have a dsn for browser yet +if (enabled && key) { + Sentry.init({ dsn: key }); + + if (user.email) { + Sentry.configureScope(scope => { + scope.setUser(user); + }); + } +} diff --git a/app/views/layouts/_matomo.html.haml b/app/views/layouts/_matomo.html.haml deleted file mode 100644 index 90f62edf7..000000000 --- a/app/views/layouts/_matomo.html.haml +++ /dev/null @@ -1,35 +0,0 @@ -:javascript - var _paq = _paq || []; - // Configure Matomo analytics - _paq.push(["setCookieDomain", "*.www.demarches-simplifiees.fr"]); - _paq.push(["setDomains", ["*.www.demarches-simplifiees.fr"]]); - _paq.push(["setDoNotTrack", true]); - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking']); - - // Load script from Matomo - (function() { - var u="//stats.data.gouv.fr/"; - _paq.push(['setTrackerUrl', u+'piwik.php']); - _paq.push(['setSiteId', '73']); - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); - })(); - - // Send Matomo a new event when navigating to a new page using Turbolinks - // (see https://developer.matomo.org/guides/spa-tracking) - (function() { - var previousPageUrl = null; - addEventListener('turbolinks:load', function(event) { - if (previousPageUrl) { - _paq.push(['setReferrerUrl', previousPageUrl]); - _paq.push(['setCustomUrl', window.location.href]); - _paq.push(['setDocumentTitle', document.title]); - if (event.data && event.data.timing) { - _paq.push(['setGenerationTimeMs', event.data.timing.visitEnd - event.data.timing.visitStart]); - } - _paq.push(['trackPageView']); - } - previousPageUrl = window.location.href; - }); - })(); diff --git a/app/views/layouts/_sendinblue.html.haml b/app/views/layouts/_sendinblue.html.haml deleted file mode 100644 index 283100cc8..000000000 --- a/app/views/layouts/_sendinblue.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -:javascript - (function() { - window.sib = { equeue: [], client_key: "#{Rails.application.secrets.sendinblue[:client_key]}" }; - /* OPTIONAL: email for identify request*/ - window.sib.email_id = '#{current_administrateur.email}'; - window.sendinblue = {}; for (var j = ['track', 'identify', 'trackLink', 'page'], i = 0; i < j.length; i++) { (function(k) { window.sendinblue[k] = function() { var arg = Array.prototype.slice.call(arguments); (window.sib[k] || function() { var t = {}; t[k] = arg; window.sib.equeue.push(t);})(arg[0], arg[1], arg[2]);};})(j[i]);}var n = document.createElement("script"),i = document.getElementsByTagName("script")[0]; n.type = "text/javascript", n.id = "sendinblue-js", n.async = !0, n.src = "https://sibautomation.com/sa.js?key=" + window.sib.client_key, i.parentNode.insertBefore(n, i), window.sendinblue.page(); - })(); - - sendinblue.identify('#{current_administrateur.email}', { - 'DS_SIGN_IN_COUNT' : '#{current_administrateur.sign_in_count}', - 'DS_CREATED_AT' : '#{current_administrateur.created_at}', - 'DS_ACTIVE' : '#{current_administrateur.active}', - 'DS_ID' : '#{current_administrateur.id}' - }); diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8dae66ea3..c5b496135 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -18,19 +18,11 @@ = stylesheet_link_tag 'new_design/new_application', media: 'all', 'data-turbolinks-track': 'reload' = stylesheet_link_tag 'new_design/print', media: 'print', 'data-turbolinks-track': 'reload' + = Gon::Base.render_data(camel_case: true, init: true) + - if Rails.env.development? = stylesheet_link_tag :xray - = render partial: "layouts/matomo" - - if administrateur_signed_in? - = render partial: "layouts/sendinblue" - - - :javascript - DATA = [{ - sentry: #{raw(sentry_config)} - }]; - %body{ class: browser.platform.ios? ? 'ios' : nil } .page-wrapper = render partial: "layouts/outdated_browser_banner" @@ -50,3 +42,7 @@ = javascript_include_tag :xray = yield :charts_js + + = javascript_pack_tag 'track', async: true + - if administrateur_signed_in? + = javascript_pack_tag 'sendinblue', async: true diff --git a/app/views/layouts/application_old.html.haml b/app/views/layouts/application_old.html.haml index 633e368dc..9ba2f5f95 100644 --- a/app/views/layouts/application_old.html.haml +++ b/app/views/layouts/application_old.html.haml @@ -15,14 +15,7 @@ = javascript_pack_tag 'application-old', defer: true, 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', defer: true, 'data-turbolinks-track': 'reload' = csrf_meta_tags - - = render partial: "layouts/matomo" - = render partial: "layouts/sendinblue" - - :javascript - DATA = [{ - sentry: #{raw(sentry_config)} - }]; + = Gon::Base.render_data(camel_case: true, init: true) %body{ class: browser.platform.ios? ? 'ios' : nil } = render partial: 'layouts/outdated_browser_banner' @@ -49,3 +42,6 @@ %i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' } = render partial: 'layouts/footer', locals: { main_container_size: main_container_size } + = javascript_pack_tag 'track', async: true + - if administrateur_signed_in? + = javascript_pack_tag 'sendinblue', async: true diff --git a/config/env.example b/config/env.example index d3703ea5e..fca754aef 100644 --- a/config/env.example +++ b/config/env.example @@ -41,6 +41,11 @@ SENTRY_ENABLED="disabled" SENTRY_DSN_RAILS="" SENTRY_DSN_JS="" +MATOMO_ENABLED="disabled" +MATOMO_ID="73" + +SENDINBLUE_ENABLED="disabled" + MAILTRAP_ENABLED="disabled" MAILTRAP_USERNAME="" MAILTRAP_PASSWORD="" diff --git a/config/secrets.yml b/config/secrets.yml index a348592af..f010c0392 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -52,7 +52,14 @@ defaults: &defaults client_secret: <%= ENV['HELPSCOUT_CLIENT_SECRET'] %> webhook_secret: <%= ENV['HELPSCOUT_WEBHOOK_SECRET'] %> sendinblue: + enabled: <%= ENV['SENDINBLUE_ENABLED'] == 'enabled' %> client_key: <%= ENV['SENDINBLUE_CLIENT_KEY'] %> + matomo: + enabled: <%= ENV['MATOMO_ENABLED'] == 'enabled' %> + client_key: <%= ENV['MATOMO_ID'] %> + sentry: + enabled: <%= ENV['SENTRY_ENABLED'] == 'enabled' %> + client_key: <%= ENV['SENTRY_DSN_JS'] %> development: <<: *defaults diff --git a/package.json b/package.json index d492b0e63..a28043884 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@rails/webpacker": "4.0.0-pre.3", - "@sentry/browser": "^4.0.4", + "@sentry/browser": "^4.6.5", "@turf/area": "^6.0.1", "activestorage": "^5.2.2-rc1", "autocomplete.js": "^0.31.0", diff --git a/yarn.lock b/yarn.lock index f79347345..e9b2f2ce8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,58 +677,57 @@ webpack-cli "^3.1.0" webpack-sources "^1.2.0" -"@sentry/browser@^4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-4.0.4.tgz#6dfe05099d9ce23d7e9becaa905af5406520d448" - integrity sha512-qlrJICz5AqB+hz9p5DKC/Fl2pRnN6Rsl+cQQCraXQXroE3C+Z50bbIWEIwns11d//NpeRTOyHDNBqzXlNiy4YQ== +"@sentry/browser@^4.6.5": + version "4.6.5" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-4.6.5.tgz#ecae280400117fef039db1b678e110a7d3e98a10" + integrity sha512-sIbEDTdZeRN+jzCEHGBOdidjSv+ZmJ9VPfek+bnP5FZNyUYfaZRrwWG0sJPPb8SlhSPUQXSI1t1saRhvd+Gs4A== dependencies: - "@sentry/core" "4.0.3" - "@sentry/types" "4.0.1" - "@sentry/utils" "4.0.1" - md5 "2.2.1" + "@sentry/core" "4.6.5" + "@sentry/types" "4.5.3" + "@sentry/utils" "4.6.5" + tslib "^1.9.3" -"@sentry/core@4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.0.3.tgz#4f8fd67888f1cf0f1a984c5fa362122b60e8bd08" - integrity sha512-vK6Ytk88STVk8rBxXnhOpo3ujlpPfQwiAFZDo+h7qJ0Xci5QxijqOHHZGEoBKF2ZhQAsohtt77DUIvOgiGr6Xw== +"@sentry/core@4.6.5": + version "4.6.5" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.6.5.tgz#70b4bcfc555f7eff80581a17baadac5500c2f75d" + integrity sha512-dT0FATtKAgd4dashwK+S2vYzCXIga3VJFJgkZVTK2aoy45E56ztxcbmNdI8O+3e67tGM5Il6CrD2fZg5yLty9A== dependencies: - "@sentry/hub" "4.0.1" - "@sentry/minimal" "4.0.1" - "@sentry/types" "4.0.1" - "@sentry/utils" "4.0.1" + "@sentry/hub" "4.6.5" + "@sentry/minimal" "4.6.5" + "@sentry/types" "4.5.3" + "@sentry/utils" "4.6.5" + tslib "^1.9.3" -"@sentry/hub@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-4.0.1.tgz#01870cede195029ae32d763199ff6c3e4edf99d1" - integrity sha512-XLpVrB8MJcquZpVstv7pXq1qjWH80mX7hln2CxWfeQTT5OmUMPGz0NbcaUyPA/QisvMYNo9eeVe2+lTnmSn5+Q== +"@sentry/hub@4.6.5": + version "4.6.5" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-4.6.5.tgz#451def7bc8d90d9cc007f58f364b3ce305c4701a" + integrity sha512-v9vee8s8C1fK/DPtNOzv6r+AMbPDOWfnasouNcBUkbQUSN5wUNyCDvt51QbWaw5kMMY5TSqjdVqY6gXQZI0APQ== dependencies: - "@sentry/types" "4.0.0" - "@sentry/utils" "4.0.1" + "@sentry/types" "4.5.3" + "@sentry/utils" "4.6.5" + tslib "^1.9.3" -"@sentry/minimal@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-4.0.1.tgz#c51a2af81eba48977fb54ab187e0c0eb0ad12c15" - integrity sha512-KKrgVATezmf/Wt1c0yH8csRwvV4s6TFGY1R3lgBwql3pKl3YYfL7RMqBke5elG9/3zWl6W4G9cleKZGAPLSvTA== +"@sentry/minimal@4.6.5": + version "4.6.5" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-4.6.5.tgz#64433d2c9fda69eedbb61855a7ff8905f7b19218" + integrity sha512-tf+J+uUNmSgzC7d9JSN8Ekw1HeBAX87Efa/jyFbzLvaw80oibvTiLSLqDjQ9PgvyIzBUuuPImkS2NpvPQGWFtg== dependencies: - "@sentry/hub" "4.0.1" - "@sentry/types" "4.0.0" + "@sentry/hub" "4.6.5" + "@sentry/types" "4.5.3" + tslib "^1.9.3" -"@sentry/types@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.0.0.tgz#9dd46a7b05004871fe0cea0b0423098d9d91a173" - integrity sha512-UaGfdu9DTcdQjyZ7nSQXAX4Nz1EzwDY6lFMfWxvb3hq7qDvr3bg0LOSFyjELbS6RcAkXwjB8BLpicABAXao3ag== +"@sentry/types@4.5.3": + version "4.5.3" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.5.3.tgz#3350dce2b7f9b936a8c327891c12e3aef7bd8852" + integrity sha512-7ll1PAFNjrBNX9rzy3P2qAQrpQwHaDO3uKj735qsnGw34OtAS8Xr8WYrjI14f9fMPa/XIeWvMPb4GMic28V/ag== -"@sentry/types@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.0.1.tgz#f9342e905ce2aee71975574589d915b6fb691fb0" - integrity sha512-1Cq2gk/wZuBHB//HO830nykysHEsvZpjFcoIBHyqsJ7GjjcMxRAnO8ix0aw3hRfOsiPgD3mp8QomY9DqRHbjjA== - -"@sentry/utils@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-4.0.1.tgz#5690058fb030c23d46ea056aa3e8ebebb8105d45" - integrity sha512-SYbE1oe94TPnzcMlGZyCgIfo8e0NpkDo8sX1w43yHcE4HUbJ0NpK8z2FF4h52hShaog4ceLIXXSiYIKoKaJa2A== +"@sentry/utils@4.6.5": + version "4.6.5" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-4.6.5.tgz#4c960524914311eb76bbd6ca7f80f4d98c04db7f" + integrity sha512-rTISJtRRbWsd3UE+TkA3QG1C0VzPKPW8w74tieBwYhtTCGmOHNwz2nDC/MZGbGj4OgDmNKKl4CCyQr88EX08hA== dependencies: - "@sentry/types" "4.0.0" + "@sentry/types" "4.5.3" + tslib "^1.9.3" "@sindresorhus/is@^0.7.0": version "0.7.0" @@ -1796,11 +1795,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -charenc@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= - chartkick@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/chartkick/-/chartkick-3.0.1.tgz#f325041bfc15f5d18074d4803549efc3751ccd81" @@ -2276,11 +2270,6 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -crypt@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -4286,7 +4275,7 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.1.5, is-buffer@~1.1.1: +is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -5035,15 +5024,6 @@ md5.js@^1.3.4: hash-base "^3.0.0" inherits "^2.0.1" -md5@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" - integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk= - dependencies: - charenc "~0.0.1" - crypt "~0.0.1" - is-buffer "~1.1.1" - mdn-data@~1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" @@ -8158,7 +8138,7 @@ trim-right@^1.0.1: dependencies: glob "^6.0.4" -tslib@^1.9.0: +tslib@^1.9.0, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== From 015a591efdfec7240b8f5f513f8e595cfaef7ba2 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 2 Apr 2019 14:45:59 +0200 Subject: [PATCH 5/6] commencer: fix fat two-lines button on small screens --- app/assets/stylesheets/new_design/commencer.scss | 6 ++++++ app/views/commencer/show.html.haml | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/new_design/commencer.scss b/app/assets/stylesheets/new_design/commencer.scss index 5da4faf86..3244987c7 100644 --- a/app/assets/stylesheets/new_design/commencer.scss +++ b/app/assets/stylesheets/new_design/commencer.scss @@ -8,4 +8,10 @@ .button { margin-bottom: 2 * $default-spacer; } + + @media (max-width: 450px) { + .optional-on-small-screens { + display: none; + } + } } diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml index df2325d3a..bed41a69f 100644 --- a/app/views/commencer/show.html.haml +++ b/app/views/commencer/show.html.haml @@ -3,7 +3,10 @@ .commencer.form - if !user_signed_in? %h1 Commencer la démarche - = link_to 'Créer un compte demarches-simplifiees.fr', commencer_sign_up_path(path: @procedure.path), class: ['button large expand primary'] + = link_to commencer_sign_up_path(path: @procedure.path), class: ['button large expand primary'] do + Créer un compte + %span.optional-on-small-screens + demarches-simplifiees.fr = link_to 'J’ai déjà un compte', commencer_sign_in_path(path: @procedure.path), class: ['button large expand'] - else From a5983838561848a344b7140a4542c9f21879833a Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 3 Apr 2019 11:24:51 +0200 Subject: [PATCH 6/6] locales: tell that API Entreprise is unavailable for now --- config/locales/fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bcf7db077..f1a446173 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -182,7 +182,7 @@ fr: dossier_map_not_activated: "Le dossier n'a pas accès à la cartographie." invalid_siret: "Le siret est incorrect" procedure_not_found: "La démarche n'existe pas" - siret_unknown: 'Désolé, nous n’avons pas trouvé d’établissement enregistré correspondant à ce numéro SIRET' + siret_unknown: 'Désolé, la récupération des informations SIRET est temporairement indisponible. Veuillez ré-essayer dans une heure.' etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET' france_connect: connexion: "Erreur lors de la connexion à France Connect."