RFE: Form validation callbacks (with JS injection)


#1

Introduce a callback entry point, executed when forms are submitted, with the major use case of being for quick validation of form content.

The nature of service or VM deployments is that it might take a very long time (minutes to hours) for code to run, or for underlying infrastructure to kick back failures. Many of these failures can be attributed to fat-finger mistakes, or relatively easily tested conditions and validated in thunk time, and provide feedback to the users.

Failures in validation would be kicked back to the user via the UI, and the form immediately available for editing, as opposed to waiting minutes/hours for a real world failure, and than reentry of the form.

Example form validation use cases discoverable in thunk time:

  • security zone matching hosting segment, compute cluster
  • manually entered IP address is available in IPAM (and doesn’t respond to pings) (imperfect, but cheap tests, I grant)

A validation callback, as a high level construct, would be more powerful than a validation step of generic automate code, as it could specifically force back to the UI quickly, for edits and updates. A callback would return a structure providing per-element, and per-form errors, and the UI would present those inline. Though generic ruby code, the callback could not mutate the form data, if it returns OK, the otherwise configured automate code would run.


#2

@jeffwarnica thanks for your suggestions!!

@dclarizio FYI