forked from demarches-simplifiees/demarches-simplifiees.fr
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag '2024-04-16-01' into feature/impot-2024-04-18
# Conflicts: # db/schema.rb # public/404.html # public/404_procedure_not_found.html # public/422.html # public/500.html
- Loading branch information
Showing
35 changed files
with
9,096 additions
and
306 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions
57
app/assets/images/dsfr/artwork/pictograms/system/technical-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
class ErrorsController < ApplicationController | ||
def nav_bar_profile = try_nav_bar_profile_from_referrer | ||
|
||
rescue_from Exception do | ||
# catch any error, except errors triggered by middlewares outside controller (like warden middleware) | ||
render file: Rails.public_path.join('500.html'), layout: false, status: :internal_server_error | ||
end | ||
|
||
def internal_server_error | ||
# This dynamic template is rendered when a "normal" error occurs, (ie. a bug which is 99.99% of errors.) | ||
# However if this action fails (error in the view or in a middlewares) | ||
# the exceptions are rescued and a basic 100% static html file is rendererd instead. | ||
render_error 500 | ||
end | ||
|
||
def not_found = render_error 404 | ||
def unprocessable_entity = render_error 422 | ||
|
||
def show # generic page for others errors | ||
@status = params[:status].to_i | ||
@error_name = Rack::Utils::HTTP_STATUS_CODES[@status] | ||
|
||
render_error @status | ||
end | ||
|
||
private | ||
|
||
def render_error(status) | ||
respond_to do |format| | ||
format.html { render status: } | ||
format.json { render status:, json: { status:, name: Rack::Utils::HTTP_STATUS_CODES[status] } } | ||
end | ||
end | ||
|
||
# Intercept errors in before_action when fetching user or roles | ||
# when db is unreachable so we can still display a nice 500 static page | ||
def current_user | ||
super | ||
rescue | ||
nil | ||
end | ||
|
||
def current_user_roles | ||
super | ||
rescue | ||
nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.fr-col-12.fr-col-md-3.fr-col-offset-md-1.fr-px-6w.fr-px-md-0.fr-py-0 | ||
%svg.fr-responsive-img.fr-artwork{ xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", width: "160", height: "200", viewBox: "0 0 160 200" } | ||
%use.fr-artwork-motif{ href: image_path("dsfr/artwork/background/ovoid.svg#artwork-motif") } | ||
|
||
%use.fr-artwork-background{ href: image_path('dsfr/artwork/background/ovoid.svg#artwork-background') } | ||
%g{ transform: "translate(40, 60)" } | ||
%use.fr-artwork-decorative{ href: image_path('dsfr/artwork/pictograms/system/technical-error.svg#artwork-decorative') } | ||
%use.fr-artwork-minor{ href: image_path('dsfr/artwork/pictograms/system/technical-error.svg#artwork-minor') } | ||
%use.fr-artwork-major{ href: image_path('dsfr/artwork/pictograms/system/technical-error.svg#artwork-major') } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 Unexpected Error | ||
%p.fr-text--sm.fr-mb-3w Error 500 | ||
%p.fr-text--lead.fr-mb-3w | ||
Sorry, an error has occurred. Our teams have been notified | ||
to resolve the issue as quickly as possible. | ||
%p.fr-text--sm.fr-mb-5w | ||
Try refreshing the page or try again a little later. | ||
%br | ||
If you need immediate assistance, please contact us. | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Contact Us", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 Erreur inattendue | ||
%p.fr-text--sm.fr-mb-3w Erreur 500 | ||
%p.fr-text--lead.fr-mb-3w | ||
Désolé, une erreur est survenue. Nos équipes ont été averties | ||
pour résoudre le problème le plus rapidement possible. | ||
%p.fr-text--sm.fr-mb-5w | ||
Essayez de rafraîchir la page ou réessayez un peu plus tard. | ||
%br | ||
Si le problème persiste, merci de nous contacter. | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Contactez-nous", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 Page not found | ||
%p.fr-text--sm.fr-mb-3w Error 404 | ||
%p.fr-text--lead.fr-mb-3w The page you are looking for cannot be found. We apologize for the inconvenience. | ||
%p.fr-text--sm.fr-mb-5w | ||
If you typed the web address in the browser, check that it is correct. The page may no longer be available. | ||
%br | ||
In this case, to continue your visit you can check our homepage. | ||
%br | ||
Otherwise, contact us so we can direct you to the correct information. | ||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Homepage", root_path, class: "fr-btn") | ||
%li | ||
= link_to("Contact us", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 Page non trouvée | ||
%p.fr-text--sm.fr-mb-3w Erreur 404 | ||
%p.fr-text--lead.fr-mb-3w La page que vous cherchez est introuvable. Excusez-nous pour la gène occasionnée. | ||
%p.fr-text--sm.fr-mb-3w | ||
Si vous avez tapé l’adresse web dans le navigateur, vérifiez qu’elle est correcte. La page n’est peut-être plus disponible. | ||
%br | ||
Dans ce cas, pour continuer votre visite vous pouvez consulter notre page d’accueil. | ||
%br | ||
Sinon contactez-nous pour que l’on puisse vous rediriger vers la bonne information. | ||
%p.fr-text--sm.fr-mb-5w | ||
Pour le laissez-passer A-38, relatif à l’enregistrement d'une galère, veuillez vous adresser à la capitainerie au port. | ||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Page d’accueil", root_path, class: "fr-btn") | ||
%li | ||
= link_to("Contactez-nous", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1= @error_name | ||
%p.fr-text--sm.fr-mb-3w Error #{@status} | ||
%p.fr-text--lead.fr-mb-3w An error prevents this page from loading. | ||
|
||
- if @error_name.present? # valid error code | ||
%p.fr-text--sm.fr-mb-5w | ||
= link_to("What does that mean?", "https://developer.mozilla.org/en/docs/Web/HTTP/Status/#{@status}", **external_link_attributes) | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Homepage", root_path, class: "fr-btn") | ||
%li | ||
= link_to("Contact us", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1= @error_name | ||
%p.fr-text--sm.fr-mb-3w Erreur #{@status} | ||
%p.fr-text--lead.fr-mb-3w Une erreur empêche le chargement de cette page. | ||
|
||
- if @error_name.present? # valid error code | ||
%p.fr-text--sm.fr-mb-5w | ||
= link_to("Qu’est-ce que cela veut dire ?", "https://developer.mozilla.org/fr/docs/Web/HTTP/Status/#{@status}", **external_link_attributes) | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to("Page d’accueil", root_path, class: "fr-btn") | ||
%li | ||
= link_to("Contactez-nous", contact_path, class: "fr-btn fr-btn--secondary") | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 The requested action has been rejected | ||
%p.fr-text--sm.fr-mb-3w Error 422 | ||
%p.fr-text--lead.fr-mb-3w We're sorry, but we can't process your request. | ||
%p.fr-text--sm.fr-mb-5w | ||
This may be due to a request that cannot be processed in its current state. | ||
%br | ||
Go back to | ||
= link_to("the previous page", "javascript:window.location = document.referrer", class: "fr-link") | ||
and then try again. | ||
%br | ||
|
||
If the problem persists, please don't hesitate to contact us for assistance. | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to 'Back', 'javascript:window.location = document.referrer', class: 'fr-btn' | ||
%li | ||
= link_to 'Contact us', contact_path, class: 'fr-btn fr-btn--secondary' | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%main#content{ role: "main" } | ||
.fr-container | ||
.fr-my-7w.fr-mt-md-12w.fr-mb-md-10w.fr-grid-row.fr-grid-row--gutters.fr-grid-row--middle.fr-grid-row--center | ||
.fr-py-0.fr-col-12.fr-col-md-6 | ||
%h1 L’action demandée a été rejetée | ||
%p.fr-text--sm.fr-mb-3w Erreur 422 | ||
%p.fr-text--lead.fr-mb-3w Nous sommes désolés, mais nous ne pouvons pas traiter votre requête. | ||
%p.fr-text--sm.fr-mb-5w | ||
Cela peut être dû à une requête qui ne peut être traitée dans son état actuel. | ||
%br | ||
Revenez à | ||
= link_to("la page précédente", "javascript:window.location = document.referrer", class: "fr-link") | ||
puis réessayez. | ||
%br | ||
|
||
Si le problème persiste, n’hésitez pas à nous contacter pour obtenir de l’aide. | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline-md | ||
%li | ||
= link_to 'Retour', 'javascript:window.location = document.referrer', class: 'fr-btn' | ||
%li | ||
= link_to 'Contactez-nous', contact_path, class: 'fr-btn fr-btn--secondary' | ||
|
||
= render partial: "artwork" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class DropVirusScanTable < ActiveRecord::Migration[7.0] | ||
def up | ||
drop_table :virus_scans | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddStableIdIndexToChamps < ActiveRecord::Migration[7.0] | ||
disable_ddl_transaction! | ||
|
||
def change | ||
add_index :champs, :stable_id, algorithm: :concurrently | ||
end | ||
end |
Oops, something went wrong.