cds-snc / report-a-cybercrime

Report a computer crime or scam / Signaler un crime informatique ou une fraude
https://report-a-scam.cds-snc.ca
MIT License
29 stars 14 forks source link

Warning Before Go Back #2387

Closed justinr86 closed 4 years ago

justinr86 commented 4 years ago

Fixes #2345

Description

Add warning when user navigates away after entering information. There are two scenarios that will display a warning.

Go Back

If the user enters information in a form and goes back to the previous page a modal will display a warning message. The user will have the option to proceed to the previous page (OK), or remain on the page (Cancel). modal_en

Leaving the App

If the user started a report but navigates away from the app by entering a URL in the address bar a warning message will be displayed. This will be the browser default message that uses it's language setting, not the currently selected language. browserMessage

Any new packages installed?

N/A

Required followup work

N/A

Checklist:

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging ac17c41a4b008d4d6f76b5116532fb44c16bd290 into dd55c764a9d17e578fa46ae6678d61fc4923f267 - view on LGTM.com

new alerts:

justinr86 commented 4 years ago

tested all the page. when going back, the error message don't show up in anaonymous page and evidence page

Warning now appears on this page.