* Update notifications_helper
* Update notification decorator
* Removed old notifications views
* Remove flag check from _actions partial
* Remove feature flag from views
* Remove flag from model
* Update logic in reaction drawer button
* Missed this somehow
* Update app/assets/javascripts/initializers/initializeArticleReactions.js
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Update these tests to multiple reactions
* Adjust logged-out test to account for multiple reactions
* Removed unused
* Try to boost coverage
---------
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Remove extraneous comment (see 9361d2 and 5c18f8)
* Flexible, multiple reaction types
* Fix reaction counts
* Re-use svg for active state for now
* Update yml, update spec
* Possible temp fix for failing tests
* Colorize reaction icon svgs
* Reaction engagement above post title
* Index reactions engagements (for logged-out)
* Maybe readinglist is special
* Try using crayons' dropdown as a drawer?
* readinglist isn't really public now
* feat: update the styles for the reaction drawer
* Grey background highlight, turn off border/shadow
* Read our feature flag docs, saw this was recommended
* Missed fifth emoji: party/tada
* Fix JS test errors
* Update test with tada
* Suppress flashing engagements when no public reactions
* Liberate jump-to-comments from unicorn replacement
* 'Add reaction' on tooltip
* Don't show reaction emoji on index unless it's been used
* rubocop
* Update heart+ total count when toggling
* Do not include 'readinglist' in drawer/public counts
* Fix semi-public readinglist so that icon is badged for current user
* Tweak heart-plus svg
* Style tweak: border on active reaction
* Show reacted icon on drawer trigger for 1.5 sec
* Tweak styles for engagements bar
* Style tweaks for multiple engagements (#index)
* Trying to get size working through crayons/inline_svg
* Sparkle hearts
* Restore unicorn
* Make heart-plus-active work when user has an active reaction
* Try 'hoverdown' a dropdown that activates with hover
* Long touch?
* Tap *outside* the drawer to close
* Mobile reaction drawer is also supposed to be columns
* More reaction count cleanup
* Final emoticons maybe?
* Fix reaction bug when feature disabled
* Remove readinglist from public reaction counts
* Update specs for new reaction categories
* Shuffle makes specs flaky
* Order does not matter
* rubocop
* Update to preserve readinglist analytics
* Shuffle makes specs flaky
* Fix flickering images, remove icon highlight for now
* Don't update total for readinglist
* reactions_by_user_id
* Try renaming this observer function
* Try unid ids for SVGs
* Remove local test file
* Simplistic test for the unique svg transform
* Fix javascript for current SVG
* Signifcant string literals in this case, rubocop
* Use the right expected output
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
There are 2 things going on in this pull request:
1. Reducing duplication of knowledge, by favoring constants found in
Reaction.
2. Creating and enforcing the policies regarding the different
categories of reactions.
I chose to conflate these two as I was working on developing the
ReactionPolicy's finder method.
Closesforem/forem-internal-eng#454
Related to forem/forem#17628
* schema file undelete description
* feat: v1 of the script
* Flesh out remaining enums under their categories
* complete UsersSettings data update script
* complete DUS for relevant attributes in users and profiles tables
* complete DUS for users_notification_settings
* alphabetize user_settings sql file
* safeguard against null values for "null: false" settings
* Set up actual UsersSettings DUS and specs files
* fix broken DUS script
* complete specs for UsersSetting DUS
* Address QA of specs
* complete specs for users_notification_settings DUS
* fix the typos (thanks Julianna!)
* begin implementation
* still building
* add missing attribute "email_membership_newsletter"
* complete sync code (except race condition for user profile)
* complete implementation, remains tests
* Address PR review and fix Travis fails
* remove superfluous Profile.new
* fix travis fails
* feat: update the users_notification_setting attributes from the user model
* feat: use the config fonts enums to display the fonts
* feat: loop through the keys
* fix profile = nil blowing up; add specs for notification_setting model
* remove unneeded spec
* remove feed validation until after sync code removed; fixes feed_import spec failures
* remove spec associated with feed_url validation in user_setting model
* fix failing spec 😅
* add TODO
* feat: set the user settings in the user controller and use it in the customization form
* feat: move some update logic to the users settings controller thats being used from customization
* feat: show the updated values form the users_settingd and not the user instance
* Generalize redirect back to current tab
* still trying to reflect changed theme upon refresh
* customizations take effect on refresh
* remove 'with_feed' scope from user model
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* start with takeover for fields previously in profiles table
* Takeover code for `publishing_from_rss` section in Settings (#13914)
* implement takeover code part 1
* implement takeover code
* fix feed fetch
* need rhymes help
* complete implementation; specs pending
* fix STUPID omission that caused so many headaches 😫
* implement profile fields pointing to users_settings 🎉
* run migrations
* implement inbox type & guidelines takeover code; specs pending (#13911)
* Point changes in notification settings to `users_notification_settings` table (#13910)
* implement takeover code; remains specs
* address PR feedback; remove related sync code
* address PR review feedback
* need help with routing and specs
* address pr review
* addressing pr review
* Treat implementation edge cases and omissions 😅
* fix uncommented comment
* fixing implementation cases
* address more PR review feedback
* fixing notifications use-cases
* refactor settings controller
* more pr review changes
* solving bugs
* fix broken onboarding
* handle eperience_level calls
* more fixes
* remove unneeded mappings
* add To-dos for quety updates
* remove done TODO
* purge done TODOs
* update notification_settings-related queries
* start fixing specs
* fixing specs
* fix notification and lrg_forem specs
* fixing broken specs
* still fixing
* fix line dif and remove reloads from user.rb
* run specs
* silence bullet and other fixes
* remove setting migration scripts and specs, fix more settings for specs
* handle missing user for article builder and fix notification specs
* fix some final controller specs and re-add incorrectly removed specs
* remove deprecated data update scripts and related workers, put travis back
* refactor admin tags mods controller, write/move specs for users notifications settings controller
* schema cleanup and other small refactors for consistency
* set field we can invalidate in spec via active record instead of at the db level
* remove I think an uneccessary hook call from subscribe_to_mailchimp_newsletter
* use bnefore_create to setup settings, please dont blow up the test suite
* mailchimp bot fix
* remove decorator in favor of single model method
Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* Add flag link to profile dropdown view
* Add JS for flag button on profile
* Only show flag button to trusted users
* Quick fix for accidental unflagging
This will be more properly addressed in a future refactoring.
* Update reaction specs
* Update spec
* Make flagging togglable
* Make CodeClimate happy
* Revert accidentally changed file
* CodeClimate
* Update app/javascript/profileDropdown/flagButton.js
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* Add JSDoc
* Remove second popup
* Refactor and add system spec
* CodeClimate
* Change send to public_send
* Address PR feedback by @aitchiss
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* Replace in Cache-Control header to support Nginx caching
* Add 'X-Accel-Expires' header for Nginx caching
* Remove max-age directive from remaining specs
* Update caching header specs to test against x-accel-expires header
* Fix archived readinglist reactions affecting count
The reading list count badge on the home page currently takes all
readinglist reactions into account, but we shouldn't be including those
that are marked "archived."
Secondarily this fixes a bug that affects only admin users: all
reactions created by admins were given the status "confirmed"
instead of the expected "valid" status.
* Rename positive_reactions_count to public_reactions_count
* Add positive reactions count back in so we can remove it
* Use public_category method for reactions
* Add positive_reactions_count in case any old caches rely on it
* Add positive_rxn_count to account for API endpoints
* Remove unused method
* One more spot...
* Add method back in because of caches
* Update specs to match new functionality
* Fix typo
* Remove unused methods
* Do not render or link to empty rss feeds
* s
* Move calculation to worker
* remove xit test
* Also allow implicit rating votes in comments
* Fix alignment issue
* Remove comment logic
* Initial field test spec work
* Clean up specs
* Fix codeclimage
* Cleanups
* Update names
* Rename and remove need to pass logged in status
* Leadup to prod: two experiments
* Move test logic to controller and add tests
Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
* Pluck over map
* Explain why map makes sense there
* Refactor reactions controller a bit and iterate only once
* Use group by instead of N counting queries
* More positive
* Simplify BufferedArticlesController
* Less queries for MailchimpBot
* Use Rails instead of SQL
* Build comment_ids only when needed
* Add UI to vomit on a user from /mod
Co-authored-by: MichaelaHunter <michaela1234@gmail.com>
* Add backend tweaks for vomitting on users
Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
* Validate that users can't moderate articles
* Add system spec for article mod page
* Satisfy rubocop after rebase
* Fix typo and formatting
* Use reactable_id instead of user_id
Co-authored-by: Michaela Hunter <60361569+MichaelaHunter@users.noreply.github.com>
Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
* Prepare factories and associations for Users::DeleteActivity specs
* Altered user associations, delete the needed associations in Users::DeleteActivity
* Moved and refined user deletion spec
* Removed useless commented user associations
* Refactored BackupData factory
* Refactored ProfilePin factory
* Refactored Reaction factory
* Fixed specs: Keep default _type in factories or specify it in tests
* Ok, notes shouldn't be deleted on user deletion
* Fixed creating reactable for specs
* Specify commentable/commentable_type explicitly when creating data for tests
* Fixed typo in the comments spec
* Removed unnneeded space
* Added aggregate_failures for testing user associations deletion
* Keep feedback_messages while deleting user activities
* Initial automatic cleanup with rubocop
* Fix syntax error introduced by rubocop
* Cleanup seeds file
* Cleanup lib folder
* Exclude bin folder because it contains auto generated files
* Make Rubocop a little bit more chatty
* Block length should not include comments in the count
* Cleanup config folder
* Cleanup specs
* Updated Rubocop version and generated a todo file
* Fix broken ArticlesApi spec
* Fix tests
* Restored rubocop pre-commit hook
* Delete old files and combine into one spec
* Write new reaction request spec
* Use a single route for logged in/out reaction count
* Refactor a bit
* Remove unused file
* Add reaction policy and spec
* Fix eslint issue
* Remove dead route