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

Change redirect URL of spam marking action #2761

Closed
first-timers bot opened this Issue Jun 3, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@first-timers

first-timers bot commented Jun 3, 2018

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

  • 📝 Update the file app/controllers/admin_controller.rb in the plots2 repository (press the little pen Icon) and edit the line as shown below.

See this page for some help in taking your first steps!

Below is a "diff" showing in red (and a -) which lines to remove, and in green (and a +) which lines to add:

@@ -108,7 +108,7 @@ def mark_spam
         @node.author.ban
         AdminMailer.notify_moderators_of_spam(@node, current_user).deliver_now
         flash[:notice] = "Item marked as spam and author banned. You can undo this on the <a href='/spam'>spam moderation page</a>."
-        redirect_to '/dashboard'
+        redirect_to '/dashboard' + '?_=' + Time.now.to_i.to_s
       else
         flash[:notice] = "Item already marked as spam and author banned. You can undo this on the <a href='/spam'>spam moderation page</a>."
         redirect_to '/dashboard'
@@ -135,7 +135,7 @@ def mark_comment_spam
     else
       flash[:error] = 'Only moderators can moderate comments.'
     end
-    redirect_to '/dashboard'
+    redirect_to '/dashboard' + '?_=' + Time.now.to_i.to_s
   end
 
   def publish_comment
  • 💾 Commit your changes

  • 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • 🏁 Done Ask in comments for a review :)

🤔 Questions?

Leave a comment below!

Is someone else already working on this?

We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. If someone seem stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

(This issue was created by First-Timers-Bot.)

@jywarren

This comment has been minimized.

Contributor

jywarren commented Jun 3, 2018

Once adding these, you'll probably encounter some test failures, since we check where the redirect goes. But you should be able to fix these by tweaking this line:

https://github.com/publiclab/plots2/blob/master/test/functional/admin_controller_test.rb#L166

And this line, and perhaps a few others:

assert_redirected_to '/dashboard'

I'm happy to help with these follow-up steps!

@chanjess

This comment has been minimized.

Contributor

chanjess commented Jun 4, 2018

thanks @jywarren
I'll take this one on!

@jywarren

This comment has been minimized.

Contributor

jywarren commented Jun 4, 2018

@sreemudunuri

This comment has been minimized.

sreemudunuri commented Jul 5, 2018

@chanjess are you still working on it? I would be happy to jump in. Let me know.

@CodeRhyno

This comment has been minimized.

Contributor

CodeRhyno commented Jul 6, 2018

is anyone working on this issue?? I would like to contribute.

@CodeRhyno CodeRhyno referenced this issue Jul 6, 2018

Closed

Feature fix admin controller #2761 #2995

4 of 5 tasks complete
@dewanhimanshu

This comment has been minimized.

Collaborator

dewanhimanshu commented Jul 6, 2018

can you please review #2998 PR regarding this issue

jywarren added a commit that referenced this issue Jul 6, 2018

added spam url and test changed #2761 (#2998)
* added spam url and test changed

* indentation made

* indentation in admin_controller

* some test were falling so corrected them

* indentation done
@jywarren

This comment has been minimized.

Contributor

jywarren commented Jul 25, 2018

Completed in #2998, thank you!!!! We'd love to have your help with other issues - maybe #2544 or something under "Candidates" on this page? https://publiclab.github.io/community-toolbox/#r=all

👍

@jywarren jywarren closed this Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment