-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Region search: Validate input. #23
Comments
@yochannah : My thoughts on this is to implement a regex for the 'region-input' to check the string format before dispatching a function to the server otherwise raise a validation alert. Thoughts? Also, I am not sure about the regex for the input field. Can you help me with this? |
@sehgalvibhor That sounds like a good approach! @rachellyne regarding @sehgalvibhor's question above, is a formula along the lines of (some alphanumeric chars):(numeric characters)( p.s. let me know if I wasn't clear enough there. |
That will catch any inappropriately formatted regions but will not catch regions that do not return results because, for example, they are out of range for the sequence - but maybe that's ok (These should become obvious from the results.) Also it won't catch anything with a wrong chromosome number? eg Drosophila only has chromosomes 1-4, so 8:xxxx..xxx would still go though as correct? |
Thanks @rachellyne! out of range / chromosome number checks probably need to be made on the server I think. @julie-sullivan does that sound right? Or do we have the data for valid ranges available via web service somehow? |
@sehgalvibhor While we're thinking about that second question, I think it's safe to proceed with the formula (some alphanumeric chars):(numeric characters)(.. or -)(numeric characters) - is that enough for you to go on? Here's an example of a regex being used in bluegenes: bluegenes/src/clj/bluegenes/ws/ids.clj Line 18 in 6d76ff2
|
@yochannah : Yes I'll try out on the formula you mentioned. Just to confirm these can be multi-line and tab-spaced right? Also, is it better if we disable the button dynamically like currently being done for empty search strings etc or wait for the user to press the button? |
Right now whatever we input into the box is submitted to the sever. When the input is invalid we don't get verbose or meaningful error messages back, so we should validate the regions clientside before submission.
Demonstrative example:
The 'ss' appended to the end of the input in that screenshot results in a 500 from the server, and no results for any of the regions.
The text was updated successfully, but these errors were encountered: