From 535d032b73eb92b4b05e30f81e809c4d14376d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Mon, 8 Jul 2019 17:50:02 +0200 Subject: [PATCH 1/5] Send URL page view to Crisp to trigger contextual help MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #4052 Signed-off-by: Chaïb Martinez --- app/javascript/shared/track/crisp.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/javascript/shared/track/crisp.js b/app/javascript/shared/track/crisp.js index a016a1ab2..08aeda15b 100644 --- a/app/javascript/shared/track/crisp.js +++ b/app/javascript/shared/track/crisp.js @@ -29,4 +29,9 @@ if (enabled) { ] ] ]); + window.$crisp.push([ + 'set', + 'session:event', + [[['PAGE_VIEW', { URL: window.location.pathname }]]] + ]); } From 04e204c74091c92ee1066914bc8089feecaf1abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Thu, 11 Jul 2019 14:47:27 +0200 Subject: [PATCH 2/5] Minor text fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- app/views/layouts/_navbar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index 6d4fa787f..1bf5272eb 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -10,7 +10,7 @@ #navbar-body .row %div{ style: "vertical-align: middle;float:left;position:absolute;line-height: 60px;z-index:2;" } - 👉 Besoin d'aide? Contactez-nous par chat, email ou prenez rendez-vous avec nous. + 👉Besoin d'aide? Contactez-nous par chat, email ou prenez RDV -# BEST WTF EVER -# this begin rescue hides potentials bugs by displaying another navbar - begin From d968e7e6bdc8f4a8bad17783b627059096732ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Thu, 11 Jul 2019 16:05:41 +0200 Subject: [PATCH 3/5] Add some admin usage info for contextual help with crisp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #4052 Signed-off-by: Chaïb Martinez --- app/controllers/application_controller.rb | 6 +++++- app/javascript/shared/track/crisp.js | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index df168b7c1..fa3287d7c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -250,7 +250,11 @@ class ApplicationController < ActionController::Base email: current_administrateur&.email, DS_SIGN_IN_COUNT: current_administrateur&.sign_in_count, DS_CREATED_AT: current_administrateur&.created_at, - DS_ID: current_administrateur&.id + DS_ID: current_administrateur&.id, + DS_NB_DEMARCHES_BROUILLONS: current_administrateur.procedures.brouillons.count, + DS_NB_DEMARCHES_ACTIVES: current_administrateur.procedures.publiees.count, + DS_NB_DEMARCHES_ARCHIVES: current_administrateur.procedures.archivees.count + } } end diff --git a/app/javascript/shared/track/crisp.js b/app/javascript/shared/track/crisp.js index 08aeda15b..55819e034 100644 --- a/app/javascript/shared/track/crisp.js +++ b/app/javascript/shared/track/crisp.js @@ -21,6 +21,12 @@ if (enabled) { [ ['DS_ID', administrateur.email], ['DS_SIGN_IN_COUNT', administrateur.DS_SIGN_IN_COUNT], + [ + 'DS_NB_DEMARCHES_BROUILLONS', + administrateur.DS_NB_DEMARCHES_BROUILLONS + ], + ['DS_NB_DEMARCHES_ACTIVES', administrateur.DS_NB_DEMARCHES_ACTIVES], + ['DS_NB_DEMARCHES_ARCHIVES', administrateur.DS_NB_DEMARCHES_ARCHIVES], [ 'URL_MANAGER', 'https://www.demarches-simplifiees.fr/manager/administrateurs/' + From 3f9f67eb784c759e5ff4e7b3df191fd1ef75882b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Thu, 11 Jul 2019 16:57:17 +0200 Subject: [PATCH 4/5] admin: fix the "Valider" button being hidden by Crisp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #4021 Signed-off-by: Chaïb Martinez --- app/views/admin/procedures/new.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/procedures/new.html.haml b/app/views/admin/procedures/new.html.haml index ccfde2a2f..a61ff161f 100644 --- a/app/views/admin/procedures/new.html.haml +++ b/app/views/admin/procedures/new.html.haml @@ -5,5 +5,5 @@ #procedure_new.section.section-label = form_for @procedure, url: { controller: 'admin/procedures', action: :create }, multipart: true do |f| = render partial: 'informations', locals: { f: f } - .text-right - = f.button 'Valider', class: 'btn btn-info', id: 'save-procedure' + .text-center + = f.button 'Valider', class: 'btn btn-info btn-lg btn-block', id: 'save-procedure' From 5cb6ba2f3baf996f7886d9257ff54db7ba344813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Thu, 11 Jul 2019 17:12:11 +0200 Subject: [PATCH 5/5] Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- app/controllers/application_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fa3287d7c..9b58e571d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -251,9 +251,9 @@ class ApplicationController < ActionController::Base DS_SIGN_IN_COUNT: current_administrateur&.sign_in_count, DS_CREATED_AT: current_administrateur&.created_at, DS_ID: current_administrateur&.id, - DS_NB_DEMARCHES_BROUILLONS: current_administrateur.procedures.brouillons.count, - DS_NB_DEMARCHES_ACTIVES: current_administrateur.procedures.publiees.count, - DS_NB_DEMARCHES_ARCHIVES: current_administrateur.procedures.archivees.count + DS_NB_DEMARCHES_BROUILLONS: current_administrateur&.procedures&.brouillons&.count, + DS_NB_DEMARCHES_ACTIVES: current_administrateur&.procedures&.publiees&.count, + DS_NB_DEMARCHES_ARCHIVES: current_administrateur&.procedures&.archivees&.count } }