* Created separate comments page
* Optimised code for single comment and multiple comments
* Indifual comments poage added
* Minor header change
* Created show method
* Full implementation with eager loading error
* Temporarily suppress Bullet from Admin::CommentsController
* Minor fixes
* Minor fixes
* Added table
* Added french translations
* Added reaction stats / summary
* Tests added fore empty comments
* Added seed data and few more tests
* Updated test
* Added model tests for comment and article
* Nit test fix
* Applied changes as per PJ's review
---------
Co-authored-by: Joshua Wehner <joshua@forem.com>
* Raise a clearer error message when the user tries to comment on a draft post.
* Apply suggestions from code review
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Sort comments in articles page
* Clickable area in sort comments article is now more approriate
* Comments subtitle is now responsive in articles page
* Consider comments sort order for cache in articles page
* On selecting sort option the refreshed page lands to comments section
* Added a way to sort comments on an article
* Sorting of comments now uses crayons-dropwn. Some minor fixes as per comments on PR
* Add and fix test cases for sorting comments functionality
* Changes in code for sort comments. Code is more aligned with forem's conventions
* Added cyperss tests for sort comments on an article. Cleaned up code to better follow forem conventions
* Get fresh handle of triggerButton everytime clickOustideListener is clicked. Fix Cypress test cases to reflect the earlier.
* Refactoring Spam Handler
There's considerable repeated logic between checking spam for an article
and spam for a comment and user.
This attempts to send things through channels that are similar and close
in organization.
* Fixing broken spec
* Fixing spec around recent user
* Update app/models/reaction.rb
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Update app/models/reaction.rb
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Consolidating new user query logic
Prior to this commit there were two separate queries around new user
logic. With this commit, we're changing the logic to repurpose a site
wide setting.
* Generalizing a previously specific message
* Fixing method name
As part of a recommended refactor, I extracted a method, then renamed
it. I failed to account for that renaming.
This commit fixes that.
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Add a failing test case
Currently fails with the reported error
expected no Exception, got #<ArgumentError: Requires a Node, NodeSet or String argument, and cannot accept a NilClass.
* Only replace inner html if not nil
`sub!` can return nil and you can't set an XML::Element's content to
nil (coercion fails).
* Use sub rather than sub! since we'll be using assignment
The issue we were seeing was that sub! returns nil when no change was
made, while sub always returns a string (with modificationsn made).
Remove temp variable since it's not needed when we use the other method.
* fix: shorten_urls to only shorten URLs
* revert: changes to schema.rb
* modify: test to aggregate failures
Co-authored-by: rhymes <github@rhymes.dev>
* fix: shorten_urls to only strip urls
* improve: regex and variable assignments
* remove: unnecessary var assignment
Co-authored-by: rhymes <github@rhymes.dev>
* fix: shorten_urls to only shorten URLs
* revert: changes to schema.rb
* modify: test to aggregate failures
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: rhymes <github@rhymes.dev>
* Create DiscussionLocks
* Fix specs
* Update nullify_blank_notes_and_reason
* Update before_validation call
* Updated DiscussionLockPolicy for clarity
* Move permitted_attributes to a constant
* Update route
* Apply suggestions from code review for frontend
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Add title tags
* Wrap unlock confirm in main element
* Wrap flash messages up in div
* Actually fix title tags
* Hide comment reply button when discussion is locked
* Add E2E tests
* Try to fix E2E tests
* Cypress...you work locally but not in CI...why!?
* PR feedback
* Update E2E tests
* More E2E updates 😭
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* add user friendly error message when a comment is made on a deleted post
* add validation message when commentable is empty
* Update app/models/comment.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update spec/models/comment_spec.rb
Co-authored-by: rhymes <github@rhymes.dev>
* Update spec/models/comment_spec.rb
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: rhymes <github@rhymes.dev>
* Rename SiteConfig
* More renaming
* Update spec
* Update mandatory settings mapping
* More renaming
* e2e test fixes
* You have a rename, and you have a rename
* Spec fix
* More changes
* Temporarily disable specs
* After-merge update
* Undo rename for migration
* undo rename of DUS
* Fix DUS
* Fix merge problem
* Remove redundant DUS
* Fix specs
* Remove unused code
* Change wrong class name
* More cleanup
* Re-add missing values to constant
* Fix constant
* Fix spec
* Remove obsolete fields
* Add accidentally removed field
* Update spec
* Move methods from Settings::General to ForemInstance
* Remove unneeded model
* Change mentions of 'site config'
* Update format specifiers in readable_publish_date
* Trigger Travis manually
* Update format specifiers in readable_publish_date
* Update format specifiers in readable_publish_date
Co-authored-by: rhymes <rhymes@hey.com>
* Rename banned and comment_banned roles
* Add data update script to rename roles containing 'ban'
* Add named error for Suspended users
* Update unidiomatic method names
* Rename misc banned to suspended
* Apply suggestions from code review
Co-authored-by: Michael Kohl <me@citizen428.net>
* Add unit tests for suspended methods
This commit also adds TODO comments for removing banned and
comment_banned from the codebase after data update scripts have
successfully run on all of our Forems.
Co-authored-by: Michael Kohl <me@citizen428.net>
* Limit mentions in articles
* Bump MAX_USER_MENTION_LIVE_AT to April 7th, 2021 UTC time
* Use stubbed constants in article and comment specs
* Add TODOs around extracting MAX_USER_MENTIONS into constant
* Limit number of mentions in a single comment
Ensure that no more than 6 users can be mentioned in a single comment
* Extract max user mentions into constant
* Check mentions but don't process them unnecessarily
* Add error message check to comment spec
* Add MAX_USER_MENTION_LIVE_AT to comments, plus specs
* Bump MAX_USER_MENTIONS to 7 for DEV Top Seven posts
* Add some clarifying comments around MAX_USER_MENTION limit
* Update app/models/comment.rb to use activesupport helper!
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Implement changes
* display "Suspended" if user role.name is banned
* Correct equality symbol
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Michael Kohl <me@citizen428.net>
* Add dependent clauses to Article model
* Comment should be valid without a commentable
* Add cleanup scripts
* Cache the comments ids before destroying the article
* Add dependent clause to Article.user_subscriptions as well
* Fix specs