* Add tsvector index on listings
* Fix sorting order when fetching tag flares
* Add published_at as a sorting condition for Homepage::ArticlesQuery
* Re-added param needed by ES, this got lost somewhere down the line
* 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>
* Use trigger and tsvector column to speed up reading list search
* Add organization destroy spec and todo note
* Fix failing data update script due to not null constraint
* Remove the leading anchor in the trigger regexp
* Fix reading list specs
* Address feedback
* Remove search from connect
* Remove alternate approach
* Alphabetize CHAT_CHANNEL_PARAMS
* Remove default value for user_ids
* Add spec for result ordering
* 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>
* 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>
* Add PostgreSQL FTS for usernames
* Change profile_image_90 logic
* Make search_users private
* Add tsvector index on usernames
* Limit the number of search results
* Update index name
* Add Search::Postgres::Tag to retrieve tags for autocompletion
* Add Search::Postgres::Tag in SearchController behind a feature flag
* Update spec/services/search/postgres/tag_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Add index to tags.supported
* Fix hotness_score ordering
Co-authored-by: Michael Kohl <citizen428@dev.to>
* This change abstracts the DatadogStatsClient into a ForemStatsClient.
The purpose of this abstraction is to set the foundation for a subsequent PR that will allow one to use New Relic for recording Forem stats, instead of Datadog, if there is a New Relic configuration found.
This specific change creates an abstraction layer that can be built upon, without changing any actual default behavior. All specs still pass.
* Use delegate instead of explicit methods.
* Delegate instead of explicit methods.
* Fix the error.
* Refactor according to the suggestions in the comments.
* Ooops. Stats work better when all of the code is committed.
* Removing the alias of count to increment since that was done in error.
* Enable new Lint/ cops and run rubocop -a
* Fixing last remaining things with rubocop -a
* Enable and fix Style/ExplicitBlockArgument and Style/GlobalStdStream
* Forgot parenthesis
* 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
* Use .textContent to apply Search Snippets
* Improve var name
* Apply HTML encoder to FeedContent's query
* Add spec
* Expand FeedContent specs
* Actually let's not use approval
* 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
* Introduce Github::OAuthClient and refactor shortcut Github::Client
* Better stubbing and fix specs
* Fix Badge rewarder
* Add dummy values for Travis
* Fix spec?
* Simplify
* Fix spec take 2?
* Is this the right one?
* Hopefully this is the last time, for realz
* Fix spec for the nth time?
* Which deity do I have to offer a sacrifice to?
* This is it
* Fix Honeycomb name
* 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>