Commit graph

732 commits

Author SHA1 Message Date
Alex
97ee0a804f
Move HtmlVariantTrial#create inline (#5901) [deploy] 2020-02-04 17:29:46 -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
Alex
de3ee9ebec
Move HtmlVariantSuccessesCreate from job to inline (#5879) [deploy] 2020-02-04 10:24:39 -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
rhymes
42b33f29ae
Add signin=true as a param correctly if the URL already has params (#5866) [deploy] 2020-02-04 09:41:10 -05:00
Fran Zekan
cba4e99525
Return a 404 response If @event is Not Found (#5798) [deploy] 2020-02-03 11:30:52 -05:00
Molly Struve
a5dd0c6abb
track stripe errors in Datadog so we can alert on them (#5797) 2020-02-03 09:11:38 -05:00
Ben Halpern
82f2281b1c
Create dynamic robots.txt page (#5794) [deploy]
* Create dynamic robots.txt page

* Add tests and remove cachebust
2020-01-28 16:49:34 -05:00
Michael Kohl
96ac213614 Add comment explaing catch + reraise (#5782) 2020-01-28 08:36:40 -05:00
rhymes
5444c53df2 Improve API podcast episodes controller caching and fetching (#5772) [deploy]
* Refactor caching and add some tests

* Only select needed columns

* Add more tests
2020-01-27 16:57:37 -05:00
rhymes
397ef313de Improve video controllers caching and retrieving (#5709) [deploy]
* Add tests and improve pagination and caching

* Add two more specs

* Add .with_video scope

* Get rid of N+1

* Only select needed columns

* Improve efficiency of the video page as well

* Add missing set_cache_control_headers to API videos#index
2020-01-27 15:51:12 -05:00
Sun-Li Beatteay
385a831d8f comment_controller: add skip_auth to rescue error block (#5728) 2020-01-27 14:35:53 -05:00
Maykon Menezes
7ad7320add Worker/user self delete (#5698)
* Moving user self delete job to sidekiq

* Refactor/user self delete worker
2020-01-27 08:45:58 -05:00
Alex
62f3e31698
Move RssReaderFetchUserJob to Sidekiq (#5685) [deploy]
* Create RssReaderFetchUserWorker

* Create RssReaderFetchUserWorker spec

* Update reference to RssReaderFetchUserWorker

* Update spec for clarity

- Update fake user_id to 9999
- Update return for user.feed_url

* Add feed_url check before calling worker

* Update random user_id for queue test

* Update fake user_id argument in spec
2020-01-24 14:14:20 -08:00
rhymes
6ec91b0861 API tags: improve caching and purging (#5673) [deploy]
* Add pagination to /tags and proper caching to /tags and /tags/onboarding

* Correctly purge tags

* Fix broken specs

* Make Travis happy
2020-01-24 13:55:22 -05:00
Alex
4a7ecb2574
Move ExportContentJob to Sidekiq (#5688) [deploy]
* Create ExportContentWorker

* Create ExportContentWorker spec

* Update references to ExportContentWorker

* Fix UserSettings spec for sending email
2020-01-24 10:12:58 -08:00
Maja Komel
3412af977f Don't raise StandardError for invalid liquid tags when updating comment (#5694)
* Don't raise StandardError for invalid liquid tags when updating comment

* remove text-align styling for alert error
2020-01-24 11:26:55 -05:00
Spencer
49474d516e Allow comments from deleted articles to be viewed (#5199) [deploy] 2020-01-24 11:06:52 -05:00
rhymes
6c24357f16 Use edge caching for API Article show endpoint (#5669) [deploy] 2020-01-23 20:12:58 -05:00
Sarthak Sharma
75608e3e55 Feature🚀: Ability to mention anyone in open chats and notify them (#5460) [deploy]
* 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

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Delete schema.rb

* Schema file updated

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀: Ability to navigate through user list with keyboard only

* Bug Fix 🐞: Changing color of group avatars in dark themes

* Bug Fix 🐞: Setup pusher channel for open channels also
2020-01-23 18:06:35 -05:00
Mac Siri
5f020860af Allow for proper deselect of email_newsletter (#5675) 2020-01-23 16:59:17 -05:00
Sun-Li Beatteay
5bebf628df Update ReadingListItemsController#update to return NotAuthorized (#5658)
* change ReadingListItemsController#update to return NotAuthorized if user_id does not match

* fix spec description

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-01-23 13:22:48 -05:00
rhymes
87167de8c5 Use correct cache keys on the articles API index endpoint (#5606) [deploy]
Surrogate keys are about setting expectations on cache purging.

Presently we use a combination of all parameters to set changing surrogate keys depending on the result of the `ArticleApiIndexService`. This approach has two limitations:

- if two set of params lead to the same exact set of articles, we still create two different caches

- deleted articles will remain for 24 hours in the cache because the cache key doesn't take the record keys into account

By simply using record keys we make sure that different params leading to the same result set will share the same cache and that deleted keys won't appear anymore in the cache.
2020-01-23 08:40:19 -05:00
Michael Kohl
d82bbb874e Add rate limits to admin interface (#5642) 2020-01-22 15:29:27 -05:00
Nadiya Karachevska
e49b0e81e5 Return 404 NotFound error if ClassifiedListing is not found during delete (#5646) 2020-01-22 13:07:44 -05:00
Michael Kohl
5b35370db8 Introduce BanishedUser table (#5589) [deploy] 2020-01-21 17:15:58 -05:00
Ben Halpern
ba6c70c2d2 [deploy] Raise not_found for spam-banished users (#5586)
* Raise not_found for banished users

* Move banished logic to decorator
2020-01-20 14:50:22 -05:00
Lucas Hiago
fb5cb7005c Change CreateJob to CreateWorker and move to sidekiq (#5559)
* Create new CreateWorker

* Create new spec for CreateWorker

* Change CreateJob to CreateWorker and move to sidekiq

* Update worker

* Update priority of Reactions Create Worker

* Remove leading spaces from spec
2020-01-20 11:29:13 -05:00
Jacob Herrington
07bd2e90b5 Add eager loading based on Bullet (#5552) [deploy] 2020-01-18 19:07:41 -05:00
rhymes
1bc0469b2d Add article's record key to Fastly Surrogate-Key to separate caches (#5543)
* Add article's record key to Fastly Surrogate-Key to separate caches

After #4744 we successfully setup an auto purging system based on Fastly's surrogate key based cache and purging API.
Unfortunately this worked only in the `:show` action as comments are their own tree-based resource.
The `:index` though, is related to a single article, so without the article's record key in the `Surrogate-Key` header the first time we hit the API the result would become the value stored in Fastly's API, for all articles.

* Fix commentable mock for job spec

* Add comment.commentable.purge to the worker as well

* Add more thorough tests for commentable
2020-01-17 08:45:47 -05:00
Jacob Herrington
8db4808d2e Internal Reports: Searching and sorting with Ransack (#5447) [deploy]
* Add gem Ransack 2.3.0

* Add sorting and search to internal/reports

The UI here should probably be revisited sooner or later, I feel like
the vomit reactions might even need to be moved to their own view.

* Add system spec for internal reports search

* Remove filter for report_type
2020-01-16 15:02:09 -05:00
rhymes
bcd85452e9 Comments API: fix caching issues (#4744) [deploy]
* Use ancestry in the index and add test

* Add tests for show action

* Return complete comments trees for index, kill n+1 and use correct edge cache key

* Return complete comments tree for show, kill n+1 and use correct edge cache key

* Refactor tests and add surrogate keys tests

* Preload users for the whole subtree

* Clarify explanation of the edge cache keys construction

* Refactor partials

* Remove action caching

* Replace .map.flatten with .flat_map

* Fix surrogate key prefix according to Fastly docs

* Add comment.purge to Comments::BustCacheJob to use Fastly-Rails

* Fix surrogate key spec
2020-01-15 10:45:56 -05:00
rhymes
ff7532b3db Handle liquid tag errors in comments form (#5485) [deploy]
* Handle liquid tag errors in comments form
* Do not hide Pundit::NotAuthorizedError errors
2020-01-14 14:10:05 -05:00
Ben Halpern
c0a7c17054
Modify podcast design details and functionality (#5472) [deploy]
* Modify podcast design details and functionality

* Adjust play button size

* Add heroku slug commit to some cache keys
2020-01-14 13:56:47 -05:00
Michael Kohl
dba7e6ca60 Move Twitch webhook registration from ActiveJob to Sidekiq (#5414) 2020-01-14 11:55:35 -05:00
Michael Kohl
92b5f113be Return 429 Too Many Requests instead of raising (#5504) 2020-01-14 11:53:33 -05:00
Lucas Hiago
1ed6aca54a Change Webhook::DestroyJob to Wehook::DestroyWorker and move to sidekiq (#5424) [deploy] 2020-01-13 12:38:10 -06:00
Anna Buianova
851508f628 Fix a bug when user tries to delete an account while not having an email (#5486)
* Ask user to add email when deleting [WIP]

* Ask to provide an email before requesting account deletion

* Additional checks to make sure that user won't be deleted w/o an email

* Revert changes on confirm destroy view
2020-01-13 08:34:37 -05:00
Ben Halpern
f78b89e763
Add suggested tags to SiteConfig (#5426) [deploy]
* Initial base work

* Add suggested tags config

* Downcase suggested tag input
2020-01-10 12:33:37 -05:00
Lucas Hiago
9ddc02cd14 Remove password verification (#5304) 2020-01-10 10:45:18 -05:00
Alain Mauri
c013079359 Move Classified Listing Cache Buster to Sidekiq (#5408) [deploy]
* Created the worker to bust cache for classified listings
* Created the related tests
* Removed the old job
2020-01-09 17:23:23 -05:00
Nick Schwaderer
74da1ffc59 No longer hide reactions and follows after 24 hours (#5314)
* No longer hide reactions and follows after 24 hours
* Removes unused scope without_past_aggregations

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-01-09 11:49:55 -05:00
rhymes
7dd2ae9fe0 Remove notifiable access from articles and comments notifications (#5415) [deploy]
* Add created_at to comment notification data

* Remove notifiable usage from notifications partials

* Fix typo
2020-01-09 10:19:45 -05:00
rhymes
d2e96007c7 Fix (some) n+1/eager loading issues (#5294) [deploy]
* Remove mock from specs to test the actual Suggester

* Fix articles API top articles n+1

* Fix n+1 in articles API with state parameter

* Remove eager loading for organization dashboard

* Eager load notifiables in notifications only when needed

* Algolia does not like this
2020-01-08 18:48:24 -05:00
Anna Buianova
e09e46ec99 Creating podcasts by users (#3730) [deploy]
* Create podcast as a user [WIP]

* Sample css for podcast form

* Nicer podcasts suggesting form

* Validate podcast feed_url

* Validate podcast main_color_hex

* Fix podcasts specs

* Fix form appearance

* Placeholder for podcast main_color_hex

* Provide a link to suggest a podcast

* Add a checkbox and a role for when a podcast is added by an owner

* Prettier checkbox in the podcasts form

* Added creator to podcasts

* Set the podcast creator

* Fix the /pod spec

* Added creator information to the internal podcast page

* Added cta class to the podcasts submit button

* Global notice when a podcast was suggested

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-01-08 16:14:25 -05:00
Cadu Ribeiro
00a97b2051 Migrate Users/FollowJob to Sidekiq (#5403) 2020-01-08 15:03:18 -05:00
Michael Kohl
728a05c476 Move from env variables to SiteConfig (#5385) [deploy]
* Move from env variables to SiteConfig

Related to #5384

This PR only deals with the first remaining part outlined in the issue, starting to use existing SiteConfig keys instead of the env variables.

* Restore Envfile to original version for now
2020-01-07 16:36:24 -05:00
Molly Struve
d5b3a10061 Handle Missing article_id When Loading additional_content_boxes (#5376) 2020-01-06 15:56:49 -05:00
Molly Struve
1966c449ed
scope error message correctly for InvalidAuthenticityToken error (#5375) [deploy] 2020-01-06 11:45:28 -05:00
Jacob Herrington
9652ecc456 Refactor/internal ui update (#5339) [deploy]
* Move internal styles out of layout

* Upgrade to Bootstrap 4.4 and redo nav

* Redesign /internal/users/index

* Refactor /internal/tags/show

* Refactor /internal/broadcasts/index

* Refactor /internal/broadcasts/index

* Refactor /internal/pages/index

* Refactor /internal/mods/index

* Fix internal nav highlighting

* Refactor internal/organizations/index

* Refactor internal/growth

* Refactor internal/badges

* Refactor /internal/podcasts/

* Refactor internal listings filter

* Refactor /internal/endpoints/

* Refactor /internal/tools/

* Refactor /internal/chat_channels/

* Refactor /internal/config/

* Refactor /internal/feedback_messages

This is the one that worries me the most. I made a strong effort not to
touch any IDs and the JavaScript appears to be working after manual
testing.

This view probably needs some systems specs covering it.

* Remove unused CSS

* Refactor feedback_messages/show

* Refactor internal/comments

* Refactor internal/podcasts/edit

* Refactor internal/users/show

* Refactor internal/users/edit

* Refactor internal/organizations/show

* Refactor internal/permissions

* Refactor internal/tags/show

* Refactor internal/pages/form

* Add events to navbar

* Refactor internal/events

* Refactor internal/brodcasts

* Refactor internal/articles

* Refactor internal/listings

* Remove unused CSS

* Load jquery earlier
2020-01-06 07:58:03 -05:00