Prevent submit before validation complete#1113
Prevent submit before validation complete#1113labkey-bpatel wants to merge 2 commits intorelease25.11-SNAPSHOTfrom
Conversation
…dicator while validation is in progress.
|
@brentlogan, i'm not sure what's driving this, but I dont think this is necessarily the behavior you want. In a perfect world, there would be minimal lag time between validation and submission. The challenge is that is someone is interacting with a form, there are lots of events that trigger many, many queries to the server to validate. The reason we didnt introduce this kind of behavior originally is b/c the consequence of missing a validation should generally be negligible. If the user entered something and hit submit before the validation returned, then in theory the submit request should undergo the same checks and fail if there was a problem. There are definitely warnings and some fringe cases where this isnt quite true, but most of the time it should be. |
@bbimber Agreed that in most cases the submit-time checks are a sufficient backstop, the problem is specifically with warnings, which are advisory and won't block a submit, so a missed warning silently produces subtler data issues rather than a clean failure. ONPRC has some form helpers for bulk entry where validation lag has been long enough that records are getting submitted before users ever see the warnings. Speeding up validation is worth pursuing too, but the validation paths continue to evolve, so it's hard to rely on perf alone. The plan is to keep the re-validate button enabled and show a "validating…" info message, so the user knows what's happening and can restart validation if a response is lost. |
|
@labkey-martyp, sure, I can see that. I did see the 'validating...' indicator which seems like a generally good idea. my understanding of how this works is based purely off reading the code, so I might be partially wrong on what this does. However, if there are specific form helpers that trigger outsized problems (and the bulk entry ones probably are), could the code that does a bulk-add event simply add an explicit 'Loading..." popup that prevents user interaction until that first validation event completes? That would be in contrast to disabling a submit button in all cases, and better scope the change to the problematic situation. The title of this PR 'prevent submit until validation is complete' implies the impact is much more broad. |
|
@bbimber this is intentionally broad because I think it's a good improvement for the EHR. There's continual development here with new form features and additional validation. Adding a loading modal on a per-feature basis seems like it could get missed and I doubt ONPRC will be the only to run into this. I assumed this was not done originally in these forms just because validation or bulk entry was not as extensive as they have become. Is the specific concern just that the UI will get stuck with missing validation responses? |
Rationale
https://github.com/LabKey/internal-issues/issues/828
Related Pull Requests
Changes