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

Spam2: Moderator's Queue feature #8196

Merged
merged 12 commits into from
Aug 5, 2020

Conversation

keshavsethi
Copy link
Member

@keshavsethi keshavsethi commented Jul 28, 2020

Here, moderators and admin can moderate only those Nodes which has a tag that moderator/admin is following. As in the following screenshot, we can see that "one" tag is being followed by admin. so admin can moderate only those nodes which has "one as "tag". I have mentioned more details in my proposal.
Screenshot from 2020-08-05 05-38-54
Please try this out on gitpod
@jywarren @cesswairimu @pydevsg @VladimirMikulic @Uzay-G @ananyaarun @ebarry @emilyashley Please review!!
Thanks!

@gitpod-io
Copy link

gitpod-io bot commented Jul 28, 2020

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #8196 into main will decrease coverage by 0.50%.
The diff coverage is 63.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8196      +/-   ##
==========================================
- Coverage   81.81%   81.30%   -0.51%     
==========================================
  Files         100      101       +1     
  Lines        5846     5869      +23     
==========================================
- Hits         4783     4772      -11     
- Misses       1063     1097      +34     
Impacted Files Coverage Δ
app/controllers/spam2_controller.rb 61.53% <7.14%> (-14.06%) ⬇️
app/models/comment.rb 77.51% <50.00%> (ø)
app/controllers/batch_controller.rb 67.96% <67.96%> (ø)
app/models/user.rb 87.68% <85.71%> (ø)
app/controllers/tag_controller.rb 81.40% <100.00%> (+0.05%) ⬆️
app/models/node_tag.rb 100.00% <100.00%> (ø)
app/models/tag.rb 97.47% <100.00%> (-0.03%) ⬇️
app/services/execute_search.rb 88.88% <0.00%> (-5.56%) ⬇️
app/api/srch/search.rb 66.24% <0.00%> (-3.83%) ⬇️
... and 1 more

Copy link
Contributor

@VladimirMikulic VladimirMikulic left a comment

Choose a reason for hiding this comment

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

Nice work @keshavsethi. I have only one suggestion above :)

@ebarry
Copy link
Member

ebarry commented Jul 28, 2020

This is pretty amazing @keshavsethi , thank you for creating this! Very excited to see this functionality come to life. Is there a view where an admin like myself can see which tags moderators are subscribed to? The use case i'm imagining is "Oh, air-quality only has one moderator, while water-quality has 15 -- does anyone want to help moderate over in air-quality?"

@@ -334,7 +334,7 @@ def followers_who_dont_follow_tags(tags)

# https://github.com/publiclab/plots2/pull/4266
def self.trending(limit = 5, start_date = DateTime.now - 1.month, end_date = DateTime.now)
Tag.select('term_data.name, plots.term_data.count') # ONLY_FULL_GROUP_BY, issue #8152 & #3120
Copy link
Member

Choose a reason for hiding this comment

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

good catch! Thanks!

@@ -277,6 +277,20 @@ def unmoderated_in_period(start_time, end_time)
.distinct
end

def moderator_queue
Copy link
Member

Choose a reason for hiding this comment

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

Does this make more sense in a controller, maybe? Or, could you explain your reasoning in a comment in the code? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

@jywarren, I have added this in the controller. Thanks!!

@jywarren
Copy link
Member

Would this affect everyone? Perhaps we should think about how this might be the case for moderators but not admins? @ebarry what do you think about this as a policy?

Also, if we merge this, we should add an explanatory text just after Queue perhaps, something like Spam for <a href="/subscriptions">topics you follow</a> -- you know? So people don't get confused about the scope.

Thanks, @keshavsethi this is very exciting!

@jywarren
Copy link
Member

Is there a view where an admin like myself can see which tags moderators are subscribed to?

This is a good idea; for now we have the opposite - you can see who is subscribed to a given topic, but not which topics a given person is subscribed to.

