Commit graph

547 commits

Author SHA1 Message Date
rhymes
09e5ad5c0c Remove PushNotificationSubscription (#5258) [deploy] 2019-12-27 13:45:38 -06:00
rhymes
d015fb7c85 Remove search keywords (#5259) [deploy] 2019-12-27 12:40:20 -05:00
Molly Struve
1ac9a2d7bd
add index to created_at for notifications (#5251) [deploy] 2019-12-27 08:57:40 -06:00
Ben Halpern
03c2404b13
Redo /mod for performance and usability (#5230) [deploy] 2019-12-23 18:10:25 -05:00
Sarthak Sharma
b602b7b91f 🚀Feature/ability to edit messages (#5139) [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

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Test Cases📝 : Test Cases for edit message added

* 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

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Bug Fix 🐞: Added space between edited and timestamp

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2019-12-20 10:19:00 -05:00
Keith Bennett
70e1ffbbc3 Fix rubocop Rails.root.path complaints (#5114) 2019-12-16 12:13:15 -05:00
Jacob Herrington
6877534cce Add abuse report seed data (#5113) 2019-12-16 08:09:52 -05:00
Andy Zhao
71157c993e Hide comment feature (#4944)
* Add MVP of hide comment feature

* Slight copy adjustments

* Remove unused file oops

* Fix strange styling issues

* Add hide/unhide comment specs

* Authenticate user for hide/unhide

* Add tests for hide/unhide functionality

* Remove opacity CSS for hidden comments

* Fix hidden comment explanation logic

* Fix some styling issues

* Fix hiding top level comment logic

* Show only hidden comments in permalink and not thread

* Hide subtree properly if hidden comment

* Fix weird CSS issue

* Properly hide comments for permalink view

* Show children comments in permalink view

* Add tests for comment hiding visibility

* Remove superfluous code and adjust copy

* Remove some more logical duplication

* Add dedicated article column for any comments hidden

* Add reload in test
2019-12-10 15:09:47 -05:00
rhymes
62edf443f3 Add FKs to notifications_subscriptions, page_views and users_roles (#4999) [deploy] 2019-12-04 10:14:57 -06:00
rhymes
e62f5ada21 Add missing fks to api_secrets, listings and identities (#4997) [deploy] 2019-12-03 10:59:13 -06:00
rhymes
1c0a9f8198 Add missing foreign keys to tag_adjustments (#4994) [deploy] 2019-12-03 09:48:43 -06:00
leewynne
5b50d52b5f Replaced hard coded AWS region in carrierwave.rb and sitemaps.rb. Updated legacy migration files to include pre rails 5 version (this resolved new instances on Heroku) (#4874) [deploy]
* missing rails version 4.2 added to pre 5 migrations

* updated carrierwave.rb and sitemap.rb with AWS_DEFAULT_REGION
2019-11-22 09:07:59 -05:00
rhymes
bb28f301e9 Add site config and remove sail (#4729)
* Add SiteConfig model based on rails-settings-cached

* Remove sail
2019-11-08 13:27:44 -05:00
Ben Halpern
2f53034635
Add disable_ddl_transaction to user created_at migration (#4736) [deploy] 2019-11-06 17:01:44 -05:00
Omar Bahareth
dca66bd6a8 Rate limit daily user follows to 500 (#4647) [deploy]
* Rate limit daily user follows to 500 per day
Return an error in `POST /follows` JSON response when a user tries to follow more than 500 accounts in a single day.

Other Changes:
- Add a spec for follows#create.

* Turn daily account follow limit into an env var

* Avoid executing today follow count query when possible
user.following_users_count is a counter cache on how many users the person is already following, so if it's less than the limit we don't need to run the query and can just return it instead.

* Simplify today follow count query
Stop needlessly checking into the future, only check from the beginning of the day until now.

* Raise account follow limit error if followable_id count is over limit
Other changes:
- Always return JSON, the `respond_to` block from before was unnecessary since this endpoint always returns JSON.
- Rescue `DailyFollowAccountLimitReached` on the method and remove begin block, since the error can be raised from two places in the same method.

* Index created_at on users table

* Make adding created_at index on users table happen concurrently

* Rename DAILY_ACCOUNT_FOLLOW_LIMIT to RATE_LIMIT_FOLLOW_COUNT_DAILY

* Add RATE_LIMIT_FOLLOW_COUNT_DAILY to Envfile

* Move RATE_LIMIT_FOLLOW_COUNT_DAILY from env var to ApplicationConfig
2019-11-06 16:24:43 -05:00
Molly Struve
bb55efb775 Add index to feed source url column on articles (#4595) 2019-10-28 16:32:19 -04:00
Molly Struve
da45790e2e Add guard clause to migration to check for index before attempting to add or remove it (#4644) 2019-10-28 15:27:31 -04:00
Molly Struve
0b47ff67bc Add index for old_username and old_old_usernames (#4593) 2019-10-25 15:51:28 -04:00
Ben Halpern
4ea7b03727
Add new font and theme config, plus new navbar config option (#4462)
* Initial changes for some new themes/fonts/etc.

* Add basic navbar config

* Finalize navbar config

* Make config_navbar non nullable

* Add dark_theme? to user decorator
2019-10-24 08:38:46 -04:00
Andy Zhao
73caa9a864 New Feature: Block Users (#4411)
* Prevent need for eager loading

* Add initial implementation of user block

* Remove debugger oops

* Add index and foreign keys for user_block table

* Use private method instead of exists

* Move channel handling logic to service object

* Update styling a bit

* Use profileDropdown file for future proofing

* Remove commented out code

* Render json: { result } for all endpoints

* Add statuses for sad paths

* Add better sad path handling in the JS

* Remove accidentally committed spec file

* Don't wait for DOM to load block button

* Use equality for accuracy in slug query

* Add status code for unauthorized requests

* Add missing comma sigh
2019-10-23 17:14:28 -04:00
Branko Arnaudovski
efbb108061 Implement Moderators audit logs (#3449) 2019-10-23 10:30:45 -04:00
rhymes
c8abbe9d60 Pro: memberships (#3461)
* Add ProMembership model

* Implement ProMembershipsController#create

* Implement basic ProMembershipsController#show

* Add ProMembership to ledger

* Populate user history after pro subscription is created

* Add fields for expiration notifications

* Add ProMemberships::ExpirationNotifier to notify users of expiring memberships

* Add tasks for recurring jobs to notify users of expiration

* Add auto_recharge column to ProMembership

* Add ProMemberships::Biller (incomplete)

* Fix specs

* Add ProMembership to Administrate

* Fix spec

* Add has_enough_credits? to User and Organization

* Add Payments::Customer class

* Finish ProMembership::Biller functionality

* Fix ProMemberships::Creator check for credits

* Disable destroy actions for ProMembershipsController

* Correctly authenticate ProMembershipsController actions

* Make sure only pro user's history can be indexed

* Add ProMembershipsController#update action for auto recharge

* Use regular AR to save new credits and add touch to the purchaser

* Clarify Pro membership create policy

* Display information about an existing pro membership

* Add UI to show page

* Add system test for Pro membership creation

* Implement edit membership

* Make sure users with pro memberships can access history and dashboard pro

* Fix padding issue

* Show a different text for a user that has credits but not enough for Pro

* Move Pro Membership functionality inside settings

* Update Pro Membership link in email notifications

* Bust all relevant caches

* Add the Pro checkmark around the website

* Use Users::ResaveArticlesJob instead of delay

* Add/remove user from pro-members chat channel

* Use the appropriate Pro checkmark

* Remove unfinished pro elements

* Remove checkmark JS
2019-09-24 10:38:54 -07:00
Anna Buianova
0a16bf934a Added association between webhook_endpoints and oauth apps (#4060)
* Added association between webhook_endpoints and oauth apps

* Limit webhooks access by oauth_app_id when authorized by doorkeeper

* Use rails route helpers in webhooks api test
2019-09-18 13:25:40 -07:00
rhymes
a87fbe6ebf Add index to notifications.notified_at (#3999) 2019-09-12 13:11:31 -07:00
Mario See
ecc22cf129 Update seed file to clear listing indexes (#3878) [ci skip] 2019-08-29 18:04:23 -04:00
Anna Buianova
bfdf636dcf Implement webhook & API endpoints #3715 (#3783) 2019-08-29 10:23:41 -04:00
Ben Halpern
208bbb3757
Improve mod roundrobin notification and internal tooling (#3855)
* Improve mod roundrobin notification and internal tooling

* Fix tests
2019-08-27 21:54:09 -04:00
Mario See
47c2885810 Listings set custom expiry date (#3770)
* add expire_on column to classified_listings

* add expire_on to valid listing params

* add expire_on to model

* add expire date to new listing form

* add field in edit form

* add expiry dates to dashboard

* update expiry date in listing toolkit

* WIP unpublish job and test

test still has to run properly

* add job to class name

* change job to rake task

* revert snap change

* delete migration file

will add new one and revert schema changes to rename column

* reset schema

* add new migration to schema 'expires_at'

* change expire_on to expires_at
2019-08-23 17:33:50 -04:00
Ben Halpern
40559a0457
Add random variants to onboarding for a/b testing (#3742)
* Add random variants to onboarding for a/b testing

* revert listings dashboard snapshot
2019-08-18 18:30:22 -04:00
rhymes
ac7ef66726 Update Faker to 2.1.0 (#3652)
* Upgrade Faker to 2.1.0

* Transition Faker calls to the new API
2019-08-07 15:59:23 -04:00
Anna Buianova
fabaeb5461 Introduced published field to podcasts (#3593)
* Published field for podcasts

* Add podcasts migration

* More specs for podcasts availability

* Show published in podcasts internal

* Update schema.rb with db:migrate
2019-08-01 09:29:13 -04:00
Andy Zhao
96449fcc8f Add organization membership functionality to internal (#3541) 2019-07-31 14:38:36 -04:00
Ben Halpern
5d380f93cb
Track success of DEV Shop ads (#3589)
* Add basic display ad event tracking

* Finalize client-side eventlistening functionality
2019-07-31 13:44:47 -04:00
Mac Siri
3071ac8c76 Implement Doorkeeper gem (#3504)
* Add doorkeeper gem

* Generate files with Doorkeeper's generator

* Create Doorkeeper tables

* Add new associations to User

* Update associations

* Remove confusing schemas

* Change oauth2_provider name
2019-07-31 10:30:58 -04:00
rhymes
5cfa8b5586 Remove columns that don't existing from schema.rb (#3586) [ci skip] 2019-07-30 17:29:38 -04:00
rhymes
8f5706fcc1 Remove all old membership code, see 97040ab6 (#3575) 2019-07-30 12:33:50 -04:00
Anna Buianova
b9f0b282ca Add index to ahoy_messages to (#2367)
* Add index to ahoy_messages to

* Add ahoy_messages index concurrently
2019-07-30 11:53:52 -04:00
Ali Spittel
52c60ce37e Feature/refactored onboarding (#3333)
* set up refactored onboarding

* create onboarding page

* add in first slide and change slide functionality

* fix test suite

* profile refactor

* profile refactor

* refactor to api

* add checkbox fields

* add checkbox fields

* remove puts

* add basic css

* add styling

* add redirect

* hide back and next at first and last slides

* test refactored onboarding

* test refactored onboarding

* remove article edits

* Fix schema

* Add deleted file back in

* Add default value for checked_t&c column

* Adjust HTML structure to keep nav buttons in place

* Fix ESLint issues on Onboarding.jsx file

* Handling for undefined or empty followedTags on getUserTags

* Fix codeclimate issues

* Fix codeclimate issues

* Fix more codeclimate issues

* Fix more codeclimate issues

* Update Onboarding snapshots

* Uncheck the CoC and T&C checkboxes on render

* Update snapshots

* Return false instead of raising error

* Update spec to use new onboarding

* Redirect to onboarding if haven't seen it yet

* Prevent redirect to onboarding from /signout_confirm

* Use assign_attributes instead of saving twice

* Move COC and T&C checkbox page to second slide

* Add 'go back to original page' functionality

* Reuse ready prototype logic

* Keep track of the last visited onboarding page

* Fix email subscription bug

* Fix overflow issue for tags page

* Remove height to prevent page container scrolling

* Check for CoC and T&C for displaying onboarding

* Add InstantClick redirect and preserve referrer in client

* Fix async update + check by using localStorage

* Turn off onboarding for tests

* Finalize design for onboarding

* Finalize design for onboarding

* Make bulk follows during onboarding

* Fix bulk follow test
2019-07-26 15:53:32 -04:00
Anna Buianova
7c1917f5f7 Don't hide podcasts if they have reachable episodes (#3532)
* Don't hide podcasts if they have reachable episodes
Recheck episodes' reachability after the podcast status is set to
unreachable

* Update db/schema.rb

* Fix GetEpisodesJob specs

* Fix stories spec

* Episodes are reachable even if the podcast is unreachable

* Improve the Podcast.reachable query

* Fix podcasts root page spec

* Add index concurrently
2019-07-26 11:33:31 -04:00
Anna Buianova
567579daf3 Podcast episodes statuses #2952 (#3386) 2019-07-12 10:03:57 -04:00
rhymes
611f4b8675 Sponsorship: remove old columns (step 3) (#3446)
* Remove old sponsorship columns

* Rename redundant param names
2019-07-11 15:35:24 -04:00
rhymes
ad79116366 Sponsorship: add model (step 1) (#3438)
* Add Sponsorship model

* Add Sponsorship to admin

* Add correct relationships between models

* Add temporary script to migrate sponsorship data
2019-07-10 15:58:37 -04:00
Mario See
11be56f38c Add location to listings (#3370)
* add location to classified_listings

create rails migration and ran rake db:migrate

* add faker city to seed

* add location to index json

* add location as searchable attribute in algolia

* add form text field for adding location to new listing

* add location to dashboard json

* add location field for editing listings

* add location to listing_params in controller

* add location to single listing view

* add location to listing row in dashboard

* add location to dashboard test

* adjust listing dashboard row spacing

* reduce character limit

* reduce lines of conditional html elements

* compress listing card const

* fix form call for location in edit page

* update snapshot in dashboard

* add location length validation in listing model

* shorten limit and update location in edit page
2019-07-10 12:45:41 -04:00
Mac Siri
28e5ef1d12 Make RSS's self-referential link an option (#3428)
* Create migration

* Run migration

* Update validations

* Add additional form

* Update RssReader::Assembler#thorough_parsing

* Add spec for referential
2019-07-09 17:34:21 -04:00
rhymes
1f97669e66 Credits ledger (#3395)
* Add #purchase to Credit

* Assigns spent credits to the listing

* Add Credits::Ledger and use it

* Localize ledger datetimes

* Add organization to the ledger

* Add tests for ledger

* Remove unused class

* Fix scope error

* Compare UTC times

* Fix broken specs

* Wrap listing create in a transaction

* Wrap listings bump into a transaction

* Avoid microseconds issue with datetimes in tests

* Use .detect instead of .select.first

* Fix spec description
2019-07-09 10:11:18 -04:00
Ben Halpern
4ebfcd8bc0
Self-serve sponsorship options (#3371)
* WIP - Initial work on sponsorship landing page

* Add initial partnership page
2019-07-03 12:04:03 -04:00
Andy Zhao
22e76bee84 Add functionality to remove and recover identity (#3377)
* Lint some quotation marks

* Add BackupData table

* Add identity and removal functionality

* Test additional functionality

* Remove dependent destroy for backup data

* Add auth_data_dump column

* Add challenge to reserved words

* Add more shoulda matchers
2019-07-03 12:01:16 -04:00
Anna Buianova
d6a151703c Podcasts reachable status #2952 (#3341)
* Podcasts reachable status #2952

* Specs for podcasts statuses
2019-07-02 09:18:27 -04:00
Bolarinwa Balogun
b52d8e931d Add Instagram URL to profile links (#3307) 2019-06-26 08:56:07 -04:00
rhymes
7da7a16d8d Pro: add referrers to dashboard and single article stats (#3295)
* Reorganize PageViewsController

* Add domain and path to PageView model

* Add before_create callback to populate domain and path

* Add list of referrers to AnalyticsService

* Add referrers to the UI

* Remove useless referrers card and tweak table line height

* Add referrer stats to article stats page

* Add not null and empty default to domain and path

* Refactor JS analytics client

* create_list is a step back here

* Revert "Add not null and empty default to domain and path"

This reverts commit bc02440076047a887c65d300bccd4661ecc8ffd0.

* Add index on domain concurrently

* Make the script more robust
2019-06-25 13:58:09 -04:00