onOffice-Web-Org / oo-wp-plugin

onOffice for WP-Websites
https://wp-plugin.onoffice.com
GNU General Public License v3.0
9 stars 9 forks source link

Error handling deleted or incorrectly selected templates #698

Open fredericalpers opened 10 months ago

fredericalpers commented 10 months ago

Initiative

Improve error handling for templates in the onOffice for WP-Websites Plugin for a better user experience.

Epic

Implement error messages for deleted, incorrectly selected or renamed templates.

User story

As a real estate agent utilizing the onOffice for WP-Websites plugin, I am faced with critical issues when a chosen template is deleted, incorrectly selected or renamed. Currently, this situation leads to a critical error on the frontend, causing potential disruptions to the user experience. To mitigate this, I require a robust error handling mechanism that notifies me when a template is deleted, when a incorrect template is chosen or a template is renamed. This way, I can promptly address any issues and ensure the seamless functioning of my real estate website.

Templates play a pivotal role in shaping the presentation of property listings on my website. However, the current lack of error handling creates a vulnerability where the deletion of a template, an incorrect selection or renaming can lead to critical erros on the frontend. To enhance the plugin's reliability, a comprehensive error handling system needs to be implemented.

Tasks

Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?

The active template for [Property list ListName] has been deleted. Please select a new template.

The template "TemplateName" is not compatible with property lists. Please select the default template "default.php" or a new template.

The template "TemplateName" is not compatible with property detail pages. Please select the default template "default_detail.php" or a new template.

The template "TemplateName" is not compatible with the form type "FormTypeName". Please select the standard template "TemplateName" or a new template of type "FormTypeName".

By implementing this error handling mechanism, the onOffice for WP-Websites plugin can enhance its resilience, providing real estate agents with a more reliable and stable platform for showcasing their property listings etc.

dai-eastgate commented 9 months ago

@fredericalpers

  1. For this notification "Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?"
    • Behavior: Delete any templates in the "templates.dist" or the "onoffice-personalized" folder. => Screen shows notification: Because we cannot catch the behavior of the user. When users delete template files, we can only check which template files have been deleted in the "templates.dist" folder or "onoffice-personalized" folder. => So in my opinion: When we access the following screens, the notification will display: "Add new" or "Duplicate" or "Reload/ Redirect" a "List View" or "Form"?
  1. For this notification "The active template for [Property list ListName] has been deleted. Please select a new template."

    • Behavior: Go to the screen "Edit List view" or "Edit Form" => See the "active template" for [Property list ListName] or [Form] But this "active template" has been deleted in the "templates.dist" folder or "onoffice-personalized" folder. => Screen shows notification: "Duplicate" or "Reload/ Redirect" or click the "Save changes" button in "edit list view" or "edit form" by a specific ID.
  2. For this notification: "The template "TemplateName" is not compatible with property lists. Please select the default template "default.php" or a new template."

    • Behavior: Go to the screen "Edit List view" => Choose another template different from the "default.php" template => Click the "Save changes" button => Screen shows notification: "Edit List view"
  3. For this notification: “The template "TemplateName" is not compatible with property detail pages. Please select the default template "default_detail.php" or a new template”

    • Behavior of users: Go to the screen "Edit Detail View" => Choose another template different from "default_detail.php" => Click the "Save changes" button => Screen shows notification: "Edit Detail View"
  4. For this notification: “The template "TemplateName" is not compatible with the form type "FormTypeName". Please select the standard template "TemplateName" or a new template of type "FormTypeName" ”

    • Behavior: Go to the screen edit of any Form => Choose another template different from the "default template of that form" => Click the "Save changes" button => Screen shows notification: Edit "Form"

Additionally, I noticed that you mentioned "renamed templates" in the requirements. As I understand it, it means the following:

Please confirm my above statements exactly. Note: Especially the "screen show notification" and "behavior". Thanks!

fredericalpers commented 9 months ago

@dai-eastgate as far as I can see the statements are correct. Please go ahead and try to implement this. Thank you :)

dai-eastgate commented 8 months ago

@fredericalpers

https://github.com/onOffice-Web-Org/oo-wp-plugin/assets/106214469/f630222a-e24e-492b-a08a-49d733a89d08

=> I need three more days to investigate the display of multiple notifications simultaneously, and I will respond to you about its feasibility.

fredericalpers commented 8 months ago

The tests in the video look promising already. Thank you :)

dai-eastgate commented 8 months ago

@fredericalpers During the implementation process, I have these points of view: A. We can not control:

B. I can only check which files are having changes (this change can be a "deleted File" or "rename File").

=> The solution I suggest is:

  1. "Change content" for notification "Deleting a template can lead to visual and critical errors on your website. Delete the template regardless?" => "Deleting or renaming a template can lead to visual and critical errors on your website. The template "TemplateName" has been deleted or renamed."

  2. "Change content" for notification "The active template for [Property list ListName] has been deleted. Please select a new template." => "The active template for [Property list ListName] has been deleted or renamed. Please select a new template."

Do you agree with my opinion or do you have another suggestion?

I have implemented this suggestion in branch 43297-error-handling-deleted-or-incorrectly-selected-templates for you to consider. Here is the video I tested: https://files.fm/u/k8n3j4nyn7

fredericalpers commented 8 months ago

@dai-eastgate this sounds good to me, thank you for your efforts :) can I label this as in review?

dai-eastgate commented 8 months ago

@dai-eastgate this sounds good to me, thank you for your efforts :) can I label this as in review?

@fredericalpers Can you wait a few minutes while we'll create a PR for this branch. Thanks!