Commit graph

829 commits

Author SHA1 Message Date
Andy Zhao
3b0f6f2834 Refactor remove_all and remove_each notifications and fix orphaned notifications (#3570) 2019-09-25 15:31:56 -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
Mac Siri
465a676d75 Adjust BufferUpdatesController's authorization (#4070)
* Add back validation and add test

* Move article_admin?

* Adjust Buffer policy

* Create buffer_update_policy_spec
2019-09-20 11:50:34 -07:00
Anna Buianova
c07eb8d9cd Define Doorkeeper::Application association (#4065) [ci skip] 2019-09-19 10:28:55 -04:00
Ben Halpern
d9634150d8
Add new mod links and tooling (#4009)
* Add new mod links and tooling

* Adjust mod page copy, test
2019-09-12 00:11:01 -04:00
Jacob Herrington
59e7c104f2 Remove commented code and tests (#3989) [ci skip] 2019-09-09 14:51:02 -04:00
rhymes
b6c27f34fa Use a sortable unique ID for the event_id (#3972) 2019-09-09 10:15:12 -04:00
Anna Buianova
4c9a40be41 Dispatch events to the webhook endpoints #3715 (#3872)
* Start with webhooks: table and model

* Start with webhooks api

* Start with webhooks api

* Webhook::Event class and events list

* Remove commented callbacks

* Start with sending events to webhook endpoints

* A couple of tests for Articles::Creator

* Send event to webhook endpoint on article destroy

* Dispatch event on article update

* Dispatch event when an article updated from admin

* Spec for the webhook job

* One more test for the dispatch event job

* Integration-like spec for event dispatching to webhook endpoints when creating an article

* Use Addressable::URI to parse endpoint url

* Add oj as a faster fast_jsonapi backend

* Renamed serializers

* Move article serialization out of a model

* Don't allow to create a webhook event with invalid type

* Add fields for ArticleSerializer

* Fix webhook event job specs

* Specify timeout when dispatching events

* Fix webhook job spec

* Change webhook events queue name

* Change serialized article fields for the dispatchable events

* Include user data when serializing an article for webhook event

* Moved decorating out of Webhook::DispatchEvent, fixed most specs

* Fix route in ArticleSerializer

* Move Article decoration to Webhook::PayloadAdapter

* Refactor image url helpers to avoid including helpers into serializer

* Fix specs

* Default url options for production
2019-09-07 13:17:45 -04:00
not-a-patch
6b7d45baed Update article specs to include missing dependent: :destroy (#3873) [ci skip] 2019-09-03 17:38:13 -04:00
rhymes
676cf002bd Webhooks: API fixes and docs (#3901)
* Fix webhook API and add POST /api/webhooks docs

* Document GET /api/webhooks/:id

* Fix DELETE /api/webhooks/{id} and document it

* Add proper 404 specs
2019-09-03 10:41:23 -04:00
Anna Buianova
bfdf636dcf Implement webhook & API endpoints #3715 (#3783) 2019-08-29 10:23:41 -04:00
Ben Halpern
9259a70ab8
Modify onboarding slides (#3864) 2019-08-28 11:05:57 -04:00
cyrillefr
369aeb9130 Fix comment deletion bug (#3732)
Fix bug where deleted comment still appears on user's profile
2019-08-27 17:07:09 -04:00
Ben Halpern
76bedc6b23
Add onboarding variants and update variant display ratio (#3812) 2019-08-23 12:48:29 -04:00
Anna Buianova
5deb668ecd Rubocop fixes (#3774) 2019-08-20 10:32:26 -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
Andy Zhao
6316ea4b60 Allow admins to undo a tag adjustment (#3653)
* Add ability to delete a tag adjustment

* Fix confirm alert
2019-08-14 09:26:26 -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
Bolarinwa Balogun
eb132f3dc2 Improve Error Message for malformed Github Repo Links (#3608)
* Improve Error Message for malformed Github Repo Links

* Add test
2019-08-06 10:39:49 -04:00
rhymes
4689cdd266 Collection: remove optional user and add tests (#3383) 2019-08-02 10:15:04 -04:00
Mac Siri
9a2c856dd4
Update Complexity linters (#3507) [ci skip] 2019-08-01 16:38:27 -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
João Pedro Raskopf
5d13752e34 Show article edit date in dashboard (#3325) 2019-07-31 14:13:24 -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
816c062ea0 Upgrade Rubocop related gems and fix new violations (#3581) [ci skip] 2019-07-30 14:29:05 -04:00
Bolarinwa Balogun
7f125f18df Fix Video Duration to include hours (#3572) 2019-07-30 09:10:49 -04:00
Anna Buianova
f5709ce2d8 Fix failing algolia jobs (#3578)
* Fix algolia sync when destroying comments

* Fix algolia jobs when destroying a user
2019-07-30 08:47:40 -04:00
cyrillefr
fb1915c1be Move delayed algoliasearch tasks to Active Jobs (#3486)
- refactor calls to use built-in algolia Active Job
  - add spec
2019-07-29 08:58:27 -04:00
Anna Buianova
3de1bdad02 Podcast ownership (#3546)
* Podcast#admins

* Start with /internal/podcasts

* Adding and removing podcast admin roles

* Improve podcasts internal section

* Fix podcast updating

* More internal podcasts specs

* Podcasts internal link
2019-07-29 08:32:49 -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
rhymes
cecd1db070 Sponsorship: business logic (step 2) (#3440)
* Add Sponsorship model

* Add Sponsorship to admin

* Add correct relationships between models

* Add temporary script to migrate sponsorship data

* Use constants for enums

* Use Sponsorship model in PartnershipsController

* Use Sponsorship in the views

* Validate sponsorship levels and tag combos

* Replace the rest of the sponsorship code to use Sponsorship
2019-07-10 16:40:56 -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
Ben Halpern
87002e5786
Fix profile pin display limit (#3427) 2019-07-09 15:42:46 -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
rhymes
5db8b7e1e5 Fix Rubocop lint (#3423) [ci skip] 2019-07-09 09:06:38 -04:00
Ben Halpern
a5ccfb2b32
Add history to sidebar for pro users (#3417)
* Add history to sidebar for pro users

* Add filmstrip image
2019-07-08 18:10:01 -04:00
Edison Yap
8ffe0f3de3 Bust cache for articles in series (#3052) 2019-07-08 17:28:27 -04:00
Mac Siri
d997ffee4f
Run yarn upgrade (#3419) 2019-07-08 17:03:19 -04:00
Anna Buianova
c3ed38f832 Moved creating a new podcast to a separate ActiveJob #2952 (#3373)
* Podcasts reachable status #2952

* Specs for podcasts statuses

* Moved podcast episode create to a separate ActiveJob

* Use RssItemData wrapper in GetEpisode for consistency

* Reorganize services/podcasts
2019-07-04 13:10:54 -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
186e5bb52b Fix lint (#3342) [ci skip] 2019-07-01 11:32:28 -04:00
Mazen Touati
6797567de9 Fix instagram URL validation rule (#3336) 2019-07-01 08:16:34 -04:00
Anna Buianova
7ee0350ac5 Refactored and optimized getting existing podcast episode (#3319)
* Refactored and optimized getting existing podcast episode

* Podcast#existing_episode fixes
2019-06-27 11:50:27 -04:00
Ben Halpern
26af371ebd
Fix comment title encoding issue (#3311)
* Fix comment title encoding issue

* Remove puts statements

* Fix flaky test

* Change flaky test

* Add & fix
2019-06-26 15:24:05 -04:00
Bolarinwa Balogun
dbc4abc587 Add rel="nofollow" to links in comments (#3304)
* Add rel="nofollow" to links in comments

* Improve code quality and Add tests
2019-06-26 09:02:11 -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
Eduardo Alencar
6d800da4d4 Increase tag length from 20 to 30 chars (#3299)
This commit increases the tag length from 20 to 30 chars and also increases the cached_tag_list length to maintain the limit of 4 tags. Specs were adapted to respect the changes.
2019-06-24 16:43:21 -04:00