* Move calculating comments score from worker to a service
* Display displayed comments count in feed
* Recalculating displayed comments counts on article show (if needed)
* Rubocop fixes
* Fixed lambda
Co-authored-by: Lawrence <lawrence@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Rajat Talesra <rajat@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Revert "(Temporarily) Remove multiple reactions from #index (#19142)"
This reverts commit a45d300639.
* Clean up reaction category count mechanism for #index
* Remove, unnecessary
* Expose reaction categories in JSON response
* Update test with new categories
* Fix flaky sample / minimum floor
* buildArticle (infinite scroll) with multiple reactions
* If we're doing #index front-end, we aren't feature-flag'd
* nbsp
* react (home feed) has multiple_reactions
* Update app/assets/javascripts/utilities/buildArticleHTML.js
Co-authored-by: Rajat Talesra <rajat@forem.com>
* Clean up Reactable#reaction_categories
* Use 'multiple_reactions_icons_container'
* Try adding a ReactionCount test
* Adapt memory fix from 76dd53d
* Try adding categories to fixture
* Attempt to eager-load distinct public categories
* Setting dependent to the default for rubocop
* Try making image assets more public?
* Revert "Fix flaky sample / minimum floor"
---------
Co-authored-by: Rajat Talesra <rajat@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
* Added tag search to nav menu
* Added tag search
* Improved tags search results view
* Removed commented lines from the controller
* Fix specs for Search::Tag
* Prepare for tags search pagination
* Fixed Search::Tag specs
* styling
Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
* Refactoring to add helper method
Prior to this commit, we made view level calls to service modules. This
refactor provides convenience methods on the model.
Furthermore, it addresses a few Rubocop violations that "come along for
the ride."
* Ensuring cached entity squaks like User
* Fixing broken spec
* Fixing typo
Prior to this commit, we had two places that need to know the nuances
ofquerying for tag flares and what we should include in our queries for
serialization.
With this commit, we're factoring towards a common source of knowledge
and providing a much needed test for the expected output of this
serialization.
Loosely related to #15916, #15983, #15994, and #16032.
Below are the grep results of searching for ArticleSerializer (note
there are no remaining `Search::ArticleSerializer' references).
Using `ripgrep` (e.g., `rg`), I have the following from the `main`
branch.
```log
> rg ArticleSerializer
app/services/search/reading_list.rb:
Search::ReadingListArticleSerializer
app/services/search/article.rb:
Homepage::ArticleSerializer
app/services/homepage/fetch_articles.rb:
Homepage::ArticleSerializer
spec/serializers/search/reading_list_article_serializer_spec.rb:
RSpec.describe Search::ReadingListArticleSerializer do
app/serializers/search/reading_list_article_serializer.rb:
class ReadingListArticleSerializer < ApplicationSerializer
app/serializers/homepage/article_serializer.rb:
class ArticleSerializer < ApplicationSerializer
```
Definitely want to keep pruning unused code.
This relates to exploration around #15916 and the attempted solutions in
* add needed fields to tag search
* specs
* add badge to tags suggest response (#15840)
* Add badge to tags suggest response
* Update tags_spec.rb
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
* limit tag search badge to only badge_image
* only unpack badge image if badge exists
Co-authored-by: Dwight Scott <dwight@forem.com>
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
* Remove Connect
* Remove more Connect specs
* Remove a lot more Connect code
* 🚮
* It all has to go
* Explicitly add httpclient
* Update application layout
* Remove messages association from User
* Start fixing specs
* reintroduce util function and refactor references
* Remove Connect Cypress test
* Fix more specs
* Remove Connect from listings
* Ignore contact_via_connect column on listings
* Remove contact_via_connect usages
* Ignore mod_chat_channel_id on tags
* Drop Connect tables
* Remove email_connect_messages from user notification settings
* Re-add httpclient 2.8.3
This was mistakenly removed as a merge conflict
* Don't need to exclude removed chat channel file
* Remove unneeded style for chat channels
* Remove unneeded channel list prop type
* Remove chat channels index/connect-link from getPageEntries
* Re-add comment from httpclient in Gemfile
* Remove connect references from mailers
Tag Moderators no longer have a chat channel
No longer will users be notified about new messages (there won't be
any)
No longer will users be notified about channel invites (you can't
invite anyone anymore)
* Don't configure Pusher and remove PUSHER_* from .env_sample
since it's removed from gemfile, the Pusher constant will not resolve, if this is
configured in the environment variables we'll fail to boot.
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Dan Uber <dan@forem.com>
* Add Search::Postgres::User
* Add sorting params
* Use a better algorithm to filter out suspended users
* Add tsvector index on users.name
* Add specs
* Add UserRole spec
* Update spec/services/search/postgres/user_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Fix search with quotes in users's names
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Remove search from connect
* Remove alternate approach
* Alphabetize CHAT_CHANNEL_PARAMS
* Remove default value for user_ids
* Add spec for result ordering
* Remove pro role on user, expose pro dashboard to all users as analytics
* Remove pro from Elasticsearch mappings
* Update user role docs to use :trusted over :pro
* Remove pro from Role model spec
* Remove more references to pro, as noted by @rhymes
* Add PgSearch to Listing model
* Working MVP - pre-optimizations
* Remove includes
* Update search_spec
* Add more specs
* Fix specs
* Refactor filter_by_category
* Update block parameter name
* Add published index to classified_listings table
* Preload user, organization, and listing_category
* Working MVP - pre-optimizations
* Refactor filter_by_category
* Update schema
* Fix schema for real
* Remove constant specs and make them private
* Step one in populating the reading list with PG
This first attempt tries to recycle the `Search::ArticleSerializer` which is only
used in input in ES, but we're using it in output in PG.
For this reason it's currently 15.55x times slower
* Serialize only what is requested by the frontend
`Search::ArticleSerializer` which is only used in ES in the indexing step aims
to add as much info as possible for broader purposes, in this case
(with serialization in output) we should aim to save only what's requested from
the frontend.
* Optimize selection of articles columns
* Select only needed columns for users
* Compute total of reading list items
* Attach the basic filtering based on PG on the search controller
* Restructure in methods
* Add tags support
* Use LIKE on articles.cached_tag_list
* Fix tags as nil
* Fix default pagination
* Add optional FTS for reading list
* Reworded the tags comment explaining why
* Add index to reactions.status
* Fix total counter in Preact readingList component
* Fix total count in reading list backend search
* Add GIN index to articles.cached_tag_list
* Add service tests
* Add search request specs
* Added missing early return
* Update spec/requests/search_spec.rb
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Extract MAX_PER_PAGE constant and add comments
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Showing date in listing tile
* Displaying date in listing tile
1. Sending created_at in listing search API
2. Global util functions for short and long date formatting
3. New date util functions extend timestampToLocalDateTime
4. Converting div to time tag
5. Adding title attribute for date
* originally_published_at column
* Displaying originally_published_at date
* Fixing test in modal
* Fixing all listing test
* Fixing casing of dateTime
* Adding tests for originally_published_at
* Reverting to bumped_at
* Backfilling only published listing
* Removing ReIndexListingWithOriginallyPublishedAt
* Update mapping
* Update user search serializer
* Add data update script for reindexing users
* Only index roles for persisted users
* Add conditional to profile search serialization
* Update data update scripts
* Update spec for data update script
* Change models and related files
* Update controllers and specs
* More renaming
* Seek and destroy, I mean search and replace
* Round up the stragglers
* Ground control to Major Travis...
* More fixes
* PR feedback
* Various fixes
* Rename view
* Fix list query builder
* Unify request specs
* Fix some API spec errors
* Fix remaining API specs
* Make spec conform to API
* Fix leftover problems
* Fix JS tests
* Fix column name in select
* Fix API specs
* Fix search specs
* Paging Mr. Travis
* 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
* Add public_reactions_count field to elasticsearch
* Add new data update scripts and update old ones
* Use BulkIndexWorker to batch indexing
* Use proper search class for handling feed content
* Remove redundant script oops
* Rename data update script and remove old specs
* Combine specs into one file
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Feature 🚀 : Ability to edit messages
* Test Cases📝 : Specs for Edit message added
* added new column discoverable for public channel and changes in elasticsearch
* fix corrections
* changes in serializer file, added channel_discoverable
* added checkbox with discoverable policy
* changes in code for discoverable channels
* accept and reject member invitation by mod
* add joining request to closed groups
* fixed merge error
* changes in joining member to closed groups
* join to closed group
* changes in message action of joining
* changes in chat upopened json
* 🚀Feature : Ability to search Global Channels
* touch updated_at in after commit update
* 🚀Feature : Ability to send request to discoverable channel
* 🚀Feature : Ability to send request to discoverable channel
* created new route for joining closed channel
* 🚀 Success handle on joining request sent
* removed redundant code
* join_channel improvement, removed authorization for join channel
* list of joining requests
* added joining_request status channels on search list
* changes in mailer and query builder optimized
* 🛠 Adding filter for new Query
* added rspec for add membership method in controller
* rspec for sending join channel request
* invite join request channel list rspec
* test case for query builder discoverable
* viewable and discoverable channel list
* refactored logic for search channels
* 🚀 Check if Request already sent
* 🛠 Optimizing code and making channelButton Component
* 🛠 Optimizing codefor SVG problem
* 🛠 Optimized action.js
* changes in search controller query
* hot fix
* removed unwanted code
* 🛠 Fix the Channel Name problem
* 🛠 Optimizing code further for CodeClimate
* added new column discoverable for public channel and changes in elasticsearch
* fix corrections
* changes in serializer file, added channel_discoverable
* added checkbox with discoverable policy
* changes in code for discoverable channels
* accept and reject member invitation by mod
* add joining request to closed groups
* fixed merge error
* changes in joining member to closed groups
* join to closed group
* changes in message action of joining
* changes in chat upopened json
* touch updated_at in after commit update
* 🚀Feature : Ability to search Global Channels
* 🚀Feature : Ability to send request to discoverable channel
* 🚀Feature : Ability to send request to discoverable channel
* created new route for joining closed channel
* 🚀 Success handle on joining request sent
* removed redundant code
* join_channel improvement, removed authorization for join channel
* list of joining requests
* added joining_request status channels on search list
* changes in mailer and query builder optimized
* added rspec for add membership method in controller
* rspec for sending join channel request
* invite join request channel list rspec
* 🛠 Adding filter for new Query
* test case for query builder discoverable
* viewable and discoverable channel list
* refactored logic for search channels
* 🚀 Check if Request already sent
* 🛠 Optimizing code and making channelButton Component
* 🛠 Optimizing codefor SVG problem
* 🛠 Optimized action.js
* changes in search controller query
* hot fix
* 🛠 Fix the Channel Name problem
* 🛠 Fixing merge problem
* 🛠 Optimizing code further for CodeClimate
* updated UI for membership edit
* fixed test casses and fixed UI for chat_channel_edit
* 🛠napshots added
* test cases fixed
* 🛠 Test cases added for new component
* channel settings accesible only by mod
* 🛠 More Test cases added
* 🛠 Svg code optimized
* 🛠 Svg code optimized in videocontent
* optimized code for search query
* fix test case for query builder
* changes in joining closed channel logic
* refactored join channel
* redirect to edit channel after joining request
* changes in test case for redirect
* optimized code
* 🛠 Eslint bugs fixed
* test case fixed
* optimization
* olving channel repetition problem
* optimization of code for query builder
* changes in query builder
* test cases fixed
* 🛠 Handling reduntant data on frontend
* 🛠 Don't show data if no filter query
* 🛠 Optimized code for fixing bugs and code coverage
* 🛠 Optimizing code further for CodeClimate
Co-authored-by: Parasgr-code <paras.gaur@skynox.tech>