Commit graph

1077 commits

Author SHA1 Message Date
Lucas Hiago
d0b4ba2648
Change BustReactableCacheJob to BustReactableCacheWorker and move to sidekiq (#5582) [deploy] 2020-02-12 11:50:40 -05:00
Josh Puetz
38622317b7
Consolidate server side main article feed logic (#5953) [deploy]
* Consolidate `.decorate` calls

* Move Activerecord finders out of main stories feed partial

* Add back in decorates to sticky_articles partial

* Combine top and new articles returned from StoriesController

* Extract feed construction logic to a service

* Some PR tweaks (naming)

* Quick test fix
2020-02-12 08:43:20 -06:00
Molly Struve
a39c6a03b0
Remove extra period if name ends with it (#6029) [deploy] 2020-02-11 17:57:02 -05:00
Andy Zhao
0f9b52f800
Use post instead of get for CSRF (#6026) 2020-02-11 17:56:11 -05:00
Maykon Menezes
cefa95b92d
fix response when article can't be found (#5999) 2020-02-11 15:23:44 -05:00
Michael Kohl
050a2e2726
Implement Mailchimp unsubscribe webhook (#5804) [deploy] 2020-02-11 14:25:48 -05:00
Nick Taylor
0119918237
Homepage left side bar tags followed (#5918) [deploy]
* SASS formatting in action.

* Unnested .sidebar-nav-element in SASS

* Created the <TagsFollowed /> component.

* Mini refactor.

* Left side bar uses <TagsFollowed /> component now.

* Accomodating InstantClick

* Small refactor and added some comments.

* The homepage webpacker pack only needs to be loaded once.

* Added tests for the <TagsFollowed /> component.

* Modified the receive InstantClick callback as per their docs.

* Reverted the data-no-instant on he homepage bundle. It seems to cause issues in certain scenarios.

* Just some tweaks to <TagsFollowed /> component.

* Removed CSS for general img tag in context of sidebar as it does not appear to be used.

* Fixed copy paste error from JSX to HTML.

* Fixed <img /> styles for arbitrary sponsorship widget.

* Fixed a regression that a Capybara test caught.

* Fixed user followed tags on home page tests.

* Fixed logic for loading user data on homepage.
2020-02-11 12:09:23 -05:00
Molly Struve
3fed9338d2
Index Tags to Elasticsearch after they are created (#5958) [deploy]
* Index tags to Elasticsearch after they are created
* add rules_html to Tag index since we show it in search drop down
* change get method to find_document to make it more explicit
2020-02-11 11:58:58 -05:00
Vaidehi Joshi
c33d6936b5
Do not allow staff_user_id to be mutated (#6009) [deploy]
Allowing ids to be mutated by admins from the /internal/config pages is dangerous.
This could cause issues if an admin tries to update the SiteConfig.staff_user_id to an id that is another user's id, or to an id that isn't valid.
2020-02-10 16:35:18 -08:00
Alex
78a25dfd54
Validate that API article params are a Hash (#5963)
* Add check for article param being a Hash & spec

* Remove unnecessary blank line

* Move logic to private method and before_action call

* Change check_if to validate

* Use is_a? to type check

* Fix type check for specs
2020-02-10 10:24:11 -05:00
rhymes
c41d66e900
Replace ban/banned with suspend/suspended in user facing text (#5816) [deploy] 2020-02-10 10:12:53 -05:00
Molly Struve
4691ae1e34
Log in Datadog When Sidekiq Worker Fails for Final Time (#5942) [deploy] 2020-02-10 08:56:41 -05:00
Alex
c98190742b
Remove Users::EstimateDefaultLanguageJob & spec (#5956) [deploy] 2020-02-07 12:40:12 -08:00
Mohamed ABDELLANI
faad0b83e6
Handle Reactions Without Users When Sending Notifications (#5820)
* Add reaction's owner existence in the database

* Add test
2020-02-07 14:10:52 -05:00
Maykon Menezes
58b96f104e
create Users::EstimateDefaultLanguageWorker for Sidekiq (#5697) [deploy] 2020-02-07 13:49:02 -05:00
rhymes
69b04d38aa
Refactor API Reactions controller and add specs (#5936)
* Add specs

* Check the object, not the ID

* Use permitted params and delete cache only after create

* Inherit from ApiController, bail if the reaction user does not exist, fix naming

* Remove superflous test
2020-02-07 12:39:24 -05:00
Vaidehi Joshi
c7a1bd9449
Fix logging for dev and test environments (#5922)
* Fix logging for dev and test environments

We had some unused code for Timber in our config files for development and test.
However, this was completely clobbering Rails' default behavior of logging out to log/development.log and log/test.log. We should allow for logging in these environments in particular, and since we're not using Timber there, we can just revert to using the Rails default debugging log levels.

* Add Timber logger to specs that explicitly require it

* Restore default Rails.logger in specs using Timber logger

* Explicitly use Rails.logger in OmniauthCallbacksController

We seem to have different logger classes leaking into this controller in tests.
I'm not entirely sure why this is/haven't been able to investigate yet, but I do think we should be using the Rails.logger explicitly until we can figure that out.
2020-02-07 10:15:08 -05:00
Molly Struve
bbeb3fc79d
Ensure user is authenticated before doing onboarding Actions (#5937)
* ensure user is authenticated before doing onboarding checks

* add specs for authenticating users for onboarding updates
2020-02-07 09:56:29 -05:00
Sebastien
665f5aac0f
Refactor ProfileImage (#5803) 2020-02-07 08:56:16 -05:00
rhymes
c6e9fd9844
Properly rename Podcasts::BustCacheWorker spec (#5864) 2020-02-06 16:53:03 -05:00
Ben Halpern
f3c86c6377
Add mod channel automation to tags (#5731) [deploy]
* Add mod channel automation to tags

* Change mod_relations to mod_relations_admin

* Run migration properly

* Make queries consistent and fix test
2020-02-06 16:27:12 -05:00
Maykon Menezes
01dc81afa9
Move Podcasts::GetEpisodesJob to Sidekiq (#5443) [deploy]
* Refactored Podcast::GetEpisodesJob to sidekiq

* fixing specs

* removing env keys

* Change arguments to Hash

* Update specs and add spec for queue

* Update references for Hash argument

* Add comment to explain parameters of #perform

Co-authored-by: Alex <alexandersmith223@gmail.com>
2020-02-06 09:42:55 -08:00
Molly Struve
00fefe5865
Add Code To Setup the Elasticsearch Tag Index (#5919) [deploy] 2020-02-06 11:46:11 -05:00
rhymes
92f6a9f007
Fix serialization error with video_thumbnail_url (#5933) 2020-02-06 10:50:44 -05:00
rhymes
fd5643bc9d
Improve API controllers efficiency by selecting only columns needed for serialization (#5805) [deploy] 2020-02-06 07:36:56 -05:00
rhymes
71e1c8d3e6
Upgrade gemoji to support disability emojis (#5842) 2020-02-05 17:32:56 -05:00
Michael Kohl
52759c9427
Allow deleting comments if article has already been deleted (#5889) [deploy] 2020-02-05 17:10:19 -05:00
Alex
662d62fe72
Remove Notifications::TagAdjustmentNotificationJob (#5915) [deploy] 2020-02-05 13:33:20 -08:00
Alex
2f4ee09736
Remove UpdateMainImageBackgroundHexJob & spec (#5911) 2020-02-05 13:32:58 -08:00
Alex
8a46f4c701
Remove HtmlVariantTrialCreateJob & spec (#5910) 2020-02-05 13:32:45 -08:00
Alex
6a100415cc
Move Notifications::TagAdjustmentNotificationJob to Sidekiq (#5909) [deploy]
* Create TagAdjustmentNotificationWorker

* Create TagAdjustmentNotificationWorker spec

* Update references and specs for new worker

* Future proof specs
2020-02-05 09:52:21 -08:00
Maja Komel
28440d1fa1
Return NotFound error if ChatChannelMembership is not found (#5806) 2020-02-05 12:24:40 -05:00
Michael Kohl
7270d5ab4c
Move user deletion by moderator to worker (#5887) [deploy] 2020-02-05 08:27:07 -05:00
codekatas
bae7ee8b73
Migrate update main image background job to sidekiq (#5345) [deploy]
* Add new UpdateMainImageBackgroundHexWorker worker class

This is a port of app/jobs/update_main_image_background_job.rb
that works with Sidekiq instead of DelayedJob.

* Update all references to UpdateMainImageBackgroundHexJob

This updates all references to UpdateMainImageBackgroundHexJob
so they now call UpdateMainImageBackgroundHexWorker, which works
with Sidekiq instead of DelayedJob.

* Move method call to after_commit callback

* Fix article specs with sidekiq helpers

Co-authored-by: Alex <alexandersmith223@gmail.com>
2020-02-04 17:51:09 -08:00
Alex
8261ab74d7
Remove Notifications::ModerationNotificationJob (#5905) [deploy] 2020-02-04 17:03:08 -08:00
Alex
8578c78158
Remove Notifications::UpdateJob and spec (#5903) 2020-02-04 17:02:47 -08:00
Alex
15b4565ac8
Remove Articles::ScoreCalcJob and spec (#5898) 2020-02-04 17:01:59 -08:00
Alex
aa7bc6b7b2
Remove Tags::BustCacheJob and spec (#5897) 2020-02-04 17:01:06 -08:00
Vaidehi Joshi
e84dec1db6
Allow broadcasts to be created from internal/broadcast (#5908) [deploy]
Also raise errors when necessary in all broadcast endpoints.
Clean up tests and add specs for POST /internal/broadcast
2020-02-04 15:57:17 -08:00
Michael Kohl
a26ea73771
Remove direct chat channels when banishing user (#5784) [deploy]
* Remove direct chat channels when banishing user

* Also remove article's buffer updates

* Incorporate PR feedback and make deletion safer
2020-02-04 17:10:39 -05:00
Alex
67894aa1f8
Move Articles::DetectHumanLanguage from background job to inline (#5888) [deploy]
* Move DetectHumanLanguage inline

* Remove old DetectHumanLanguage job and spec

* Fix copy/pasta mixup...oopsie!

* Update article_spec for inline LanguageDetector
2020-02-04 10:45:42 -08:00
Alex
de3ee9ebec
Move HtmlVariantSuccessesCreate from job to inline (#5879) [deploy] 2020-02-04 10:24:39 -08:00
Alex
8168a5e8f5
Move Articles::ScoreCalcJob to Sidekiq (#5875) [deploy]
* Create Articles::ScoreCalcWorker

* Create Articles::ScoreCalcWorker spec

* Update references to the new ScoreCalcWorker

* Refactoring conditional callbacks and biz logic

- Move update_columns to a model method
- Move conditions on callback to guard clause in callback method
- Make article_destroy_spec more explicit
2020-02-04 10:01:46 -08:00
Alex
0c42ea2b43
Move Tags::BustCacheJob to Sidekiq (#5870) [deploy]
* Create Tags::BustCacheWorker

* Create Tags::BustCacheWorker spec

* Update references to new worker
2020-02-04 09:24:37 -08:00
Vaidehi Joshi
267e08f6f0
Improve dropdown UX for internal/badges (#5880) [deploy]
* Improve dropdown UX for internal/badges

Add a "blank" option to the dropdown to list of badges on internal/badges route.
Also add some checks to handle if an admin accidentally tries to award a "blank" badge.

* Ensure error is surfaced as flash message
2020-02-04 09:02:14 -08:00
Molly Struve
2207f795b1
Hookup Elasticsearch in travis (#5871) 2020-02-04 08:20:14 -05:00
Alex
e579914b1a
Remove BadgeAchievements::SendEmailNotificationJob (#5869) [deploy] 2020-02-03 11:10:47 -08:00
Alex
59437f518f
Remove old SubscribeToMailchimpNewsletterJob & spec (#5868) 2020-02-03 10:35:10 -08:00
Alex
c0ebb38560
Remove old ResaveArticlesJob and spec (#5867) 2020-02-03 10:34:47 -08:00
Fran Zekan
cba4e99525
Return a 404 response If @event is Not Found (#5798) [deploy] 2020-02-03 11:30:52 -05:00