NREL / NEB-Tool

A user friendly, graphical, open-source application (Web/Mac/Windows) of the multiple benefits framework for non-energy benefits, incorporating additional aspects to make the tool effective for use in the United States.
Other
1 stars 2 forks source link

Data validation router guard prevent going to home page #142

Open RLiNREL opened 3 months ago

RLiNREL commented 3 months ago

If invalid forms are detected, there should be a guard to warn user about unfinished forms, if they click on the home link. reference link: https://jnpiyush.medium.com/angular-deep-dive-into-candeactivate-route-guard-51b9e1b046da

ghost commented 2 months ago

Reviewing v0.0.1-alpha-66703bc, there appears to be guards preventing navigation away from pages with empty required fields. I tested this on the Company page (empty company name), and the Contacts page (empty first or last name).

Potential problems:

RLiNREL commented 2 months ago

The router guard for the facility page is to be implemented.

ghost commented 2 months ago

As of v0.0.1-alpha-3483233 the router guard on empty facility name is implemented.

The router guard produces a sub-optimal user experience, as the user can get into situations where they are unable to leave a page they navigated to, which can be frustrating.

Additionally, we are able to circumvent the facility name check by never visiting the facility details page in the first place, and this produces no ill effects:

To reproduce:

Expected behavior:

Observed behavior:

I think we need to revisit and discuss as a team how to handle missing company/facility names.