Skip to content
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

Signup modal #4196

Closed
wants to merge 28 commits into from
Closed

Signup modal #4196

wants to merge 28 commits into from

Conversation

jonxuxu
Copy link
Member

@jonxuxu jonxuxu commented Dec 8, 2018

Fixes #4173

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/reviewers for help, in a comment below

This is work in progress of the signup modal.

@SidharthBansal
Copy link
Member

Nice to see your PR.

@oorjitchowdhary
Copy link
Member

So you mean to say that your sign up modal works only on /signup and otherwise shows up an error?

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Exactly.

@SidharthBansal
Copy link
Member

Oh, I know the fix.
@JonathanXu1 you made the same mistake in the login modal.
You need to fed url field in the form like I did in my last pr to help you out

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Oh, could you link the PR? I'd really appreciate learning how to fix this

@oorjitchowdhary
Copy link
Member

#4185

@plotsbot
Copy link
Collaborator

plotsbot commented Dec 8, 2018

7 Errors
🚫 There was a test error at: Failure: test_admin_user_should_be_able_to_see_spam_comments_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ app/controllers/admin_controller.rb:109:in ‘spam_comments’ test/functional/admin_controller_test.rb:587:in ‘block in '
🚫 There was a test error at: Failure: test_admin_user_should_be_able_to_see_spam_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ test/functional/admin_controller_test.rb:127:in ‘block in '
🚫 There was a test error at: Failure: test_admin_user_should_be_able_to_see_spam_revisions_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ app/controllers/admin_controller.rb:97:in ‘spam_revisions’ test/functional/admin_controller_test.rb:324:in ‘block in '
🚫 There was a test error at: Failure: test_moderator_user_should_be_able_to_see_spam_comments_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ app/controllers/admin_controller.rb:109:in ‘spam_comments’ test/functional/admin_controller_test.rb:578:in ‘block in '
🚫 There was a test error at: Failure: test_moderator_user_should_be_able_to_see_spam_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ test/functional/admin_controller_test.rb:118:in ‘block in '
🚫 There was a test error at: Failure: test_moderator_user_should_be_able_to_see_spam_revisions_page(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ app/controllers/admin_controller.rb:97:in ‘spam_revisions’ test/functional/admin_controller_test.rb:315:in ‘block in '
🚫 There was a test error at: Failure: test_should_get_/admin/queue_if_moderator(Minitest::Result) [/usr/local/bundle/gems/actionview-5.2.2/lib/action_view/helpers/form_helper.rb:440]: ActionView::Template::Error: First argument in form cannot contain nil or be empty app/views/users/form.html.erb:2:in ‘_app_views_users__form_html_erb_1385425289533742867_47286206568500’ app/views/layouts/_header.html.erb:203:in ‘_app_views_layouts__header_html_erb_997710036233095621_47286193554900’ app/views/layouts/application.html.erb:85:in ‘_app_views_layouts_application_html_erb__646193408332042782_47286179338520’ app/controllers/admin_controller.rb:350:in ‘queue’ test/functional/admin_controller_test.rb:391:in ‘block in '
1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
2 Messages
📖 @JonathanXu1 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Hmm, there's already a url attribute
<%= form_for @user, :url => {:controller => 'users', :action => @action}, :html => {:class => "row"} do |f| %>

@oorjitchowdhary
Copy link
Member

:url => :user_sessions try this out maybe.. This was in @SidharthBansal's PR

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Don't think you can put that exactly. The file is in a different directory. If I replace it to :url => users it doesn't work either. I'm not familiar with the rails framework; this will require more looking into.

image

@SidharthBansal
Copy link
Member

Please try
<%= form_for :user, :as => :user, :url => :users, :html => {:class => "form col-md-6 offset-3"} do |f| %>

OR
Similar

@oorjitchowdhary
Copy link
Member

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

#4196 (comment) helped resolve the first error.
image
Since @user has been replaced with :user, line 49 no longer works. If I replace all instances of @user with :user, values such as .crypted_password will not be accessible.

Would you like me to push this version of the code?

app/views/users/_form.html.erb Outdated Show resolved Hide resolved
@@ -1,6 +1,5 @@
<div style="padding:10px;">
<%= form_for @user, :url => {:controller => 'users', :action => @action}, :html => {:class => "row"} do |f| %>

<%= form_for :user, :as => :user, :url => :users, :html => {:class => "form col-md-6 offset-3"} do |f| %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try
<%= form_for @user, :url => {:controller => 'users', :action => 'new'}, :html => {:class => "row"} do |f| %>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With these changes, we'll get:
image

@SidharthBansal
Copy link
Member

Here's the demo of the signup modal which only works on this page. I'll make the modal wider and improve the ui.

What happens on other pages? I forget. Sorry.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Ok, I'll fix the ui. The signup modal works fine in the /signup page, but when I move out of it the errors that we are trying to solve happen.
#4173 (comment)

@SidharthBansal
Copy link
Member

You mean the /signup is working.
Are you able to signup at /signup page through the modal?

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

No, I get a Routing Error: No route matches [POST] "/signup"
However I fixed the design for the modal. How's this?
ezgif com-video-to-gif 2

@SidharthBansal
Copy link
Member

AWESOME
Can you please shift the content a little up?
I think the top margin is little extra.

@SidharthBansal
Copy link
Member

In mobile these changes will look not good.
It will be better if you can revert your changes.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 8, 2018

Which part of the modal is unsuitable for mobile view? I can change the styling based on window size.
image
image
I'm able to use it in mobile view on my end

@SidharthBansal
Copy link
Member

Awesome, I am sleepy, its 4:45am here. Sorry I forget about bootstrap and other html, css stuff.
I really loved #4196 (comment) and #4196 (comment).

Can you please push the changes for both of them here?

@SidharthBansal
Copy link
Member

I found the correct answer to the problem
image

You need register that is the path for creation of user. In rails, we see the named urls from the terminal by doing rake routes.

@SidharthBansal
Copy link
Member

Please rebase your changes with the current master.
You need to push the final changes before the PR gets merged. So, we also require to push the login modal pr changes. So, it will be great if you will rebase it if you have not done it yet.
Thanks for the awesome work

@SidharthBansal
Copy link
Member

SidharthBansal commented Dec 8, 2018

Ensure the following before PR is merged.

  • PR is APPROVED BY @jywarren
  • Compatible at small and large screens(UI)
  • Sign up form front end is good(UI)
  • Sign up modal front end is awesome(UI)
  • Sign Up form validations are working fine for incorrect input fields(testing)
  • Sign Up modal validations are working fine for incorrect input fields(testing)
  • Sign Up form signs a user in successfully(testing)
  • Sign Up modal signs in a user successfully(testing)
  • Sign Up works well on all the webpages(testing)
  • Sign Up is redirected to the same page after user signs up(return_to)(testing)
  • Check on the localhost(testing) for all above scenarios discussed.
  • Check on the unstable branch(testing) for all above scenarios discussed.
  • Check functionality of Oauth providers on the unstable branch.(testing)

As the list is long so it will be great if any GCI student will help @JonathanXu1 with the testing part once I approve the pr.
UI part is done by @JonathanXu1.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 9, 2018

Here are the errors for each:
<%= form_for @user, :url => :register , :html => {:class => "row"} do |f| %>
image

<%= form_for @user, :as => @user, :url => :register , :html => {:class => "row"} do |f| %>
image

So for both the user seems to be empty. Just like before haha. I've rebased and pushed the changes.

@SidharthBansal
Copy link
Member

@jywarren as @JonathanXu1 was having tough time in removing the above errors, I helped him.
The error was rectified by moving form partial into two form partials ->form and form2.
Form2 for the signup create action and the form for the edit action.
The routes for the modal need to be path. I tried a lot to find any other suitable way but could not find.

Moving to #4203. @JonathanXu1 you will get credit for the frontend you have made. Please claim the issue.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 9, 2018

Alright, thanks for your help throughout! I can't locate the task on gci, is it a beginner task as well?

@SidharthBansal
Copy link
Member

Moving to #4203.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants