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 (Spam Management Dashboard) #7969

Merged
merged 29 commits into from
Jun 11, 2020
Merged

Conversation

keshavsethi
Copy link
Member

@keshavsethi keshavsethi commented May 28, 2020

Fixes #7927
Refer #7969 (comment) to see latest changes and UI
and with the feedback from PR #7928
and in reference to #7961
@jywarren @SidharthBansal @ananyaarun @pydevsg @emilyashley @VladimirMikulic @cesswairimu @ebarry

I have made some changes as per feedback from @jywarren and others

  1. Made /spam2 as an alternate URL so that it becomes easy for moderators and reviewers to see the changes and compare between two.
  2. Removed links and features that are not working as suggested by @jywarren.now all the features in UI work except Dashboard which I made grey for reference.
  3. Added some Bulk moderation features like bulk_spam, Bulk_publish, Select all/none, Bulk_delete, Bulk_ban.
  4. Made it responsive for all devices and the table is scrollable horizontally within the card.
  5. Added color for status of post as mentioned by @jywarren in Disambiguation of "Publish post" and "Spam post" on /spam dashboard #7953. I have commented there as well.
  6. New UI which is simple and responsive.

Screenshots

Screenshot from 2020-05-29 03-11-15
Screenshot from 2020-05-29 03-00-18
Screenshot from 2020-05-29 03-11-32
###Gifs
ezgif com-video-to-gif (2)
ezgif com-crop (2)

Tests are left as of now I am working on them. I will push them soon.
@jywarren @SidharthBansal @ananyaarun @pydevsg @emilyashley @VladimirMikulic @cesswairimu @ebarry Please give your feedbacks

Thanks!

@codecov
Copy link

codecov bot commented May 28, 2020

Codecov Report

Merging #7969 into master will decrease coverage by 4.44%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7969      +/-   ##
==========================================
- Coverage   82.04%   77.60%   -4.45%     
==========================================
  Files          97       99       +2     
  Lines        5643     5840     +197     
==========================================
- Hits         4630     4532      -98     
- Misses       1013     1308     +295     
Impacted Files Coverage Δ
app/controllers/spam2_controller.rb 100.00% <100.00%> (ø)
app/helpers/spam2_helper.rb 100.00% <100.00%> (ø)
app/controllers/openid_controller.rb 0.00% <0.00%> (-53.85%) ⬇️
app/controllers/comment_controller.rb 72.34% <0.00%> (-14.90%) ⬇️
app/controllers/users_controller.rb 71.18% <0.00%> (-11.12%) ⬇️
app/models/comment.rb 68.96% <0.00%> (-7.94%) ⬇️
app/controllers/application_controller.rb 84.61% <0.00%> (-7.70%) ⬇️
app/controllers/home_controller.rb 91.93% <0.00%> (-6.46%) ⬇️
app/controllers/admin_controller.rb 72.15% <0.00%> (-5.91%) ⬇️
app/models/spamaway.rb 92.30% <0.00%> (-2.57%) ⬇️
... and 6 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.

Items are not centred.

2020-05-29_00-38

Copy link
Member

@ananyaarun ananyaarun left a comment

Choose a reason for hiding this comment

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

Hey this looks great !
Can you add a screenshot of the latest changes as well ?

@keshavsethi
Copy link
Member Author

Items are not centred.

2020-05-29_00-38

Screenshot from 2020-05-29 07-12-06
I have aligned actions wrt other columns.
Thanks!

@cesswairimu
Copy link
Collaborator

Great job 🎉 @keshavsethi 🎉 , could you please take a look at the codeclimate issues and travis fails...ping me if you need any help

@keshavsethi
Copy link
Member Author

I have made a few more changes to UI and made it more refined and responsive. Please give your reviews. Please check bulk moderation features as well. Now I am working on some table related features and tests.
Screenshot from 2020-05-30 05-44-33
Screenshot from 2020-05-30 05-44-43
Screenshot from 2020-05-30 05-45-37
Screenshot from 2020-05-30 05-45-46

@jywarren @SidharthBansal @ananyaarun @pydevsg @emilyashley @VladimirMikulic @cesswairimu @ebarry Please give your feedback and reviews.
Thanks!! 😄

@keshavsethi keshavsethi changed the title Spam2 Spam2 (Spam Management Dashboard) May 30, 2020
@keshavsethi
Copy link
Member Author

I have added modal for note body as sometimes it becomes big and doesn't fit in one column. I have also added a hide feature where users can hide some of its columns for a better view.
Gif
ezgif com-video-to-gif (3)
@jywarren @cesswairimu @VladimirMikulic @pydevsg @ananyaarun @Uzay-G Please review some latest changes, Thanks!!

@jywarren
Copy link
Member

jywarren commented Jun 3, 2020

Wow, this is really impressive work. I'll need to go through it carefully and hope to today. Thank you!

@keshavsethi
Copy link
Member Author

Wow, this is really impressive work. I'll need to go through it carefully and hope to today. Thank you!

Thanks @jywarren, If you have any suggestions regarding some extra filters and more bulk moderation features then I can add them too. Can you please ask other PL moderators regarding some special filter or something else which they need in the dashboard.
Thank you!! 😄 ✌️

@emilyashley
Copy link
Member

emilyashley commented Jun 4, 2020

Thanks Keshav! I'm also putting 👀 on this this week :) The interface is looking great (I especially appreciate errors and notifications) and I can't wait to pull down a branch and check it out in real time.

@keshavsethi
Copy link
Member Author

keshavsethi commented Jun 5, 2020

@jywarren
Copy link
Member

jywarren commented Jun 5, 2020

@emilyashley if this does not make any changes to the existing system (either back-end or UI), we could merge it as a beta, since it's at /spam2.

