Skip to content

Reform and improve error handling on trial creation

What does this MR do and why?

  • Moves the namespace errors from the top part of the form to be around the input with help text as per reasons in #411514 (closed)
    • 📓 this is not a frontend validation and will still be only appearing from backend result after clicking submit
  • Moves the top of the form alerting for trial and lead failure to ViewComponent setup as there is no need for JS and setup for it.
  • Adopts a declarative model for figuring out the error display logic that is needed. We figure it out once in the controller layer on failure and then render the correct view with conditions based upon that.

📓 feature specs in ee/spec/features/trials/saas cover the full flow of these items

Screenshots or screen recordings

Before After
Screenshot_2023-06-09_at_10.38.31_AM Screenshot_2023-06-09_at_10.37.23_AM

How to set up and validate locally

  1. Setup to simulate SaaS and restart GDK
  2. Visit /-/trials/new
  3. Fill out anything
  4. Submit form and notice the error display(no change)
  5. Visit /-/trials/new?step=trial
  6. Select or create a namespace and submit form.
  7. Notice the global form error(no change)
  8. Visit /-/trials/new?step=trial
  9. Select create group and input @blah
  10. Submit and notice the new error display around the input.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #411514 (closed)

Edited by Doug Stull

Merge request reports