mozilla / delivery-console

Normandy recipe editor
Mozilla Public License 2.0
14 stars 22 forks source link

Validate filter expressions on the client side #309

Closed rehandalal closed 5 years ago

rehandalal commented 6 years ago

We should validate filter expressions using mozjexl as an added precaution before sending them to the server.

peterbe commented 6 years ago

"added precaution"? Doing a validation on the client, before XHR saving, is to potentially avoid bothering to send the XHR at all until the user fixes it. One worry I have is that the textarea is a controlled input which means that we would only be able to validate the final filter expression input onBlur. Also, if someone never on-blurs the textarea and hit the "Save" button right away, this validation will race against the onSubmit, right?