Closed ggalmazor closed 5 years ago
@ggalmazor Validation on Google Spreadsheet works great! But I have noticed some issues:
when I input email address I did not receive the email with access to sheet and in the published data tab emails are cut off, screenshot attached:
Publish to JSON server is still allowed without input to any field on the dialog window. I think that URL field should be required one.
@opendatakit-bot unlabel "needs testing"
Thanks, @kkrawczyk123!
I've added a couple of commits:
I've left out url validation form the json publisher changes because it's more controversial than I thought it was going to be. There is no consensus on how a url should be validated in javascript (can't use Java for this one), and we will have to implement a custom regexp that meets all our needs: require http or https, support localhost, port numbers and simple paths.
In any case, if a user enters an invalid url, the publisher will fail and they will get feedback to make amends, therefore, I think it's safe to release this and improve it in a next release.
Tested with success! Confirmed that issues have been fixed.
@opendatakit-bot unlabel "needs testing" @opendatakit-bot label "behavior verified"
ERROR: Label "needs testing" does not exist and was thus not removed from this pull request.
Closes #208, #209, #210
What has been done to verify that this works as intended?
Manually tried all field combinations in both publishers in the dev server.
Why is this the best possible solution? Were any other approaches considered?
No other approaches were considered. It's the narrowest change I could come up with that provides basic form validation.
An alternative would be to disable the button if the form is not valid. I don't have a strong opinion about this approach.
Are there any risks to merging this code? If so, what are they?
Common publisher form changes:
Changes to the Google Spreasheet publisher form:
Changes to the JSON publisher form:
Do we need any specific form for testing your changes? If so, please attach one
Nope.
Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.
No.