Commit graph

244 commits

Author SHA1 Message Date
Colby Melvin
4531679c23 fix tag input swallowing numeric keycodes [deploy] (#4283)
* fix tag input swallowing numeric keycodes

* add AR validation for Tags class

* allow whitespace in Tag.name

* fix specs

* whitespace

* reformat
2019-11-05 16:20:34 -05:00
rhymes
027dbb027b Return 401 instead of 500 when a channel is blocked (#4721) 2019-11-04 10:39:18 -05:00
Brad Pauly
b59aba415d ArticlesController#feed refactor (#4498)
* Move query details into model.
Reorganize filtering initial results by params.

* Fixups from feedback.
2019-10-30 12:35:53 -04:00
rhymes
36d1df7f49 Routine rubocop lint fixes (#4638) [ci skip] 2019-10-30 10:46:57 -04:00
Andy Stabler
198efec024 Refactor collection spec (#4597) [ci skip] 2019-10-30 10:32:41 -04:00
rhymes
d6d251e9ce Remove unused spec support BackgroundJobs (#4464) [ci skip] 2019-10-24 16:49:45 -04:00
Fabbri Paolo
89e893f157 Fix rubocop detected offenses (#4552)
* Run Inspecting 1050 files
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.....................................................................................................................................................................................................................................................................................................

Offenses:

spec/models/article_spec.rb:195:7: C: RSpec/NestedGroups: Maximum example group nesting exceeded [4/3]. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups)
      context "when description is empty" do
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1050 files inspected, 1 offense detected to fix autofixable errors

* Refactor  to correct test

it was braking the rule RSpec/NestedGroups: Maximum example group nesting exceeded [4/3]. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups)

* Run `rubocop --auto-gen-config` to regenrate `.rubocop_todo.yml`
2019-10-24 11:53:03 -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
Araslanov Evgeny
02a75b6efa Remove unused methods _without_delay (#4366) [ci skip] 2019-10-16 10:35:49 -04:00
rhymes
e461f0d799 Routine rubocop fixes after gem update (#4309)
* Regenerate rubocop todo

* Fix outstanding problems

* Fix Style/FormatStringToken

* Final update to rubocop todo file

* Set RSpec/ExampleLength to max 10 and regenerate todo file
2019-10-10 17:27:01 -04:00
Araslanov Evgeny
14796a9b84 Fix how white space is detected in frontmatter (#4265) 2019-10-08 16:53:10 -04:00
Anna Buianova
00b602364e Fix pro_membership_spec's lint (#4193) [ci skip] 2019-10-02 13:04:43 -04:00
Mac Siri
dd391d5e34
Validates Article's published_at (#4140) 2019-10-01 15:57:36 -04:00
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