commit
7e27409c42
28 changed files with 240 additions and 190 deletions
|
@ -5,7 +5,8 @@ module.exports = {
|
||||||
sourceType: 'module'
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
'process': true
|
'process': true,
|
||||||
|
'gon': true
|
||||||
},
|
},
|
||||||
plugins: ['prettier'],
|
plugins: ['prettier'],
|
||||||
extends: ['eslint:recommended', 'prettier'],
|
extends: ['eslint:recommended', 'prettier'],
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -28,6 +28,7 @@ gem 'dotenv-rails', require: 'dotenv/rails-now' # dotenv should always be loaded
|
||||||
gem 'flipflop'
|
gem 'flipflop'
|
||||||
gem 'fog-openstack'
|
gem 'fog-openstack'
|
||||||
gem 'font-awesome-rails'
|
gem 'font-awesome-rails'
|
||||||
|
gem 'gon'
|
||||||
gem 'groupdate'
|
gem 'groupdate'
|
||||||
gem 'haml-rails'
|
gem 'haml-rails'
|
||||||
gem 'hashie'
|
gem 'hashie'
|
||||||
|
|
|
@ -224,6 +224,10 @@ GEM
|
||||||
formatador (0.2.5)
|
formatador (0.2.5)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
gon (6.2.1)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
multi_json
|
||||||
|
request_store (>= 1.0)
|
||||||
groupdate (4.1.1)
|
groupdate (4.1.1)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
guard (2.15.0)
|
guard (2.15.0)
|
||||||
|
@ -686,6 +690,7 @@ DEPENDENCIES
|
||||||
flipflop
|
flipflop
|
||||||
fog-openstack
|
fog-openstack
|
||||||
font-awesome-rails
|
font-awesome-rails
|
||||||
|
gon
|
||||||
groupdate
|
groupdate
|
||||||
guard
|
guard
|
||||||
guard-livereload
|
guard-livereload
|
||||||
|
|
|
@ -8,4 +8,10 @@
|
||||||
.button {
|
.button {
|
||||||
margin-bottom: 2 * $default-spacer;
|
margin-bottom: 2 * $default-spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 450px) {
|
||||||
|
.optional-on-small-screens {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
before_action :staging_authenticate
|
before_action :staging_authenticate
|
||||||
before_action :set_active_storage_host
|
before_action :set_active_storage_host
|
||||||
|
before_action :setup_tracking
|
||||||
|
|
||||||
def staging_authenticate
|
def staging_authenticate
|
||||||
if StagingAuthService.enabled? && !authenticate_with_http_basic { |username, password| StagingAuthService.authenticate(username, password) }
|
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
|
ActiveStorage::Current.host = request.base_url
|
||||||
end
|
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
|
def logged_users
|
||||||
@logged_users ||= [
|
@logged_users ||= [
|
||||||
current_user,
|
current_user,
|
||||||
|
@ -190,4 +200,50 @@ class ApplicationController < ActionController::Base
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
|
@ -132,7 +132,7 @@ class StatsController < ApplicationController
|
||||||
Feedback.ratings.fetch(:happy) => "Satisfaits"
|
Feedback.ratings.fetch(:happy) => "Satisfaits"
|
||||||
}
|
}
|
||||||
|
|
||||||
number_of_weeks = 6
|
number_of_weeks = 12
|
||||||
totals = Feedback
|
totals = Feedback
|
||||||
.group_by_week(:created_at, last: number_of_weeks, current: false)
|
.group_by_week(:created_at, last: number_of_weeks, current: false)
|
||||||
.count
|
.count
|
||||||
|
@ -162,7 +162,9 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def contact_percentage
|
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
|
to = Date.today.prev_month
|
||||||
|
|
||||||
adapter = Helpscout::UserConversationsAdapter.new(from, to)
|
adapter = Helpscout::UserConversationsAdapter.new(from, to)
|
||||||
|
|
|
@ -106,17 +106,4 @@ module ApplicationHelper
|
||||||
root_path
|
root_path
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
|
@ -5,7 +5,6 @@ import * as ActiveStorage from 'activestorage';
|
||||||
import jQuery from 'jquery';
|
import jQuery from 'jquery';
|
||||||
|
|
||||||
import '../shared/activestorage/ujs';
|
import '../shared/activestorage/ujs';
|
||||||
import '../shared/sentry';
|
|
||||||
import '../shared/rails-ujs-fix';
|
import '../shared/rails-ujs-fix';
|
||||||
import '../shared/safari-11-file-xhr-workaround';
|
import '../shared/safari-11-file-xhr-workaround';
|
||||||
import '../shared/autocomplete';
|
import '../shared/autocomplete';
|
||||||
|
|
|
@ -6,7 +6,6 @@ import Chartkick from 'chartkick';
|
||||||
import Highcharts from 'highcharts';
|
import Highcharts from 'highcharts';
|
||||||
|
|
||||||
import '../shared/activestorage/ujs';
|
import '../shared/activestorage/ujs';
|
||||||
import '../shared/sentry';
|
|
||||||
import '../shared/rails-ujs-fix';
|
import '../shared/rails-ujs-fix';
|
||||||
import '../shared/safari-11-file-xhr-workaround';
|
import '../shared/safari-11-file-xhr-workaround';
|
||||||
import '../shared/autocomplete';
|
import '../shared/autocomplete';
|
||||||
|
|
1
app/javascript/packs/sendinblue.js
Normal file
1
app/javascript/packs/sendinblue.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
import '../shared/track/sendinblue';
|
2
app/javascript/packs/track.js
Normal file
2
app/javascript/packs/track.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import '../shared/track/matomo';
|
||||||
|
import '../shared/track/sentry';
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -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 });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
47
app/javascript/shared/track/matomo.js
Normal file
47
app/javascript/shared/track/matomo.js
Normal file
|
@ -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;
|
||||||
|
});
|
||||||
|
}
|
22
app/javascript/shared/track/sendinblue.js
Normal file
22
app/javascript/shared/track/sendinblue.js
Normal file
|
@ -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]
|
||||||
|
});
|
||||||
|
}
|
14
app/javascript/shared/track/sentry.js
Normal file
14
app/javascript/shared/track/sentry.js
Normal file
|
@ -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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,10 @@
|
||||||
.commencer.form
|
.commencer.form
|
||||||
- if !user_signed_in?
|
- if !user_signed_in?
|
||||||
%h1 Commencer la démarche
|
%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']
|
= link_to 'J’ai déjà un compte', commencer_sign_in_path(path: @procedure.path), class: ['button large expand']
|
||||||
|
|
||||||
- else
|
- else
|
||||||
|
|
|
@ -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;
|
|
||||||
});
|
|
||||||
})();
|
|
|
@ -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}'
|
|
||||||
});
|
|
|
@ -18,19 +18,11 @@
|
||||||
= stylesheet_link_tag 'new_design/new_application', media: 'all', 'data-turbolinks-track': 'reload'
|
= 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'
|
= 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?
|
- if Rails.env.development?
|
||||||
= stylesheet_link_tag :xray
|
= 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 }
|
%body{ class: browser.platform.ios? ? 'ios' : nil }
|
||||||
.page-wrapper
|
.page-wrapper
|
||||||
= render partial: "layouts/outdated_browser_banner"
|
= render partial: "layouts/outdated_browser_banner"
|
||||||
|
@ -50,3 +42,7 @@
|
||||||
= javascript_include_tag :xray
|
= javascript_include_tag :xray
|
||||||
|
|
||||||
= yield :charts_js
|
= yield :charts_js
|
||||||
|
|
||||||
|
= javascript_pack_tag 'track', async: true
|
||||||
|
- if administrateur_signed_in?
|
||||||
|
= javascript_pack_tag 'sendinblue', async: true
|
||||||
|
|
|
@ -15,14 +15,7 @@
|
||||||
= javascript_pack_tag 'application-old', defer: true, 'data-turbolinks-track': 'reload'
|
= javascript_pack_tag 'application-old', defer: true, 'data-turbolinks-track': 'reload'
|
||||||
= javascript_include_tag 'application', defer: true, 'data-turbolinks-track': 'reload'
|
= javascript_include_tag 'application', defer: true, 'data-turbolinks-track': 'reload'
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
|
= Gon::Base.render_data(camel_case: true, init: true)
|
||||||
= render partial: "layouts/matomo"
|
|
||||||
= render partial: "layouts/sendinblue"
|
|
||||||
|
|
||||||
:javascript
|
|
||||||
DATA = [{
|
|
||||||
sentry: #{raw(sentry_config)}
|
|
||||||
}];
|
|
||||||
|
|
||||||
%body{ class: browser.platform.ios? ? 'ios' : nil }
|
%body{ class: browser.platform.ios? ? 'ios' : nil }
|
||||||
= render partial: 'layouts/outdated_browser_banner'
|
= render partial: 'layouts/outdated_browser_banner'
|
||||||
|
@ -49,3 +42,6 @@
|
||||||
%i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' }
|
%i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' }
|
||||||
|
|
||||||
= render partial: 'layouts/footer', locals: { main_container_size: main_container_size }
|
= 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
|
||||||
|
|
|
@ -41,6 +41,11 @@ SENTRY_ENABLED="disabled"
|
||||||
SENTRY_DSN_RAILS=""
|
SENTRY_DSN_RAILS=""
|
||||||
SENTRY_DSN_JS=""
|
SENTRY_DSN_JS=""
|
||||||
|
|
||||||
|
MATOMO_ENABLED="disabled"
|
||||||
|
MATOMO_ID="73"
|
||||||
|
|
||||||
|
SENDINBLUE_ENABLED="disabled"
|
||||||
|
|
||||||
MAILTRAP_ENABLED="disabled"
|
MAILTRAP_ENABLED="disabled"
|
||||||
MAILTRAP_USERNAME=""
|
MAILTRAP_USERNAME=""
|
||||||
MAILTRAP_PASSWORD=""
|
MAILTRAP_PASSWORD=""
|
||||||
|
|
|
@ -182,7 +182,7 @@ fr:
|
||||||
dossier_map_not_activated: "Le dossier n'a pas accès à la cartographie."
|
dossier_map_not_activated: "Le dossier n'a pas accès à la cartographie."
|
||||||
invalid_siret: "Le siret est incorrect"
|
invalid_siret: "Le siret est incorrect"
|
||||||
procedure_not_found: "La démarche n'existe pas"
|
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'
|
etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET'
|
||||||
france_connect:
|
france_connect:
|
||||||
connexion: "Erreur lors de la connexion à France Connect."
|
connexion: "Erreur lors de la connexion à France Connect."
|
||||||
|
|
|
@ -52,7 +52,14 @@ defaults: &defaults
|
||||||
client_secret: <%= ENV['HELPSCOUT_CLIENT_SECRET'] %>
|
client_secret: <%= ENV['HELPSCOUT_CLIENT_SECRET'] %>
|
||||||
webhook_secret: <%= ENV['HELPSCOUT_WEBHOOK_SECRET'] %>
|
webhook_secret: <%= ENV['HELPSCOUT_WEBHOOK_SECRET'] %>
|
||||||
sendinblue:
|
sendinblue:
|
||||||
|
enabled: <%= ENV['SENDINBLUE_ENABLED'] == 'enabled' %>
|
||||||
client_key: <%= ENV['SENDINBLUE_CLIENT_KEY'] %>
|
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:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rails/webpacker": "4.0.0-pre.3",
|
"@rails/webpacker": "4.0.0-pre.3",
|
||||||
"@sentry/browser": "^4.0.4",
|
"@sentry/browser": "^4.6.5",
|
||||||
"@turf/area": "^6.0.1",
|
"@turf/area": "^6.0.1",
|
||||||
"activestorage": "^5.2.2-rc1",
|
"activestorage": "^5.2.2-rc1",
|
||||||
"autocomplete.js": "^0.31.0",
|
"autocomplete.js": "^0.31.0",
|
||||||
|
|
|
@ -228,20 +228,17 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
it 'returns weekly ratios between a given feedback and all feedback' do
|
it 'returns weekly ratios between a given feedback and all feedback' do
|
||||||
happy_data = stats.find { |g| g[:name] == 'Satisfaits' }[:data]
|
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[-4]).to eq 0
|
||||||
expect(happy_data.values[2]).to eq 0
|
expect(happy_data.values[-3]).to eq 25.0
|
||||||
expect(happy_data.values[3]).to eq 25.0
|
expect(happy_data.values[-2]).to eq 50.0
|
||||||
expect(happy_data.values[4]).to eq 50.0
|
expect(happy_data.values[-1]).to eq 75.0
|
||||||
expect(happy_data.values[5]).to eq 75.0
|
|
||||||
|
|
||||||
unhappy_data = stats.find { |g| g[:name] == 'Mécontents' }[:data]
|
unhappy_data = stats.find { |g| g[:name] == 'Mécontents' }[:data]
|
||||||
expect(unhappy_data.values[0]).to eq 0
|
expect(unhappy_data.values[-4]).to eq 0
|
||||||
expect(unhappy_data.values[1]).to eq 0
|
expect(unhappy_data.values[-3]).to eq 75.0
|
||||||
expect(unhappy_data.values[2]).to eq 0
|
expect(unhappy_data.values[-2]).to eq 50.0
|
||||||
expect(unhappy_data.values[3]).to eq 75.0
|
expect(unhappy_data.values[-1]).to eq 25.0
|
||||||
expect(unhappy_data.values[4]).to eq 50.0
|
|
||||||
expect(unhappy_data.values[5]).to eq 25.0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'excludes values still in the current week' do
|
it 'excludes values still in the current week' do
|
||||||
|
|
106
yarn.lock
106
yarn.lock
|
@ -677,58 +677,57 @@
|
||||||
webpack-cli "^3.1.0"
|
webpack-cli "^3.1.0"
|
||||||
webpack-sources "^1.2.0"
|
webpack-sources "^1.2.0"
|
||||||
|
|
||||||
"@sentry/browser@^4.0.4":
|
"@sentry/browser@^4.6.5":
|
||||||
version "4.0.4"
|
version "4.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-4.0.4.tgz#6dfe05099d9ce23d7e9becaa905af5406520d448"
|
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-4.6.5.tgz#ecae280400117fef039db1b678e110a7d3e98a10"
|
||||||
integrity sha512-qlrJICz5AqB+hz9p5DKC/Fl2pRnN6Rsl+cQQCraXQXroE3C+Z50bbIWEIwns11d//NpeRTOyHDNBqzXlNiy4YQ==
|
integrity sha512-sIbEDTdZeRN+jzCEHGBOdidjSv+ZmJ9VPfek+bnP5FZNyUYfaZRrwWG0sJPPb8SlhSPUQXSI1t1saRhvd+Gs4A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/core" "4.0.3"
|
"@sentry/core" "4.6.5"
|
||||||
"@sentry/types" "4.0.1"
|
"@sentry/types" "4.5.3"
|
||||||
"@sentry/utils" "4.0.1"
|
"@sentry/utils" "4.6.5"
|
||||||
md5 "2.2.1"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/core@4.0.3":
|
"@sentry/core@4.6.5":
|
||||||
version "4.0.3"
|
version "4.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.0.3.tgz#4f8fd67888f1cf0f1a984c5fa362122b60e8bd08"
|
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.6.5.tgz#70b4bcfc555f7eff80581a17baadac5500c2f75d"
|
||||||
integrity sha512-vK6Ytk88STVk8rBxXnhOpo3ujlpPfQwiAFZDo+h7qJ0Xci5QxijqOHHZGEoBKF2ZhQAsohtt77DUIvOgiGr6Xw==
|
integrity sha512-dT0FATtKAgd4dashwK+S2vYzCXIga3VJFJgkZVTK2aoy45E56ztxcbmNdI8O+3e67tGM5Il6CrD2fZg5yLty9A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/hub" "4.0.1"
|
"@sentry/hub" "4.6.5"
|
||||||
"@sentry/minimal" "4.0.1"
|
"@sentry/minimal" "4.6.5"
|
||||||
"@sentry/types" "4.0.1"
|
"@sentry/types" "4.5.3"
|
||||||
"@sentry/utils" "4.0.1"
|
"@sentry/utils" "4.6.5"
|
||||||
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/hub@4.0.1":
|
"@sentry/hub@4.6.5":
|
||||||
version "4.0.1"
|
version "4.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-4.0.1.tgz#01870cede195029ae32d763199ff6c3e4edf99d1"
|
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-4.6.5.tgz#451def7bc8d90d9cc007f58f364b3ce305c4701a"
|
||||||
integrity sha512-XLpVrB8MJcquZpVstv7pXq1qjWH80mX7hln2CxWfeQTT5OmUMPGz0NbcaUyPA/QisvMYNo9eeVe2+lTnmSn5+Q==
|
integrity sha512-v9vee8s8C1fK/DPtNOzv6r+AMbPDOWfnasouNcBUkbQUSN5wUNyCDvt51QbWaw5kMMY5TSqjdVqY6gXQZI0APQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/types" "4.0.0"
|
"@sentry/types" "4.5.3"
|
||||||
"@sentry/utils" "4.0.1"
|
"@sentry/utils" "4.6.5"
|
||||||
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/minimal@4.0.1":
|
"@sentry/minimal@4.6.5":
|
||||||
version "4.0.1"
|
version "4.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-4.0.1.tgz#c51a2af81eba48977fb54ab187e0c0eb0ad12c15"
|
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-4.6.5.tgz#64433d2c9fda69eedbb61855a7ff8905f7b19218"
|
||||||
integrity sha512-KKrgVATezmf/Wt1c0yH8csRwvV4s6TFGY1R3lgBwql3pKl3YYfL7RMqBke5elG9/3zWl6W4G9cleKZGAPLSvTA==
|
integrity sha512-tf+J+uUNmSgzC7d9JSN8Ekw1HeBAX87Efa/jyFbzLvaw80oibvTiLSLqDjQ9PgvyIzBUuuPImkS2NpvPQGWFtg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/hub" "4.0.1"
|
"@sentry/hub" "4.6.5"
|
||||||
"@sentry/types" "4.0.0"
|
"@sentry/types" "4.5.3"
|
||||||
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/types@4.0.0":
|
"@sentry/types@4.5.3":
|
||||||
version "4.0.0"
|
version "4.5.3"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.0.0.tgz#9dd46a7b05004871fe0cea0b0423098d9d91a173"
|
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.5.3.tgz#3350dce2b7f9b936a8c327891c12e3aef7bd8852"
|
||||||
integrity sha512-UaGfdu9DTcdQjyZ7nSQXAX4Nz1EzwDY6lFMfWxvb3hq7qDvr3bg0LOSFyjELbS6RcAkXwjB8BLpicABAXao3ag==
|
integrity sha512-7ll1PAFNjrBNX9rzy3P2qAQrpQwHaDO3uKj735qsnGw34OtAS8Xr8WYrjI14f9fMPa/XIeWvMPb4GMic28V/ag==
|
||||||
|
|
||||||
"@sentry/types@4.0.1":
|
"@sentry/utils@4.6.5":
|
||||||
version "4.0.1"
|
version "4.6.5"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.0.1.tgz#f9342e905ce2aee71975574589d915b6fb691fb0"
|
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-4.6.5.tgz#4c960524914311eb76bbd6ca7f80f4d98c04db7f"
|
||||||
integrity sha512-1Cq2gk/wZuBHB//HO830nykysHEsvZpjFcoIBHyqsJ7GjjcMxRAnO8ix0aw3hRfOsiPgD3mp8QomY9DqRHbjjA==
|
integrity sha512-rTISJtRRbWsd3UE+TkA3QG1C0VzPKPW8w74tieBwYhtTCGmOHNwz2nDC/MZGbGj4OgDmNKKl4CCyQr88EX08hA==
|
||||||
|
|
||||||
"@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==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/types" "4.0.0"
|
"@sentry/types" "4.5.3"
|
||||||
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sindresorhus/is@^0.7.0":
|
"@sindresorhus/is@^0.7.0":
|
||||||
version "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"
|
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
|
||||||
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
|
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:
|
chartkick@^3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/chartkick/-/chartkick-3.0.1.tgz#f325041bfc15f5d18074d4803549efc3751ccd81"
|
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"
|
shebang-command "^1.2.0"
|
||||||
which "^1.2.9"
|
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:
|
crypto-browserify@^3.11.0:
|
||||||
version "3.12.0"
|
version "3.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
|
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:
|
dependencies:
|
||||||
binary-extensions "^1.0.0"
|
binary-extensions "^1.0.0"
|
||||||
|
|
||||||
is-buffer@^1.1.5, is-buffer@~1.1.1:
|
is-buffer@^1.1.5:
|
||||||
version "1.1.6"
|
version "1.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||||
|
@ -5035,15 +5024,6 @@ md5.js@^1.3.4:
|
||||||
hash-base "^3.0.0"
|
hash-base "^3.0.0"
|
||||||
inherits "^2.0.1"
|
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:
|
mdn-data@~1.1.0:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01"
|
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01"
|
||||||
|
@ -8158,7 +8138,7 @@ trim-right@^1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
glob "^6.0.4"
|
glob "^6.0.4"
|
||||||
|
|
||||||
tslib@^1.9.0:
|
tslib@^1.9.0, tslib@^1.9.3:
|
||||||
version "1.9.3"
|
version "1.9.3"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||||
|
|
Loading…
Reference in a new issue