-
Notifications
You must be signed in to change notification settings - Fork 227
Issue 210 validate publisher form #416
Issue 210 validate publisher form #416
Conversation
- The JSON server publishers get a "mailto:N/A" value so that "N/A" gets displayed on the publishers table
- Show alerts when/if the user doesn't select the publisher type, the kind of upload (all, new, existing) - Google Spreadsheet: show alerts when/if the user doesn't provide an owner's email or a workbook name
- It doesn't make sense to continue trying to get the owner's email from the logged in user's account, since email accounts are no longer supported. - Instead, we add a field to the form and validate it.
@ggalmazor Validation on Google Spreadsheet works great! But I have noticed some issues:
@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! @opendatakit-bot unlabel "needs testing" |
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:
There is really no way to test this without tampering with the form, although validating forms is always a good idea. These validations will be handy in case we change the form and we open the option of not selecting an option on those selects.
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.