Skip to main content

Validation Improvements

HAPI Elements was validating each of the order journey step with simple frontend validations such as like checking for emptiness, email, url, some simple regexes, min, max values of inputs.


After the payment-method step of the journey (which is the last step before the order-confirmation step), we did a regular order request to backend, then sent the user back to the order-review step to make corrections.


This has been improved so that each step is validated through HAPI Backend after user clicks on the Next button of the User Journey Buttons widget, and the validation error messages are visible under the form fields.


We have also improved the order-review step accordions so they clearly show which of the accordions has a validation error by making the title of the accordion in the danger color of the global Theming colors you passed and also showing an exclamation triangle icon next to the title of the accordion.


As part of these changes we have added stepActiveOrderErrors property to OrderJourney module's state submodule.