-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Insight Section for Spam2 #8289
Conversation
@jywarren @ebarry @VladimirMikulic @pydevsg @emilyashley @ananyaarun @cesswairimu If there is need of any other statistics then please suggest, I will work on that. |
Codecov Report
@@ Coverage Diff @@
## main #8289 +/- ##
==========================================
+ Coverage 81.28% 81.86% +0.58%
==========================================
Files 101 101
Lines 5872 5900 +28
==========================================
+ Hits 4773 4830 +57
+ Misses 1099 1070 -29
|
Ooh, this is really good looking! Highlighting to staff.... thanks! Also perhaps @cesswairimu and @Tlazypanda may want to look this over and offer input on the performance of the queries? This can pull a lot of data, i know! |
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.
Hey @keshavsethi I have just added some general suggestions that we might be able to use to improve performance 😅
app/views/spam2/_insights.html.erb
Outdated
<div class="card-body"> | ||
<h5 class="card-title text-secondary font-weight-bold"> <i class="fa fa-circle text-primary"></i> Unmoderated</h5> | ||
<ul class="list-group list-group-flush text-secondary "> | ||
<li class="list-group-item"><%= Node.where(status: 4).count%> Nodes</li> |
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.
This seems the right usage of count
but since we are replacing it with .size
throughout the app so maybe can do it here to achieve consistency 😅 just a suggestion
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.
Thanks @Tlazypanda, I will do this!! 👍
<div class="card border-0"> | ||
<div class="card-body"> | ||
<h5 class="card-title text-secondary font-weight-bold"> <i class="fa fa-tags text-primary"></i> Tags followed by moderators and admins</h5> | ||
<% if @popular_tags.present? %> |
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 use .exists?
instead of .present?
reference https://semaphoreci.com/blog/2017/03/14/faster-rails-how-to-check-if-a-record-exists.html also sidenote: @cesswairimu @jywarren should we do a refactoring for this in the app too?
Awesome screenshots @keshavsethi ! What is the link where i can see this? Somewhere on https://stable.publiclab.org/spam2 ? |
@ebarry This will be available on stable once it is merged, you can try this out in gitpod!! |
These look great 🎉 great job @keshavsethi 🚀 |
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 think just a functional test at a minimum would make this ready to merge -- and if you can add a couple system tests for any basic interactive features you want to describe and protect, even better! Thanks @keshavsethi !!! This is very exciting.
Hi @keshavsethi - happy to review but can you take a look at the Travis test failures first? I'll resolve the CodeClimate one. Thank you!!! |
restarting tests just in case |
Strange, I "approved" codeClimate but it didn't show up here. This may need a rebase to pass everything? Thanks!!! |
@jywarren I have made some minor bug fixes. It should work now. |
@@ -159,4 +160,11 @@ def setup | |||
end | |||
assert_selector('#select-count', text: '2') | |||
end | |||
|
|||
test "unflag post in spam2/comments" 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.
This is great. Thank you!!!!
Merging this!!! Thank you, @keshavsethi !!! Great work! Test it out please in stable server? Thank you!!!! |
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
* insights for spam2 * ui changes and refactoring * refactoring * tests for spam2 * ui update and bug fixes * minor bug fixes
[WIP]

Here I worked on the Insight section of Spam2 which contains stats related to the moderation and tags followed bt moderators and admins. Please refer to the following Screenshots:
@jywarren @ebarry @VladimirMikulic @pydevsg @emilyashley @ananyaarun @cesswairimu Please review!!
Thanks! ❤️