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

Insight Section for Spam2 #8289

Merged
merged 7 commits into from
Aug 25, 2020
Merged

Insight Section for Spam2 #8289

merged 7 commits into from
Aug 25, 2020

Conversation

keshavsethi
Copy link
Member

@keshavsethi keshavsethi commented Aug 11, 2020

[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:
Screenshot from 2020-08-12 02-38-15

Screenshot from 2020-08-12 02-39-49
Screenshot from 2020-08-12 02-39-52

@jywarren @ebarry @VladimirMikulic @pydevsg @emilyashley @ananyaarun @cesswairimu Please review!!
Thanks! ❤️

@gitpod-io
Copy link

gitpod-io bot commented Aug 11, 2020

@keshavsethi
Copy link
Member Author

@jywarren @ebarry @VladimirMikulic @pydevsg @emilyashley @ananyaarun @cesswairimu If there is need of any other statistics then please suggest, I will work on that.
Thanks!!

@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #8289 into main will increase coverage by 0.58%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
app/controllers/spam2_controller.rb 71.84% <83.33%> (+10.30%) ⬆️
app/controllers/batch_controller.rb 90.19% <100.00%> (+22.23%) ⬆️
app/models/node.rb 91.37% <100.00%> (+0.18%) ⬆️
app/models/tag.rb 97.53% <100.00%> (+0.06%) ⬆️

@jywarren
Copy link
Member

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!

@jywarren jywarren requested a review from Tlazypanda August 11, 2020 21:55
Copy link
Collaborator

@Tlazypanda Tlazypanda left a 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 😅

<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>
Copy link
Collaborator

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

Copy link
Member Author

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? %>
Copy link
Collaborator

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?

@ebarry
Copy link
Member

ebarry commented Aug 12, 2020

Awesome screenshots @keshavsethi ! What is the link where i can see this? Somewhere on https://stable.publiclab.org/spam2 ?

@keshavsethi
Copy link
Member Author

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!!
Thanks

@keshavsethi keshavsethi requested a review from Tlazypanda August 16, 2020 01:51
@cesswairimu
Copy link
Collaborator

These look great 🎉 great job @keshavsethi 🚀
I believe we have other graph_making and frequency methods. I will take a look see if there is a way we can refactor these two to reuse for both cases

Copy link
Member

@jywarren jywarren left a 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.

@keshavsethi keshavsethi requested a review from jywarren August 24, 2020 01:05
@jywarren
Copy link
Member

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!!!

@jywarren jywarren closed this Aug 25, 2020
@jywarren jywarren reopened this Aug 25, 2020
@gitpod-io
Copy link

gitpod-io bot commented Aug 25, 2020

@jywarren
Copy link
Member

restarting tests just in case

@jywarren
Copy link
Member

Strange, I "approved" codeClimate but it didn't show up here. This may need a rebase to pass everything? Thanks!!!

@keshavsethi
Copy link
Member Author

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.
Thanks!! ❤️

@@ -159,4 +160,11 @@ def setup
end
assert_selector('#select-count', text: '2')
end

test "unflag post in spam2/comments" do
Copy link
Member

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!!!!

@jywarren jywarren merged commit baa7e7c into publiclab:main Aug 25, 2020
@jywarren
Copy link
Member

Merging this!!! Thank you, @keshavsethi !!! Great work! Test it out please in stable server? Thank you!!!!

nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* insights for spam2

* ui changes and refactoring

* refactoring

* tests for spam2

* ui update and bug fixes

* minor bug fixes
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.

5 participants