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

Make spamaway ids unique #5465

Merged
merged 1 commit into from
Apr 21, 2019
Merged

Conversation

CleverFool77
Copy link
Member

@CleverFool77 CleverFool77 commented Apr 12, 2019

Fixes #4966 (<=== Add issue number here)

Description

Earlier , the callers for create_form template were modal and /signup , the ids were only decided by the no of spamaway which was leading it to have non-unique ids.
The approach to deal with it was -
I've passed local variables as the argument.
The argument tells us about the caller who is calling the create_form template which are loginmodal form and another for /signup form.
The values passed from both of the callers is concatenated in spamaway ids. Thus making the ids unique as both the callers are passing different values.

The gif below shows that there is no more console error regarding spamaway ids.
Though I found there are some other errors for which I opened issue #5466

id

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • 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 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

Thanks!

@CleverFool77 CleverFool77 mentioned this pull request Apr 12, 2019
@plotsbot
Copy link
Collaborator

plotsbot commented Apr 12, 2019

2 Messages
📖 @CleverFool77 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.
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: Fixes #123.

Generated by 🚫 Danger

@jywarren
Copy link
Member

Hi! This looks great! Just because it's such a critical system, would you mind adding a screenshot of this working? Thank you!

@CleverFool77
Copy link
Member Author

CleverFool77 commented Apr 12, 2019

Hi @jywarren @gauravano I've updated the gif and information.
Thanks !!!

Copy link
Contributor

@alonpeer alonpeer left a comment

Choose a reason for hiding this comment

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

Thanks @CleverFool77 for taking this issue! The change looks good, I just gave a few comments for style, a minor bug and an extra change that I think can be added.

app/views/layouts/_signupLoginModal.html.erb Outdated Show resolved Hide resolved
app/views/users/_create_form.html.erb Outdated Show resolved Hide resolved
app/views/users/new.html.erb Outdated Show resolved Hide resolved
app/views/users/_spamaway.html.erb Outdated Show resolved Hide resolved
@CleverFool77
Copy link
Member Author

Hi @alonpeer Thank you so much for your review.
I missed out the radio buttons. And The change you provided is correct.
I tested it. This would assign a unique id to all radio buttons values. Thus making them unique.
Thanks !!!
I've updated the PR with newer hash Ruby style and the change regarding radio buttons.

Copy link
Contributor

@alonpeer alonpeer left a comment

Choose a reason for hiding this comment

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

Looks good! 💯
The failing test seems to be unrelated.

@CleverFool77
Copy link
Member Author

Hi @jywarren @gauravano
Please review.
Thanks !!

Copy link
Member

@grvsachdeva grvsachdeva left a comment

Choose a reason for hiding this comment

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

Great work!

@grvsachdeva grvsachdeva merged commit 39c739c into publiclab:master Apr 21, 2019
@grvsachdeva
Copy link
Member

Merged 🎉 💯 . Thanks @CleverFool77 @alonpeer!

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
digitaldina pushed a commit to digitaldina/plots2 that referenced this pull request May 12, 2019
@CleverFool77 CleverFool77 deleted the spamaway branch June 28, 2019 17:45
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.

Make spamaway ids unique
5 participants