Adds URL validation to Config Plan creation form #588
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, there is no URL validation on the creation form since it just gets sent to the Job. The options for URL validation are now either 1) validate and fail the job or 2) validate via JS. I spoke with Jeff and he said he'd rather it fail earlier, so this adds a validation to the JS.
Other changes:
data-target
) as the JS will now call itbutton
class tosubmit
so you can hit the Enter key to submit the form as well as click the buttonCo-authored by: ChatGPT
Why this is needed:
If you enter an invalid URL into the form submission it will run the job and create N number of config plans, all with that invalid URL. As soon as you try and edit (individually or bulk edit) any other field on those objects it will fail validation. In the case of the individual edit the form validation catches it and shows you that it is an invalid URL. In the case of bulk edit, it just reloads the page with no visible error on why.