From 833d7a3b59c4a3000a2db1a96e77df8ab48d00d7 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 14 May 2020 15:52:43 +0200 Subject: [PATCH 1/3] javascript: ignore most common upload errors also in standard uploads In #5149, we ignored most common upload errors, but only for auto-uploads. This PR ignores those errors also for standard uploads. --- app/javascript/shared/activestorage/ujs.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/javascript/shared/activestorage/ujs.js b/app/javascript/shared/activestorage/ujs.js index a3459bbb9..0f2822578 100644 --- a/app/javascript/shared/activestorage/ujs.js +++ b/app/javascript/shared/activestorage/ujs.js @@ -1,7 +1,8 @@ import ProgressBar from './progress-bar'; import { errorFromDirectUploadMessage, - FAILURE_CONNECTIVITY + ERROR_CODE_READ, + FAILURE_CLIENT } from './file-upload-error'; import { fire } from '@utils'; @@ -58,8 +59,10 @@ addUploadEventListener(ERROR_EVENT, (event) => { ProgressBar.error(id, errorMsg); + // Report unexpected client errors to Sentry. + // (But ignore usual client errors, or errors we can monitor better on the server side.) let error = errorFromDirectUploadMessage(errorMsg); - if (error.failureReason != FAILURE_CONNECTIVITY) { + if (error.failureReason == FAILURE_CLIENT && error.code != ERROR_CODE_READ) { fire(document, 'sentry:capture-exception', error); } }); From 77ab7d1462ed17b62a4e830a0323a0d4e090aa2f Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 14 May 2020 14:11:00 +0000 Subject: [PATCH 2/3] tasks: add a rollback task --- lib/tasks/deploy.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake index 371776366..a311c43a2 100644 --- a/lib/tasks/deploy.rake +++ b/lib/tasks/deploy.rake @@ -32,3 +32,13 @@ task :post_deploy do sh "mina post_deploy domain=#{domains.first} branch=#{branch}" end + +task :rollback do + domains = domains_for_stage(ENV.fetch('STAGE')) + branch = ENV.fetch('BRANCH') + + domains.each do |domain| + sh "mina rollback domain=#{domain} branch=#{branch}" + sh "mina service:restart_puma domain=#{domain} branch=#{branch}" + end +end From 9454017dd97aa74cf897381e1a2e48162f631e81 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Thu, 14 May 2020 18:11:13 +0200 Subject: [PATCH 3/3] afficher le nom du service en alt si possible --- app/views/shared/_procedure_description.html.haml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_procedure_description.html.haml b/app/views/shared/_procedure_description.html.haml index 03713ae51..7f8de4547 100644 --- a/app/views/shared/_procedure_description.html.haml +++ b/app/views/shared/_procedure_description.html.haml @@ -1,5 +1,8 @@ .procedure-logos - = image_tag procedure.logo_url, alt: "logo #{procedure.libelle}" + - procedure_logo_alt = '' + - if procedure.service.present? + - procedure_logo_alt = "#{procedure.service.nom} − #{procedure.service.organisme}" + = image_tag procedure.logo_url, alt: procedure_logo_alt - if procedure.euro_flag = image_tag("flag_of_europe.svg", id: 'euro_flag', class: (!procedure.euro_flag ? "hidden" : "")) %h1.procedure-title