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); } }); 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 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