I want to suggest we show some kind of "moderator" icon (dunno what! but with an explanatory tooltip, maybe it could be a "certificate" icon? https://fontawesome.com/v4.7.0/icon/certificate) next to users in the subscribers listing, such as on https://publiclab.org/contributors/water-quality

image

This would maybe be easier to fulfill @ebarry's use case:

The use case i'm imagining is "Oh, air-quality only has one moderator, while water-quality has 15 -- does anyone want to help moderate over in air-quality?"

because the page already exists. Could we open an issue for this to discuss and finalize, @keshavsethi ? It could even be a first-timers-only issue as the badge would be pretty easy to implement!

@keshavsethi
Copy link
Member Author

keshavsethi commented Aug 4, 2020

Is there a view where an admin like myself can see which tags moderators are subscribed to?

This is a good idea; for now we have the opposite - you can see who is subscribed to a given topic, but not which topics a given person is subscribed to.

I want to suggest we show some kind of "moderator" icon (dunno what! but with an explanatory tooltip, maybe it could be a "certificate" icon? https://fontawesome.com/v4.7.0/icon/certificate) next to users in the subscribers listing, such as on https://publiclab.org/contributors/water-quality

image

This would maybe be easier to fulfill @ebarry's use case:

The use case i'm imagining is "Oh, air-quality only has one moderator, while water-quality has 15 -- does anyone want to help moderate over in air-quality?"

because the page already exists. Could we open an issue for this to discuss and finalize, @keshavsethi ? It could even be a first-timers-only issue as the badge would be pretty easy to implement!

@jywarren @ebarry, I have added count of moderators and admins who are following that tag as shown in the screenshot. Here "one" is being followed by 1 moderator. I will add a section where a moderator can follow or unfollow a tag with a count of moderators already following them.
Screenshot from 2020-08-04 09-29-53
Thanks!!

@keshavsethi
Copy link
Member Author

Here I have created a separate controller(batch controller) for Bulk moderation as code climate is giving error for controller more than 250 lines. Please review it from gitpod as well.
Thanks!!

@keshavsethi
Copy link
Member Author

@pydevsg @ananyaarun @ebarry @jywarren @cesswairimu @VladimirMikulic @Uzay-G Please review!!
Thanks!!

Copy link
Contributor

@VladimirMikulic VladimirMikulic left a comment

Choose a reason for hiding this comment

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

Very nice @keshavsethi

Copy link
Member

@pydevsg pydevsg 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 @keshavsethi 🎉

@jywarren
Copy link
Member

jywarren commented Aug 4, 2020

Hi @keshavsethi were you able to add explanatory text about the narrower tag-filtered display after the word Queue?

Also,

I have added count of moderators and admins who are following that tag as shown in the screenshot. Here "one" is being followed by 1 moderator.

This is great. Is there a tooltip perhaps that could explain what the number means, as it could seem mysterious to some folks? Thank you! Love the controller split too, great work.

I want to suggest we show some kind of "moderator" icon

Let's create a new issue for this idea of a moderator icon and split out that task. Sound good, @keshavsethi ?

Finally, one more question - i'm thinking of how people could circumvent this filtering and just moderate everything. I can think of 3 ways:

  1. moderators are filtered by tag, but not admins, who see everything
  2. we have a separate route like /spam2/all (or something?) and have explanatory text that says Here are moderation tools for topics you follow. Click here to see content for all topics. which links there, so you can still access a full listing
  3. we explain how you can subscribe to everything (see below) so that if people /want/ to, they can simply moderate all content. This would require us to respect the "everything" subscription when filtering for this page, in the controller (make sense?)

See the "all research" subscription below, which some admins use:

image

@keshavsethi
Copy link
Member Author

@jywarren Thanks for the review, I have made some changes here. now moderator can filter out nodes as per tag. Suppose the moderator wants to filter out nodes only based on tag "XYZ" then all the spammed, unmoderated, and flagged nodes will get rendered. This Will remove the problem of everything tag as admin/moderator can just filter nodes based on the tag.
Screenshot from 2020-08-05 04-22-40
Screenshot from 2020-08-05 04-21-59

@jywarren @ebarry Please review
Thanks!!

@jywarren
Copy link
Member

jywarren commented Aug 4, 2020

Oh this is great! Can we name them "all tags" and "selected tags" for clarity? And what is the default when you first open it?

@keshavsethi
Copy link
Member Author

@jywarren

Is there a tooltip perhaps that could explain what the number means, as it could seem mysterious to some folks?

Yes, I have added few tooltips with tags and everything filter which will help moderators.

Let's create a new issue for this idea of a moderator icon and split out that task

I am bit confused here, should I add moderator icon in the tag. If so, then how a user will be able to tag node with icon??
The basic idea of the Queue is that the moderator can divide some work like some moderator can moderate only nodes that are related to "random tech". In that case, moderator can just filter that tag and moderate those nodes.

moderators are filtered by tag, but not admins, who see everything

This will be solved by tag filter

Thanks!!

@keshavsethi
Copy link
Member Author

keshavsethi commented Aug 4, 2020

Oh this is great! Can we name them "all tags" and "selected tags" for clarity? And what is the default when you first open it?

@jywarren Done, I have changed "everything" to "all tags". By default, it will show all nodes with tags which moderator is following.
Thanks!!

@keshavsethi
Copy link
Member Author

@jywarren @cesswairimu can we merge this if it is fine?
Thanks!!

@cesswairimu
Copy link
Collaborator

Yeah this good to merge.. Tremendous work @keshavsethi 🚀
Thanks @VladimirMikulic @pydevsg and @jywarren for the reviews 🎉

@cesswairimu cesswairimu merged commit 230468f into publiclab:main Aug 5, 2020
dms-yondy pushed a commit to dms-yondy/plots2 that referenced this pull request Aug 7, 2020
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
jywarren added a commit that referenced this pull request Aug 12, 2020
* paginate tag page listings (#8243)

* Update _graph.html.erb

* Update show.html.erb

* topic card count fixes for #7965 (#8249)

* fixes for #7965

* count fixes

* Update _topicCard.html.erb

* Delete _related_tags.html.erb (#8247)

* Fixes to tag counting logic (#8245)

* Update tag_test.rb

* Update tag_test.rb

* Update tag_test.rb

* Update tag.rb

* Spam2: Moderator's Queue  feature (#8196)

* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue

* Don't let newcomers edit wiki pages (controller-level) (#8250)

* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Bump rubocop from 0.88.0 to 0.89.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.88.0 to 0.89.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v0.88.0...v0.89.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump codecov from 0.2.3 to 0.2.5

Bumps [codecov](https://github.com/codecov/codecov-ruby) from 0.2.3 to 0.2.5.
- [Release notes](https://github.com/codecov/codecov-ruby/releases)
- [Changelog](https://github.com/codecov/codecov-ruby/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-ruby@v0.2.3...v0.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump rdiscount from 2.2.0.1 to 2.2.0.2

Bumps [rdiscount](https://github.com/davidfstr/rdiscount) from 2.2.0.1 to 2.2.0.2.
- [Release notes](https://github.com/davidfstr/rdiscount/releases)
- [Changelog](https://github.com/davidfstr/rdiscount/blob/master/CHANGELOG.md)
- [Commits](davidfstr/rdiscount@2.2.0.1...2.2.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Adding tags to Modals of Nodes (#8238)

* adding tags in modals of Nodes #8230

* refactored #8230

* fixed tag path in the modal #8230
also fixed extra spacing when no tags on the modal

* update _flags.html.erb (#8237)

Changed "btn btn-xs" to "btn btn-sm"

* adjust opengraph tag

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
Co-authored-by: Keshav Sethi <36025262+keshavsethi@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: renugasaraswathy <renugasaraswathy@gmail.com>
Co-authored-by: siddhama <54734665+siddhama@users.noreply.github.com>
nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
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.

7 participants