Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification of unsaved changes #697

Closed
3 tasks done
fredericalpers opened this issue Dec 7, 2023 · 6 comments · Fixed by #713
Closed
3 tasks done

Notification of unsaved changes #697

fredericalpers opened this issue Dec 7, 2023 · 6 comments · Fixed by #713
Assignees
Labels
feature New feature QA Issue or Pull request that is in review UI/UX Issue, Pull Request or Discussion related to UI/UX
Milestone

Comments

@fredericalpers
Copy link
Member

fredericalpers commented Dec 7, 2023

Initiative

Optimize the backend of the onOffice for WP-Websites Plugin for a better user experience

Epic

Notification of unsaved changes.

User story

As a real estate agent utilizing the onOffice for WP-Websites plugin, I often make configurations and adjustments in the settings to optimize my website. Currently, there is no notification system in place to alert me when I attempt to leave a settings page without saving changes. To prevent loss of modifications, I propose the implementation of a notification system that provides a clear alert when unsaved changes have been detected.

The absence of notifications for unsaved changes poses a risk of unintentional settings/data loss and can result in time-consuming reconfigurations. To address this concern, a notification system should be integrated into the onOffice for WP-Websites Plugin, ensuring that users are reminded to save their changes before navigating away from the page.

Tasks

  • Develop a notification component that can be triggered when unsaved changes are detected
  • Integrate the notification system with all relevant settings pages within the onOffice for WP-Websites Plugin
  • Included options within the notification to allow users to either save their changes or discard them

By implementing this notification system, the onOffice for WP-Websites Plugin can enhance the user experience by minimizing the risk of unintended data loss and promoting a more user-centric approach to configuration changes.

Related links:
https://cloudscape.design/patterns/general/unsaved-changes/
https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

changes-not-saved-yet (4)

@fredericalpers fredericalpers added this to the v4.20 milestone Dec 7, 2023
@dai-eastgate
Copy link
Contributor

@fredericalpers I have found a solution and I need 3 days to implement and test it. Thanks!

@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jan 4, 2024

@fredericalpers I implemented the "Notification of unsaved changes" with the following screens: Addresses, List View, Detail View, Similar Estate, Unit List, Contact form, Interest form, Applicant Search Form, Owner form, and Settings. Please take a look at my video and let me know your opinions. Thanks!

https://files.fm/u/jgeruf6j6g#/view/wxuxy38eh8

Note: During testing, I found that the "beforeunload" event will not support the user behavior of "entering URL".

https://files.fm/u/jgeruf6j6g#/view/k85e593vhj
Is this too big a problem for you? Can we ignore it or not?
If you need me to fix it, I will investigate it and give you feedback on the research results.

@fredericalpers
Copy link
Member Author

@dai-eastgate please investigate further thank you :)

@dai-eastgate dai-eastgate self-assigned this Jan 8, 2024
@fredericalpers fredericalpers linked a pull request Jan 19, 2024 that will close this issue
@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jan 24, 2024

@fredericalpers
After investigating, I have the following observations:

  1. The document (https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) mentions an issue:
    "The main use case for this event is to trigger a browser-generated confirmation dialog that asks users to confirm if they really want to leave the page when they try to close or reload it, or navigate somewhere else. This is intended to help prevent loss of unsaved data."

=> When we use "beforeunload_event" and calling the event object's preventDefault() method, we can trigger a browser-generated confirmation dialog (meant: Showing the browser-native confirmation modal) to handle the "cancel" button to show the "Notification of unsaved changes"

  1. According to the document ("https://cloudscape.design/patterns/general/unsaved-changes/)
    With the following 5 user behaviors:
    image
  • I tested and found the "Show the browser-native confirmation modal" feature is working normally in all browsers.
    image

  • However, In the Safari browser, the "Show the browser-native confirmation modal" feature does not support the user behavior "Modifying the URL in the browser address bar".
    => This is the cause of the bug when a user"Modifying the URL in the browser address bar" in Safari does not show "Notification of unsaved changes".
    => Therefore we cannot fix this bug.

Above are the results of my investigation. You can check it out and let me know your opinions. Thanks!

@fredericalpers
Copy link
Member Author

@dai-eastgate please go ahead and implement all possible notifications. :)

@dai-eastgate
Copy link
Contributor

@dai-eastgate please go ahead and implement all possible notifications. :)

We created a PR for this issue. Please help us to review it. Thanks!

@fredericalpers fredericalpers added the QA Issue or Pull request that is in review label Jan 29, 2024
@fredericalpers fredericalpers added feature New feature UI/UX Issue, Pull Request or Discussion related to UI/UX labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature QA Issue or Pull request that is in review UI/UX Issue, Pull Request or Discussion related to UI/UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants