* Add ClassifiedListingEsIndexWorker & spec
* Update ClassifiedListing model
- Add es index methods (inline and async)
- Index ClassifiedListing to es after_commit
- Add serialized_search_hash
- Update model specs for new methods
- Add serializers referenced in new model method
* Update specs
* Create DataUpdateScript to index ClassifiedListings
* Fix formatting
* Fix codeclimate :/
* Use match_array instead of keys.sort
* Change find_by! to find
* Update spec
* Update mappings for ClassifiedListing
* Update specs
* Implement refactor with Searchable module
* Add json support at stories/index endpoint
* Tweak tests
* Add main image
* Some light refactoring in StoriesController
* Tiny test refactor
* Split feed generation to it's own controller
* Use Jbuilder for article formatting
* Blank lines thanks Rubocop
* Don't cache this response: we want it generated per use each time
* Whoops!
* PR changes and tweaks to Timeframmer constants
* Remove initializer test since arguments aren't required
* feat: we add the attribute for faceting
* feat: pass the requires_approval tag through with the dataset
* feat: if the tag requires approval then filter by the approved:true facet that we setup via algolia
* chore: false is redundant
* chore: robocop syntax improvement
* refactor: rename filters to tagFilters
* chore: standard javascript styleguide formatting
* chore: javascript styling
* Update app/assets/javascripts/initializers/initScrolling.js.erb
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* feat: port over changes (+ suggestions) from https://github.com/thepracticaldev/dev.to/pull/5892/files
* chore: add query over multiple lines
* refactor: move the sql logic into the controller instead of in the template
* chore: appease code climate
* feat: the number of published posts should show up by approved article.
* chore: Do not use spaces between -> and ( in lambda literals
* refactor: use the existing function in order to spawn the one where we need approval
* refactor: move logic to the controller instead of the view :)
* chore: code climate syntax
* chore: more codeclimate
* Add sink user service and specs for mass vomits
* Use new score calculation
* Lower articles' scores instead and make async
* Add lower score functionality to controllers
* Remove unused variable
* Use correct var and add missing arg
* Remove unused status
* Add composite index for reactable_type and ID
* Use alias instead of additional boolean
* Use medium priority for sink worker
* Log to honeybadger and not logs
* Log the error and not a string
Bullet doesn't seem to like this, and it makes sense because we don't
want to load ALL reactions, just some of them.
Co-authored-by: nspinazz89 <nspinazz89@gmail.com>
Co-authored-by: Nick S <nspinazz89@gmail.com>
* Convert SponsorshipDecorator to Rails decorator
* Remove empty ReactionDecorator
* Rename SponsorshipDecorator#level_color_hex to level_background_color
* Convert CommentDecorator to Rails decorator
* Add specs and fix bugs for NotificationDecorator
* Convert NotificationDecorator to Rails decorator
* Add specs and fix bugs for OrganizationDecorator
* Convert OrganizationDecorator to Rails decorator
* Add specs to PodcastEpisodeDecorator and fix bugs
* Convert PodcastEpisodeDecorator to a Rails decorator
* Add missing specs for ArticleDecorator and fix bugs
* Convert ArticleDecorator to Rails decorator
* Add missing specs to UserDecorator and fix issues
* Convert UserDecorator to Rails decorator
* Add .decorate_collection method
* Add decorator for AR relations and remove Draper
* Rename BaseDecorator back to ApplicationDecorator
* Rename .decorate_ back to .decorate
* Restore decorate_collection (WTH)
* Add decorated?
* Fix bugs and failing specs
* Decoration should always be explicit
* Add more Broadcasts to seeds for welcome notification flow
* Remove unnecessary welcoming_user_id from development config
* Add basic service class for generating appropriate broadcast per user
Eventually, this should be called from a rake task that will rely on this service to determine which broadcast, if any, is the appropriate one to send to newly signed-up users, and will enqueue a worker to create/send a welcome notification when appropriate.
* Add a few TODOs, plus some general cleanup
* Add some skipped tests for WelcomeNotification::Generator
* feat: add approved as an index or ordered articles and for the algolia search
* oops: added approved to the wrong place, should be on ordered_articles
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts
This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.
This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.
* Allow WelcomeNotificationWorker to accept + send any kind of broadcast
This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.
* Raise if a Notification can't be created
* Add STAFF_USER_ID as an ENV var
This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.