Commit graph

42 commits

Author SHA1 Message Date
Molly Struve
38634e5316
[deploy] Optimization: Remove Comment Count From Aysnc user_data (#8174) 2020-06-01 10:38:57 -05:00
Molly Struve
8e0828d86b
[deploy] Optimization: Remove Unused Fields From Async user_data, optimize a couple other methods (#8173) 2020-05-31 13:21:32 -05:00
Molly Struve
b6a88778ad
Optimization:Remove followed_organization_ids from Async user_data (#8176) 2020-05-30 11:40:21 +02:00
Molly Struve
15d2dd0b3a
Remove cached_followed_tag_names From Async User Data (#8148) 2020-05-29 10:24:26 -04:00
Mac Siri
4edf1c5ada
[deploy] Create onboarding task card (#7369) 2020-04-22 11:46:49 -04:00
Vaidehi Joshi
b72fc4c9f8
Remove variants from backend portion of onboarding (#7118) [deploy]
* Remove variants from backend portion of onboarding

Since we're no longer using variants in onboarding, we don't need this code anymore!

* Ignore unused column on user, onboarding_variant_version
2020-04-06 16:30:11 -07:00
Sebastien
665f5aac0f
Refactor ProfileImage (#5803) 2020-02-07 08:56:16 -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
c1638cfd33
Create UpdateAnalyticsWorker to replace UpdateAnalyticsJob (#5331) 2020-01-02 13:05:12 -05:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -05:00
Molly Struve
98b832155f Ensure remember_user_token is present for Fastly with specs (#5065) 2019-12-10 15:01:26 -05:00
Molly Struve
7c650dcb1c
Remove RedisRailsCache and replace with Rails.cache (#5059) [deploy] 2019-12-10 13:11:08 -06:00
Molly Struve
880f60beff
Move user_data async controller cache to Redis (#4809) [deploy] 2019-11-13 10:25:17 -06:00
Andy Zhao
0f3c4a5a9a Add additional cache value for block (#4790) [deploy] 2019-11-12 10:59:54 -06:00
Andy Zhao
b2e18aeb72 Use Redis for session storage (#4004) [deploy]
* WIP use redis-session-store for sessions

* Use Redis as session storage

* Add redis-server to Travis

* Use integer for SESSION_EXPIRY_SECONDS env variable

Co-Authored-By: rhymes <rhymesete@gmail.com>

* Remove sessions b/c no custom sessions logic

* Use ApplicationConfig instead

* Rename default value

* Remove rememberable module

* Persist the user for the test

* Remove remember_me related tests

* Revert 'undo remember_me' commits

* Add redis to procfile

* Cleanup devise configuration

* Move REDIS configuration in the basic configuration section

* Make sure the expiration time can't zero

* Restore old order and remove useless comment line

* Delete legacy session cookie after login

Once deployed the server will start using the new session cookie, this makes sure the legacy one is deleted on the user's browser

* Remove redis from Procfile

* Add signed, secure and httponly to the Redis session cookie
2019-11-12 10:10:34 -06:00
Andy Zhao
85d8f52789 Hide a blocked user's content [deploy] (#4678)
* Hide blocked users' content appropriately

* Use RESTful create route

* Update functionality to block the user

* Fix specs for new route

* Use const instead of var

* Add noopener and noreferrer

* Remove caching for blocked user ids

* Add new rule for lack of noopener noreferrer

* Update snapshot
2019-11-04 14:47:26 -05: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
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
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
cyrillefr
30828cf0f7 Move delayed calls for update analytics to Active job (#3603)
* Move delayed calls for update analytics to Active job

  - add job + job spec
  - refactoring

* update namings+specs due to requested changes after review

* Fixes on analytics job spec + minor refactor of service
2019-08-16 12:41:37 -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
rhymes
7f2045b250 Pro Analytics: stats for a single article (#3120)
* Add /stats endpoint for articles, opened only to Pro users

* Add analytics to article stats page

* Add stats button to the article page and test stats page
2019-06-13 19:02:09 -04:00
Ben Halpern
c76abbbdb3
Allow users to follow podcasts (#2690)
* Allow users to follow podcasts

* Only display podcasts user follows

* Add main_color_hex to factory

* Fix podcast test and modify styles

* Fix tests

* Remove weird test
2019-05-04 15:30:40 -04:00
Ben Halpern
d76a37a6fe
Add GA_FETCH_RATE ENV var to ease rate limiting (#2461) 2019-04-15 14:11:55 -04:00
Ben Halpern
bd95c6a8bf
Fix human language detection (#2338)
* Update language detection

* Modify feed to account for languages
2019-04-08 15:47:29 -04:00
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
Ben Halpern
d6ab255a45
Allow users to configure to use night mode (beta) and sans-serif article body (#2072)
* Initial work for config

* Add config for users

* Fix schema
2019-03-15 13:11:53 -04:00
Ben Halpern
532903c688
Add experience level averaging to articles (#1922)
* Add experience level averaging to articles

* Adjust copy on /mod ratings page
2019-02-28 08:17:29 -08:00
Mac Siri
2e647cedb4 Add more test coverage (#1829)
* Create github repos request spec

* Create article_mutes_spec.rb

* Create moderation_service_spec.rb

* Create push notification subscriptions spec

* Add PodcastEpisodeDecorator specs

* Remove randomness in test

* Create specs for ArticleWithVideoCreationService

* Update spec/decorators/podcast_episode_decorator_spec.rb

Co-Authored-By: maestromac <krairit.siri@gmail.com>
2019-02-22 09:16:57 -08:00
rhymes
51a9e8be0a Order my tags by weight, popularity and name (#1583) 2019-01-20 11:29:37 -05:00
rhymes
6553f08d94 Rubocop cleanups (#1415)
* Update rubocop-todo.yml with new violations

* Fix Layout/EmptyLine* rules

* Fix Layout/Indentation* rules

* Fix remaining Layout/* rules

* Fix Lint/DuplicateMethods by removing unused accessor

* Fix Lint/IneffectiveAccessModifier

* Fix Lint/MissingCopEnableDirective

* Re-run rubocop auto gen config

* Fix Layout/RescueEnsureAlignment

* Fix Naming/* rules

* Fix some RSpec/* rules

* Fix typos

* Fix RSpec/LetBeforeExamples

* Series should only be an attr_writer, not an attr_accessor

* Fix RSpec/InstanceVariable

* Fix RSpec/InstanceVariable

* Fix RSpec/RepeatedDescription and RSpec/RepeatedExample

* Fix Style/ClassAndModuleChildren

* Fix Style/ConditionalAssignment

* Fix some Style/* rules

* Trigger Travis CI build because failing tests are not failing locally

* Revert "Fix Style/ClassAndModuleChildren"

This reverts commit 1686801d8a1516ba1894f79e24401a20dea65f99.
2019-01-02 11:20:02 -05:00
Ben Halpern
651ab3ce35
Add point weights for tag follows (#1229)
* Add point weights for tag follows

* Adjust num articles to initially show up on home page

* Fix schema.rb

* Adjust follow policy spec

* Adjust dashboard styling for follow points form
2018-11-30 15:36:58 -05:00
Ben Halpern
c5807205b5
Adjust dashboard analytics to be more reliable (#1115)
* Update analytics

* Remove analytics file

* Remove unused files

* Add delete button back in on dashboard
2018-11-13 20:37:29 -05:00
Ben Halpern
8b1755a2b3
Add organization to feed and adjust page styling (#1089)
* Add organization to feed and adjust page styling

* Add conditional indexing to article agolia

* Early return in algolia org logic

* Make org optional in algolia

* Modify org cta styling
2018-11-12 12:28:51 -05:00
Ben Halpern
221c363af0
Reduce queries in typical stories#show response + small fixes (#903)
* Reduce queries in typical stories#show response + small fixes

* Change const to git in non-es6 code
2018-10-13 19:38:38 -04:00
Maksim Litvinov
33db32e5f4 Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Ben Halpern
13a92d17cb
Add a couple basic request specs (#478) 2018-06-21 18:35:34 -04:00
Andy Zhao
263a74bcb6 Add more request specs (#460)
* Remove email blank onboarding redirect

* Add authorization specs for video upload

* Add registration spec

* Remove skip before actions for signup complete

* Use new param for abuse reports

* Remove else because it never runs

* Add more dashboard request specs

* Use let with no bang in case there are errors
2018-06-20 17:46:23 -04:00
Ben Halpern
0941b2e4fb
Add some tests around model validations (#459)
* Modify sample_application.yml and write test

* Add ahrefs verification

* Add some tests around model validations

* Indent an end

* Add a few tests

* Add tests and reserved words

* Fix live articles spec typo

* Modify ga_events_controller
2018-06-20 17:14:08 -04:00
Ben Halpern
04aa888d5c
Add inline moderation buttons (#401) 2018-06-07 12:47:31 -04:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00