-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Corrected Signup form validation #5116
Conversation
@gauravano , Form doesn't accept null values anymore during signup. Also i have made only username , email. password and repeat password compulsory. Since image and Bio is up to user if they want to add or not. |
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sign-up button is not coming back so the user has to refresh their browser tab and fill the form again. the ideal behavior would be to validate all fields on pressing Sign-up button and if fields are incorrect/empty then focus on those fields or messages?
@gauravano , The thing as of now I have used the same method of form validation in Both login and signup. But signup uses a rotating wheel fontawesome icon. ie upon one click the icon appears and signup option disappears as you said. Upon removing this (like how it isnt there for login) this is how it looks. So now even if there is an error while filling there is a prompt to refill but the signup icon doesnt appear. |
Can't we show that progress icon only when JavaScript validation is passed and in other cases we can just focus on the fields with error messages along with each field? |
@gauravano , Hmm I just looked into this. So the method of using |
@gauravano , So far i can get 2 solutions to this issue.
Any thoughts on what can be done ? |
How about this - "User fills the form partially and goes on to submit the form by pressing sign-up and we can show a warning on hovering over the sign-up button only or maybe disable it too?" |
So basically there are 4 compulsory fields a user needs to fill. The user may not fill this in any permutation or combination. |
But, user need to refresh the screen with your approach right? |
No not any more, I made a slight change. I'll attach a gif in 10 minutes. |
<label for="username"><%= t('user_sessions.new.username') %></label> | ||
<%= f.text_field :username, { tabindex: 1, placeholder: "Username", class: 'form-control', id: 'username-signup' } %> | ||
<%= f.text_field :username, { tabindex: 1, placeholder: "Username", class: 'form-control', id: 'username-signup', required:true } %> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this empty space
<label for="email"><%= t('users._form.email') %></label> | ||
<%= f.text_field :email, { tabindex: 3, placeholder: "you@email.com", class: 'form-control', id: 'email' } %> | ||
<%= f.text_field :email, { tabindex: 3, placeholder: "you@email.com", class: 'form-control', id: 'email', required: true } %> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.html("<i class='fa fa-spinner fa-spin'></i>"); // make a spinner that spins when clicked | ||
}) | ||
})(); | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing this, we can disable the button only when all the required fields are filled i.e., spinner will show only when all required fields are filled otherwise focus on the fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be ideal. Do you have any idea how this can be done ?. Because the problem is since button is a JS element and form validation happens in ruby, i wasn't able to find a way to check if all fields are filled before displaying the button. The fields i try to access show "Cant be accessed error on console". I'll keep trying other ways to do this in the meantime maybe i was wrong, Thanks @gauravano :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form/input fields we create in rails also result in the generation of HTML form only and so can be assessed just like that, open the sign-up form of publiclab.org and try $('#username-signup').val()
in your console and you'll get the value of username field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll try this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give a try to make changes in the script so we don't need to remove the spinner
@gauravano , I got an idea how to implement this keeping the spinner button, Sorry have been a little busy with assignments, exams and writing my proposal lately. Will work on this as soon as i am done with these. |
No issue! And, thanks for working on it. |
There are some conflicts in your pr. It will be great if you can rebase your pr. |
Hi @ananyaarun, please update this PR too whenever you get time. Thanks! |
Sure, I have resolved the conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, changes looks good to me. Thanks for your work.
@jywarren @gauravano can you please review this and merge this?
OK, just because this being signup, it's a very critical system, would you mind sharing a gif of the current latest functionality just to confirm, @ananyaarun ? Thank you!!!! |
@jywarren here |
Ok, would you mind testing this on unstable to be sure the recaptcha
version of anti spam system works? I believe there's a PR open with new
documentation on unstable server usage?
Thanks!!!
…On Thu, Jun 6, 2019, 5:02 AM Ananya Arun ***@***.***> wrote:
@jywarren <https://github.com/jywarren> here
Basically won't allow a user signup without entering username and password.
Also other fields are optional (ie not 'required') as of now, but not
entering those gives a spam detection msg as expected.
[image: signup1 1]
<https://user-images.githubusercontent.com/32260628/59031298-e9ba4180-8880-11e9-8a46-e4b0683c12aa.gif>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5116?email_source=notifications&email_token=AAAF6JZDUFOMRYVOTC45TADPZD4CNA5CNFSM4G7AI4LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXCTYYI#issuecomment-499465313>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAF6JZ5DFSQB5DC4ONUPCTPZD4CNANCNFSM4G7AI4LA>
.
|
Can I test this on unstable myself ? Are there permissions required ? |
@gauravano @jywarren I dont have permission to push to unstable to test. |
@gauravano I think this one might be stale, what do you think? The issue with it is it should be reopened perhaps as a general frontend validation feature in addition to the work that needs to be done on #3340. If we can salvage a part of it and merge then lets do that, otherwise lets close it. |
I agree!
For authentication issues please add my name also.
Please feel free to close this issue and open a new issue as suggested
above.
…On Fri, Sep 13, 2019, 8:45 AM Sasha Boginsky ***@***.***> wrote:
@gauravano <https://github.com/gauravano> I think this one might be
stale, what do you think? The issue with it is it should be reopened
perhaps as a general frontend validation feature in addition to the work
that needs to be done on #3340
<#3340>.
If we can salvage a part of it and merge then lets do that, otherwise lets
close it.
@ananyaarun <https://github.com/ananyaarun> what are your thoughts
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5116?email_source=notifications&email_token=AFAAEQ6WJ6ADJNXP2XICOLLQJMAUDA5CNFSM4G7AI4LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6T23IY#issuecomment-531082659>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFAAEQ54KVSG3SIMVI6XFNTQJMAUDANCNFSM4G7AI4LA>
.
|
Sure at @sashadev-sky ! Will u be opening another issue for this ? |
Hey @ananyaarun , seems the issue you were fixed in this PR was closed..Closing this. Thanks |
Fixes #3340
rake test
@publiclab/reviewers
for help, in a comment belowThanks!