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
Spam2: system for flagging nodes and comments to moderators and User moderation #8107
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8107 +/- ##
==========================================
- Coverage 82.10% 81.84% -0.26%
==========================================
Files 100 100
Lines 5751 5845 +94
==========================================
+ Hits 4722 4784 +62
- Misses 1029 1061 +32
|
This is a great idea!
|
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.
Since everything is centred, you could as well centre this section with control buttons:
https://i.imgur.com/YC7Xn5y.png
@ebarry Regular users can just flag a node. List of flag nodes and that red flag icon is only visible to moderators at /spam2/flags. Thanks!! |
@VladimirMikulic Sure, I will do that. Thanks!! |
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.
@keshav234156 can you please share screenshot of the change, thanks
@keshavsethi , the UI is pretty good, have you made this response as well or it's currently made for the Desktop version? |
@jywarren @cesswairimu @VladimirMikulic @ananyaarun @emilyashley @pydevsg @ebarry @Uzay-G |
|
@VladimirMikulic @pydevsg I have aligned bulk nav |
app/controllers/spam2_controller.rb
Outdated
if @node.flag == 0 | ||
flash[:notice] = 'Node already unflagged.' | ||
else | ||
@node.unflag_node |
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.
we might wonna check if the person who flagged it or if (moderator or admin) can only unflag it, this may complicate the feature..but let me know what you think
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.
I have added an if statement to check only moderators and admins can unflag item
Thanks
self | ||
end | ||
|
||
def unflag_comment |
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.
maybe for this we could reduce the flags...but if its a moderator/admin we set it to 0...what do you think?
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.
But for this, we have to show flag count to users as well. Right now unflag means only moderators can unflag (i.e reduce flag count to 0). Other users can just flag nodes i.e increase its flag count by 1
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.
gotcha, cool, sounds good...thanks for the clarification
Ah great work man , this UI is really clean and crisp. Keep up the good work @keshavsethi 🎉 |
Looking really nice! One suggestion is to use lots of Bootstrap tooltips: https://getbootstrap.com/docs/4.4/components/tooltips/ to add short explanatory texts over things like the flag icon, without needing a lot of space! What do you think? |
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 @keshavsethi I would also like to request that you add some tests -- to demonstrate how it is supposed to work, and to ensure it's protected against future changes. I know this is a lot, but it is really a critical part of a big feature like this so I appreciate it!
- unit tests for changes to the models
- functional tests for controller actions
- system tests for javascript actions (pressing buttons, complex integrated sequences like several actions chained together)
Does this make sense? Thank you so much!
@jywarren I have added a few in bulk moderation nav. |
@jywarren @cesswairimu @pydevsg @VladimirMikulic @ebarry, I have added the User moderation page here where the moderator can ban and unban users. I have also added filters for admin moderators and banned users. Can you Please review and merge this PR as I am stuck here. This PR is getting bigger and has so many changes. You can review it in gitpod as well(it might give an error in the dashboard but can just change URL to spam2 and test it). Thanks!! |
@jywarren @cesswairimu I have updated the UI a bit and completed user bulk moderation. Please review!! |
Reviewing this now! Thanks @keshavsethi for your patience. I hope we can work more modularly and that GitPod helps us review faster, so you get un-stuck! |
It's booting up in GitPod! 🕐 😄 |
Hmm. i'm still getting hit by |
@@ -22,5 +22,16 @@ class DashboardTest < ApplicationSystemTestCase | |||
take_screenshot | |||
|
|||
end | |||
|
|||
|
|||
test "User can flag a node from dashboard" do |
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.
Awesome. Thanks!
I'm content with how this looks so far! Thank you! The tests were super helpful and I loved being able to try it out on GitPod. Thanks and congratulations, @keshavsethi !!! |
Thank you so much @jywarren 🎉 🎉 ❤️ |
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
…moderation (publiclab#8107) * spam2 flag nodes * nav align * flag comment moderation * flag comment order * spam2 flag comments * spam2 flag and filters update * codeclimate issue * codeclimate issue2 * reduce filters * spam2 code climate * test issues spam2 * spam2 flag filters * spam2 flag tests * flag spam2 test issue * flag count and ui update * spam2 typo in tests * spam2 syatem test update * user moderation and search feature * indentation * user moderation * indentation * UI update of spam2 * spam2 ui update * bulk user moderation * bulk user moderation spam2 * refactoring spam2 * spam2 refactoring
I have added the feature of Flag Nodes in spam2 in which any user can mark node as a flag. It will not affect the status of the node.
Flag will just increase the flag count by 1. If flag is 0 then it means that the node is not flagged and it is ok. All the flagged nodes will be listed on the flags page of spam2. Right now I have done it for nodes and working for flag comments as well.(refer #8107 (comment))
If flag count is above 10 then flag icon also becomes red.
Here are a few screenshots
Here flag count in shown in the status column and red icon indicates that the flag count is more than 10. Spamming that node will also unflag it as it is moderated.
@jywarren @cesswairimu @VladimirMikulic @ananyaarun @emilyashley @pydevsg @ebarry @Uzay-G Please review
Thanks!!