I'm afraid I haven't had time to go through it thoroughly. @keshavsethi are there system tests for the UI so I can know exactly what to try out? Thank you!

@keshavsethi
Copy link
Member Author

keshavsethi commented Jun 5, 2020

@emilyashley if this does not make any changes to the existing system (either back-end or UI), we could merge it as a beta, since it's at /spam2.

I'm afraid I haven't had time to go through it thoroughly. @keshavsethi are there system tests for the UI so I can know exactly what to try out? Thank you!

@jywarren @emilyashley Right now this PR only has functional tests, I was thinking of adding system tests and other features in other PR as this PR is getting bigger. If you want I can do system tests here only.
Thanks!!

@keshavsethi
Copy link
Member Author

keshavsethi commented Jun 7, 2020

@SidharthBansal @emilyashley @jywarren @cesswairimu @pydevsg @ananyaarun @VladimirMikulic If you want me to work on /spam only then I can shift to that too. This PR is big because every page which was in /spam has to be here in /spam2 as well like wiki, notes, comments, and revisions. /spam2 has all the functionality as /spam including some of the bulk moderation features. If this PR is creating some issues like so big or something then I can either make PR in small parts or I can do this directly in /spam (This will not take much time). Please give your suggestions.
Thanks!!

@SidharthBansal
Copy link
Member

Spam2 is ambiguous to me. Kindly write some descriptive name for added functionality.

@keshavsethi
Copy link
Member Author

keshavsethi commented Jun 9, 2020

Spam2 is ambiguous to me. Kindly write some descriptive name for added functionality.

@SidharthBansal , I have created spam2 as suggested by @jywarren because it will help moderators to provide better feedback and suggest changes by comparing it with old one.
As far as naming is concerned please refer:

  1. Bulk moderation features in the second top nav. their methods are named as batch_x example batch_spam, batch_publish etc, and ids are named as batch-x like batch-spam etc.
  2. Datatables Ids are named as x_table eg. node_table, revision_table etc. It has sort and search filters.
  3. Table filter, I have added some basic table filters like spammed for filtering spam post and so on. their js code is in _node.html.erb.
  4. Node individual publish and spamming. for this alter is added and modal is created for better moderation. It is in the table of _node.html.erb.
  5. Overall UI, you can find most of it like top nav and sidebar in spam.html.erb and admin.css

I have made another PR where I have made direct changes to /spam because basic structure and URLs remain the same in master and new /spam. please refer to #8009. I am ok with both /spam and /spam2.

Thanks!!

@keshavsethi
Copy link
Member Author

keshavsethi commented Jun 10, 2020

@jywarren @SidharthBansal @ananyaarun @pydevsg @emilyashley @VladimirMikulic @cesswairimu @ebarry @Uzay-G Please review and merge this. Actually I can't work on further PRs as they are dependent on this. Adding more commits to the same PR will make it very big and difficult to review.
Thanks!! 😄

@jywarren
Copy link
Member

Hi, thank you! So glad to see the /spam2 URL and will review and hopefully merge today. This will be great. Confirming that nothing in /spam has been changed and will work the same?

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 love this. Very very thorough functional testing. I think this is good to go! Can I request that this UI be system tested thoroughly as well? For future PRs, having system tests means we can read through the specific UI interactions and be sure we understand them as well, so if you could think ahead to including them that would be great and would help speed up reviews too!

Example of a system test here: https://github.com/publiclab/plots2/blob/master/test/system/post_question_test.rb

Great job on this @keshavsethi!!! 🎉

@jywarren jywarren merged commit e8ca4ab into publiclab:master Jun 11, 2020
@jywarren
Copy link
Member

Yay!!!

And sorry to repeat myself on system tests. Let's do them in future PRs! If u can open a new PR with system tests for this new code, that'd be great, and link it to here. 🎉

Especially system tests for bulk moderation tasks, as it can happen that future code breaks such carefully written UI and we want to ensure all the JS is working. Thank you!!!

One small UI change I might request is to use a button group for the right-side buttons, which can also make it more clear that the grey ones are not enabled, you know? They could be quite small: https://getbootstrap.com/docs/4.4/components/button-group/#sizing

@keshavsethi
Copy link
Member Author

Hi, thank you! So glad to see the /spam2 URL and will review and hopefully merge today. This will be great. Confirming that nothing in /spam has been changed and will work the same?

Yes, Nothing has been changed by me in /spam and it will work the same

@keshavsethi
Copy link
Member Author

I love this. Very very thorough functional testing. I think this is good to go! Can I request that this UI be system tested thoroughly as well? For future PRs, having system tests means we can read through the specific UI interactions and be sure we understand them as well, so if you could think ahead to including them that would be great and would help speed up reviews too!

Example of a system test here: https://github.com/publiclab/plots2/blob/master/test/system/post_question_test.rb

Great job on this @keshavsethi!!!

@jywarren I am working on system tests and I will make a PR for this soon.
Thanks!!

@keshavsethi
Copy link
Member Author

Yay!!!

And sorry to repeat myself on system tests. Let's do them in future PRs! If u can open a new PR with system tests for this new code, that'd be great, and link it to here.

Especially system tests for bulk moderation tasks, as it can happen that future code breaks such carefully written UI and we want to ensure all the JS is working. Thank you!!!

One small UI change I might request is to use a button group for the right-side buttons, which can also make it more clear that the grey ones are not enabled, you know? They could be quite small: https://getbootstrap.com/docs/4.4/components/button-group/#sizing

@jywarren Sure, I will add a button group for this. Thanks!!

@cesswairimu
Copy link
Collaborator

🎉

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.

UI and data table for Spam Management Dashboard
9 participants